diff --git a/.openapi-generator/FILES b/.openapi-generator/FILES index f507d6ef..2e9ee3ae 100644 --- a/.openapi-generator/FILES +++ b/.openapi-generator/FILES @@ -28,6 +28,7 @@ koyeb/api/api/organization_quotas_api.py koyeb/api/api/payment_methods_api.py koyeb/api/api/persistent_volumes_api.py koyeb/api/api/profile_api.py +koyeb/api/api/projects_api.py koyeb/api/api/provisioning_api.py koyeb/api/api/quotas_api.py koyeb/api/api/regional_deployments_api.py @@ -68,6 +69,7 @@ koyeb/api/docs/AutocompleteReply.md koyeb/api/docs/AutocompleteRequest.md koyeb/api/docs/AvailabilityLevel.md koyeb/api/docs/AzureContainerRegistryConfiguration.md +koyeb/api/docs/BasicAuthPolicy.md koyeb/api/docs/BillingApi.md koyeb/api/docs/Budget.md koyeb/api/docs/BuildpackBuilder.md @@ -80,6 +82,7 @@ koyeb/api/docs/CatalogInstanceUsageApi.md koyeb/api/docs/CatalogInstancesApi.md koyeb/api/docs/CatalogRegionsApi.md koyeb/api/docs/CatalogUsage.md +koyeb/api/docs/CheckCouponReply.md koyeb/api/docs/ClearIdenfyVerificationResultRequest.md koyeb/api/docs/ComposeApi.md koyeb/api/docs/ComposeReply.md @@ -106,6 +109,8 @@ koyeb/api/docs/CreateOrganizationRequest.md koyeb/api/docs/CreatePaymentAuthorizationReply.md koyeb/api/docs/CreatePersistentVolumeReply.md koyeb/api/docs/CreatePersistentVolumeRequest.md +koyeb/api/docs/CreateProject.md +koyeb/api/docs/CreateProjectReply.md koyeb/api/docs/CreateSecret.md koyeb/api/docs/CreateSecretReply.md koyeb/api/docs/CreateService.md @@ -214,11 +219,13 @@ koyeb/api/docs/GetOrganizationUsageDetailsReply.md koyeb/api/docs/GetOrganizationUsageReply.md koyeb/api/docs/GetPaymentMethodReply.md koyeb/api/docs/GetPersistentVolumeReply.md +koyeb/api/docs/GetProjectReply.md koyeb/api/docs/GetQuotasReply.md koyeb/api/docs/GetRegionReply.md koyeb/api/docs/GetRegionalDeploymentReply.md koyeb/api/docs/GetSecretReply.md koyeb/api/docs/GetServiceReply.md +koyeb/api/docs/GetServiceScalingReply.md koyeb/api/docs/GetSnapshotReply.md koyeb/api/docs/GetSubscriptionReply.md koyeb/api/docs/GetUserOrganizationInvitationReply.md @@ -263,6 +270,7 @@ koyeb/api/docs/KsearchRegionalDeployment.md koyeb/api/docs/KsearchSearchReply.md koyeb/api/docs/KsearchService.md koyeb/api/docs/KsearchUser.md +koyeb/api/docs/LifecycleQuotas.md koyeb/api/docs/ListAppEventsReply.md koyeb/api/docs/ListAppsReply.md koyeb/api/docs/ListCatalogInstancesReply.md @@ -278,6 +286,7 @@ koyeb/api/docs/ListOrganizationMembersReply.md koyeb/api/docs/ListPaymentMethodsReply.md koyeb/api/docs/ListPersistentVolumeEventsReply.md koyeb/api/docs/ListPersistentVolumesReply.md +koyeb/api/docs/ListProjectsReply.md koyeb/api/docs/ListRegionalDeploymentEventsReply.md koyeb/api/docs/ListRegionalDeploymentsReply.md koyeb/api/docs/ListRegionsReply.md @@ -295,6 +304,7 @@ koyeb/api/docs/LoginReply.md koyeb/api/docs/LoginRequest.md koyeb/api/docs/LogsApi.md koyeb/api/docs/ManageReply.md +koyeb/api/docs/ManualServiceScaling.md koyeb/api/docs/MembersSummary.md koyeb/api/docs/MetricName.md koyeb/api/docs/MetricsApi.md @@ -343,6 +353,8 @@ koyeb/api/docs/Plan.md koyeb/api/docs/Port.md koyeb/api/docs/PrivateRegistryConfiguration.md koyeb/api/docs/ProfileApi.md +koyeb/api/docs/Project.md +koyeb/api/docs/ProjectsApi.md koyeb/api/docs/ProvisioningApi.md koyeb/api/docs/ProxyPortProtocol.md koyeb/api/docs/PublicOrganization.md @@ -377,6 +389,7 @@ koyeb/api/docs/ReviewOrganizationCapacityReply.md koyeb/api/docs/ReviewOrganizationCapacityRequest.md koyeb/api/docs/Route.md koyeb/api/docs/Sample.md +koyeb/api/docs/SandboxMetadata.md koyeb/api/docs/ScaleToZeroQuotas.md koyeb/api/docs/Scaling.md koyeb/api/docs/SearchApi.md @@ -384,6 +397,7 @@ koyeb/api/docs/Secret.md koyeb/api/docs/SecretType.md koyeb/api/docs/SecretsApi.md koyeb/api/docs/SecretsSummary.md +koyeb/api/docs/SecurityPolicies.md koyeb/api/docs/Service.md koyeb/api/docs/ServiceEvent.md koyeb/api/docs/ServiceLifeCycle.md @@ -422,6 +436,8 @@ koyeb/api/docs/UpdateBudgetRequest.md koyeb/api/docs/UpdateCredentialReply.md koyeb/api/docs/UpdateDomain.md koyeb/api/docs/UpdateDomainReply.md +koyeb/api/docs/UpdateOrganizationDefaultProjectReply.md +koyeb/api/docs/UpdateOrganizationDefaultProjectRequest.md koyeb/api/docs/UpdateOrganizationNameReply.md koyeb/api/docs/UpdateOrganizationNameRequest.md koyeb/api/docs/UpdateOrganizationPlanReply.md @@ -430,9 +446,11 @@ koyeb/api/docs/UpdateOrganizationReply.md koyeb/api/docs/UpdatePasswordRequest.md koyeb/api/docs/UpdatePersistentVolumeReply.md koyeb/api/docs/UpdatePersistentVolumeRequest.md +koyeb/api/docs/UpdateProjectReply.md koyeb/api/docs/UpdateSecretReply.md koyeb/api/docs/UpdateService.md koyeb/api/docs/UpdateServiceReply.md +koyeb/api/docs/UpdateServiceScalingRequest.md koyeb/api/docs/UpdateSnapshotReply.md koyeb/api/docs/UpdateSnapshotRequest.md koyeb/api/docs/UpdateUserRequestUserUpdateBody.md @@ -473,6 +491,7 @@ koyeb/api/models/autocomplete_reply.py koyeb/api/models/autocomplete_request.py koyeb/api/models/availability_level.py koyeb/api/models/azure_container_registry_configuration.py +koyeb/api/models/basic_auth_policy.py koyeb/api/models/budget.py koyeb/api/models/buildpack_builder.py koyeb/api/models/canny_auth_reply.py @@ -480,6 +499,7 @@ koyeb/api/models/catalog_gpu_details.py koyeb/api/models/catalog_instance.py koyeb/api/models/catalog_instance_list_item.py koyeb/api/models/catalog_usage.py +koyeb/api/models/check_coupon_reply.py koyeb/api/models/clear_idenfy_verification_result_request.py koyeb/api/models/compose_reply.py koyeb/api/models/config_file.py @@ -504,6 +524,8 @@ koyeb/api/models/create_organization_request.py koyeb/api/models/create_payment_authorization_reply.py koyeb/api/models/create_persistent_volume_reply.py koyeb/api/models/create_persistent_volume_request.py +koyeb/api/models/create_project.py +koyeb/api/models/create_project_reply.py koyeb/api/models/create_secret.py koyeb/api/models/create_secret_reply.py koyeb/api/models/create_service.py @@ -608,11 +630,13 @@ koyeb/api/models/get_organization_usage_details_reply.py koyeb/api/models/get_organization_usage_reply.py koyeb/api/models/get_payment_method_reply.py koyeb/api/models/get_persistent_volume_reply.py +koyeb/api/models/get_project_reply.py koyeb/api/models/get_quotas_reply.py koyeb/api/models/get_region_reply.py koyeb/api/models/get_regional_deployment_reply.py koyeb/api/models/get_secret_reply.py koyeb/api/models/get_service_reply.py +koyeb/api/models/get_service_scaling_reply.py koyeb/api/models/get_snapshot_reply.py koyeb/api/models/get_subscription_reply.py koyeb/api/models/get_user_organization_invitation_reply.py @@ -654,6 +678,7 @@ koyeb/api/models/ksearch_regional_deployment.py koyeb/api/models/ksearch_search_reply.py koyeb/api/models/ksearch_service.py koyeb/api/models/ksearch_user.py +koyeb/api/models/lifecycle_quotas.py koyeb/api/models/list_app_events_reply.py koyeb/api/models/list_apps_reply.py koyeb/api/models/list_catalog_instances_reply.py @@ -669,6 +694,7 @@ koyeb/api/models/list_organization_members_reply.py koyeb/api/models/list_payment_methods_reply.py koyeb/api/models/list_persistent_volume_events_reply.py koyeb/api/models/list_persistent_volumes_reply.py +koyeb/api/models/list_projects_reply.py koyeb/api/models/list_regional_deployment_events_reply.py koyeb/api/models/list_regional_deployments_reply.py koyeb/api/models/list_regions_reply.py @@ -685,6 +711,7 @@ koyeb/api/models/login_method_reply_method.py koyeb/api/models/login_reply.py koyeb/api/models/login_request.py koyeb/api/models/manage_reply.py +koyeb/api/models/manual_service_scaling.py koyeb/api/models/members_summary.py koyeb/api/models/metric_name.py koyeb/api/models/neon_postgres_database.py @@ -724,6 +751,7 @@ koyeb/api/models/persistent_volume_status.py koyeb/api/models/plan.py koyeb/api/models/port.py koyeb/api/models/private_registry_configuration.py +koyeb/api/models/project.py koyeb/api/models/proxy_port_protocol.py koyeb/api/models/public_organization.py koyeb/api/models/public_user.py @@ -754,11 +782,13 @@ koyeb/api/models/review_organization_capacity_reply.py koyeb/api/models/review_organization_capacity_request.py koyeb/api/models/route.py koyeb/api/models/sample.py +koyeb/api/models/sandbox_metadata.py koyeb/api/models/scale_to_zero_quotas.py koyeb/api/models/scaling.py koyeb/api/models/secret.py koyeb/api/models/secret_type.py koyeb/api/models/secrets_summary.py +koyeb/api/models/security_policies.py koyeb/api/models/service.py koyeb/api/models/service_event.py koyeb/api/models/service_life_cycle.py @@ -791,6 +821,8 @@ koyeb/api/models/update_budget_request.py koyeb/api/models/update_credential_reply.py koyeb/api/models/update_domain.py koyeb/api/models/update_domain_reply.py +koyeb/api/models/update_organization_default_project_reply.py +koyeb/api/models/update_organization_default_project_request.py koyeb/api/models/update_organization_name_reply.py koyeb/api/models/update_organization_name_request.py koyeb/api/models/update_organization_plan_reply.py @@ -799,9 +831,11 @@ koyeb/api/models/update_organization_reply.py koyeb/api/models/update_password_request.py koyeb/api/models/update_persistent_volume_reply.py koyeb/api/models/update_persistent_volume_request.py +koyeb/api/models/update_project_reply.py koyeb/api/models/update_secret_reply.py koyeb/api/models/update_service.py koyeb/api/models/update_service_reply.py +koyeb/api/models/update_service_scaling_request.py koyeb/api/models/update_snapshot_reply.py koyeb/api/models/update_snapshot_request.py koyeb/api/models/update_user_request_user_update_body.py @@ -820,4 +854,21 @@ koyeb/api/models/verify_docker_image_reply.py koyeb/api/models/verify_docker_image_reply_err_code.py koyeb/api/rest.py koyeb/api/test/__init__.py +koyeb/api/test/test_basic_auth_policy.py +koyeb/api/test/test_check_coupon_reply.py +koyeb/api/test/test_create_project.py +koyeb/api/test/test_create_project_reply.py +koyeb/api/test/test_get_project_reply.py +koyeb/api/test/test_get_service_scaling_reply.py +koyeb/api/test/test_lifecycle_quotas.py +koyeb/api/test/test_list_projects_reply.py +koyeb/api/test/test_manual_service_scaling.py +koyeb/api/test/test_project.py +koyeb/api/test/test_projects_api.py +koyeb/api/test/test_sandbox_metadata.py +koyeb/api/test/test_security_policies.py +koyeb/api/test/test_update_organization_default_project_reply.py +koyeb/api/test/test_update_organization_default_project_request.py +koyeb/api/test/test_update_project_reply.py +koyeb/api/test/test_update_service_scaling_request.py koyeb/api_README.md diff --git a/.openapi-generator/VERSION b/.openapi-generator/VERSION index 2fb556b6..0610c66b 100644 --- a/.openapi-generator/VERSION +++ b/.openapi-generator/VERSION @@ -1 +1 @@ -7.18.0-SNAPSHOT +7.21.0-SNAPSHOT diff --git a/Makefile b/Makefile index d512beec..7e139484 100644 --- a/Makefile +++ b/Makefile @@ -4,11 +4,24 @@ GIT_USER_ID?=koyeb GIT_REPO_ID?=koyeb-api-client-python OPENAPI_GENERATOR_VERSION?=latest PACKAGE_VERSION?=1.3.3 +DOCKER ?= docker .PHONY: gen-api-client gen-api-client: - docker run --rm -v `pwd`/spec:/spec -v `pwd`:/builder openapitools/openapi-generator-cli:${OPENAPI_GENERATOR_VERSION} generate --git-user-id ${GIT_USER_ID} --git-repo-id ${GIT_REPO_ID} -i /spec/openapi.json -g python -o /builder --package-name koyeb.api --additional-properties packageVersion=${PACKAGE_VERSION} --additional-properties licenseInfo="Apache-2.0" --additional-properties generateSourceCodeOnly=true + $(DOCKER) run --rm \ + -v `pwd`/spec:/spec \ + -v `pwd`:/builder openapitools/openapi-generator-cli:${OPENAPI_GENERATOR_VERSION} \ + generate \ + --git-user-id ${GIT_USER_ID} \ + --git-repo-id ${GIT_REPO_ID} \ + -i /spec/openapi.json \ + -g python \ + -o /builder \ + --package-name koyeb.api \ + --additional-properties packageVersion=${PACKAGE_VERSION} \ + --additional-properties licenseInfo="Apache-2.0" \ + --additional-properties generateSourceCodeOnly=true git checkout -- koyeb/__init__.py diff --git a/koyeb/api/__init__.py b/koyeb/api/__init__.py index 52131662..c71a4f9e 100644 --- a/koyeb/api/__init__.py +++ b/koyeb/api/__init__.py @@ -3,14 +3,14 @@ # flake8: noqa """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -41,6 +41,7 @@ "PaymentMethodsApi", "PersistentVolumesApi", "ProfileApi", + "ProjectsApi", "ProvisioningApi", "QuotasApi", "RegionalDeploymentsApi", @@ -88,6 +89,7 @@ "AutocompleteRequest", "AvailabilityLevel", "AzureContainerRegistryConfiguration", + "BasicAuthPolicy", "Budget", "BuildpackBuilder", "CannyAuthReply", @@ -95,6 +97,7 @@ "CatalogInstance", "CatalogInstanceListItem", "CatalogUsage", + "CheckCouponReply", "ClearIdenfyVerificationResultRequest", "ComposeReply", "ConfigFile", @@ -119,6 +122,8 @@ "CreatePaymentAuthorizationReply", "CreatePersistentVolumeReply", "CreatePersistentVolumeRequest", + "CreateProject", + "CreateProjectReply", "CreateSecret", "CreateSecretReply", "CreateService", @@ -223,11 +228,13 @@ "GetOrganizationUsageReply", "GetPaymentMethodReply", "GetPersistentVolumeReply", + "GetProjectReply", "GetQuotasReply", "GetRegionReply", "GetRegionalDeploymentReply", "GetSecretReply", "GetServiceReply", + "GetServiceScalingReply", "GetSnapshotReply", "GetSubscriptionReply", "GetUserOrganizationInvitationReply", @@ -269,6 +276,7 @@ "KsearchSearchReply", "KsearchService", "KsearchUser", + "LifecycleQuotas", "ListAppEventsReply", "ListAppsReply", "ListCatalogInstancesReply", @@ -284,6 +292,7 @@ "ListPaymentMethodsReply", "ListPersistentVolumeEventsReply", "ListPersistentVolumesReply", + "ListProjectsReply", "ListRegionalDeploymentEventsReply", "ListRegionalDeploymentsReply", "ListRegionsReply", @@ -300,6 +309,7 @@ "LoginReply", "LoginRequest", "ManageReply", + "ManualServiceScaling", "MembersSummary", "MetricName", "NeonPostgresDatabase", @@ -339,6 +349,7 @@ "Plan", "Port", "PrivateRegistryConfiguration", + "Project", "ProxyPortProtocol", "PublicOrganization", "PublicUser", @@ -369,11 +380,13 @@ "ReviewOrganizationCapacityRequest", "Route", "Sample", + "SandboxMetadata", "ScaleToZeroQuotas", "Scaling", "Secret", "SecretType", "SecretsSummary", + "SecurityPolicies", "Service", "ServiceEvent", "ServiceLifeCycle", @@ -406,6 +419,8 @@ "UpdateCredentialReply", "UpdateDomain", "UpdateDomainReply", + "UpdateOrganizationDefaultProjectReply", + "UpdateOrganizationDefaultProjectRequest", "UpdateOrganizationNameReply", "UpdateOrganizationNameRequest", "UpdateOrganizationPlanReply", @@ -414,9 +429,11 @@ "UpdatePasswordRequest", "UpdatePersistentVolumeReply", "UpdatePersistentVolumeRequest", + "UpdateProjectReply", "UpdateSecretReply", "UpdateService", "UpdateServiceReply", + "UpdateServiceScalingRequest", "UpdateSnapshotReply", "UpdateSnapshotRequest", "UpdateUserRequestUserUpdateBody", @@ -438,15 +455,9 @@ # import apis into sdk package from koyeb.api.api.apps_api import AppsApi as AppsApi from koyeb.api.api.archives_api import ArchivesApi as ArchivesApi -from koyeb.api.api.catalog_datacenters_api import ( - CatalogDatacentersApi as CatalogDatacentersApi, -) -from koyeb.api.api.catalog_instance_usage_api import ( - CatalogInstanceUsageApi as CatalogInstanceUsageApi, -) -from koyeb.api.api.catalog_instances_api import ( - CatalogInstancesApi as CatalogInstancesApi, -) +from koyeb.api.api.catalog_datacenters_api import CatalogDatacentersApi as CatalogDatacentersApi +from koyeb.api.api.catalog_instance_usage_api import CatalogInstanceUsageApi as CatalogInstanceUsageApi +from koyeb.api.api.catalog_instances_api import CatalogInstancesApi as CatalogInstancesApi from koyeb.api.api.catalog_regions_api import CatalogRegionsApi as CatalogRegionsApi from koyeb.api.api.compose_api import ComposeApi as ComposeApi from koyeb.api.api.coupons_api import CouponsApi as CouponsApi @@ -458,28 +469,17 @@ from koyeb.api.api.intercom_api import IntercomApi as IntercomApi from koyeb.api.api.logs_api import LogsApi as LogsApi from koyeb.api.api.metrics_api import MetricsApi as MetricsApi -from koyeb.api.api.organization_confirmations_api import ( - OrganizationConfirmationsApi as OrganizationConfirmationsApi, -) -from koyeb.api.api.organization_invitations_api import ( - OrganizationInvitationsApi as OrganizationInvitationsApi, -) -from koyeb.api.api.organization_members_api import ( - OrganizationMembersApi as OrganizationMembersApi, -) -from koyeb.api.api.organization_quotas_api import ( - OrganizationQuotasApi as OrganizationQuotasApi, -) +from koyeb.api.api.organization_confirmations_api import OrganizationConfirmationsApi as OrganizationConfirmationsApi +from koyeb.api.api.organization_invitations_api import OrganizationInvitationsApi as OrganizationInvitationsApi +from koyeb.api.api.organization_members_api import OrganizationMembersApi as OrganizationMembersApi +from koyeb.api.api.organization_quotas_api import OrganizationQuotasApi as OrganizationQuotasApi from koyeb.api.api.payment_methods_api import PaymentMethodsApi as PaymentMethodsApi -from koyeb.api.api.persistent_volumes_api import ( - PersistentVolumesApi as PersistentVolumesApi, -) +from koyeb.api.api.persistent_volumes_api import PersistentVolumesApi as PersistentVolumesApi from koyeb.api.api.profile_api import ProfileApi as ProfileApi +from koyeb.api.api.projects_api import ProjectsApi as ProjectsApi from koyeb.api.api.provisioning_api import ProvisioningApi as ProvisioningApi from koyeb.api.api.quotas_api import QuotasApi as QuotasApi -from koyeb.api.api.regional_deployments_api import ( - RegionalDeploymentsApi as RegionalDeploymentsApi, -) +from koyeb.api.api.regional_deployments_api import RegionalDeploymentsApi as RegionalDeploymentsApi from koyeb.api.api.repositories_api import RepositoriesApi as RepositoriesApi from koyeb.api.api.search_api import SearchApi as SearchApi from koyeb.api.api.secrets_api import SecretsApi as SecretsApi @@ -508,9 +508,7 @@ from koyeb.api.exceptions import ApiException as ApiException # import models into sdk package -from koyeb.api.models.accept_organization_invitation_reply import ( - AcceptOrganizationInvitationReply as AcceptOrganizationInvitationReply, -) +from koyeb.api.models.accept_organization_invitation_reply import AcceptOrganizationInvitationReply as AcceptOrganizationInvitationReply from koyeb.api.models.action import Action as Action from koyeb.api.models.activity import Activity as Activity from koyeb.api.models.activity_list import ActivityList as ActivityList @@ -522,246 +520,118 @@ from koyeb.api.models.app_usage import AppUsage as AppUsage from koyeb.api.models.apps_summary import AppsSummary as AppsSummary from koyeb.api.models.archive import Archive as Archive -from koyeb.api.models.archive_deployment_metadata import ( - ArchiveDeploymentMetadata as ArchiveDeploymentMetadata, -) +from koyeb.api.models.archive_deployment_metadata import ArchiveDeploymentMetadata as ArchiveDeploymentMetadata from koyeb.api.models.archive_source import ArchiveSource as ArchiveSource from koyeb.api.models.auto_release import AutoRelease as AutoRelease from koyeb.api.models.auto_release_group import AutoReleaseGroup as AutoReleaseGroup from koyeb.api.models.autocomplete_reply import AutocompleteReply as AutocompleteReply -from koyeb.api.models.autocomplete_request import ( - AutocompleteRequest as AutocompleteRequest, -) +from koyeb.api.models.autocomplete_request import AutocompleteRequest as AutocompleteRequest from koyeb.api.models.availability_level import AvailabilityLevel as AvailabilityLevel -from koyeb.api.models.azure_container_registry_configuration import ( - AzureContainerRegistryConfiguration as AzureContainerRegistryConfiguration, -) +from koyeb.api.models.azure_container_registry_configuration import AzureContainerRegistryConfiguration as AzureContainerRegistryConfiguration +from koyeb.api.models.basic_auth_policy import BasicAuthPolicy as BasicAuthPolicy from koyeb.api.models.budget import Budget as Budget from koyeb.api.models.buildpack_builder import BuildpackBuilder as BuildpackBuilder from koyeb.api.models.canny_auth_reply import CannyAuthReply as CannyAuthReply from koyeb.api.models.catalog_gpu_details import CatalogGPUDetails as CatalogGPUDetails from koyeb.api.models.catalog_instance import CatalogInstance as CatalogInstance -from koyeb.api.models.catalog_instance_list_item import ( - CatalogInstanceListItem as CatalogInstanceListItem, -) +from koyeb.api.models.catalog_instance_list_item import CatalogInstanceListItem as CatalogInstanceListItem from koyeb.api.models.catalog_usage import CatalogUsage as CatalogUsage -from koyeb.api.models.clear_idenfy_verification_result_request import ( - ClearIdenfyVerificationResultRequest as ClearIdenfyVerificationResultRequest, -) +from koyeb.api.models.check_coupon_reply import CheckCouponReply as CheckCouponReply +from koyeb.api.models.clear_idenfy_verification_result_request import ClearIdenfyVerificationResultRequest as ClearIdenfyVerificationResultRequest from koyeb.api.models.compose_reply import ComposeReply as ComposeReply from koyeb.api.models.config_file import ConfigFile as ConfigFile -from koyeb.api.models.confirm_payment_authorization_reply import ( - ConfirmPaymentAuthorizationReply as ConfirmPaymentAuthorizationReply, -) -from koyeb.api.models.create_access_token_reply import ( - CreateAccessTokenReply as CreateAccessTokenReply, -) -from koyeb.api.models.create_access_token_request import ( - CreateAccessTokenRequest as CreateAccessTokenRequest, -) -from koyeb.api.models.create_account_request import ( - CreateAccountRequest as CreateAccountRequest, -) +from koyeb.api.models.confirm_payment_authorization_reply import ConfirmPaymentAuthorizationReply as ConfirmPaymentAuthorizationReply +from koyeb.api.models.create_access_token_reply import CreateAccessTokenReply as CreateAccessTokenReply +from koyeb.api.models.create_access_token_request import CreateAccessTokenRequest as CreateAccessTokenRequest +from koyeb.api.models.create_account_request import CreateAccountRequest as CreateAccountRequest from koyeb.api.models.create_app import CreateApp as CreateApp from koyeb.api.models.create_app_reply import CreateAppReply as CreateAppReply from koyeb.api.models.create_archive import CreateArchive as CreateArchive -from koyeb.api.models.create_archive_reply import ( - CreateArchiveReply as CreateArchiveReply, -) +from koyeb.api.models.create_archive_reply import CreateArchiveReply as CreateArchiveReply from koyeb.api.models.create_budget_reply import CreateBudgetReply as CreateBudgetReply from koyeb.api.models.create_compose import CreateCompose as CreateCompose from koyeb.api.models.create_credential import CreateCredential as CreateCredential -from koyeb.api.models.create_credential_reply import ( - CreateCredentialReply as CreateCredentialReply, -) +from koyeb.api.models.create_credential_reply import CreateCredentialReply as CreateCredentialReply from koyeb.api.models.create_domain import CreateDomain as CreateDomain from koyeb.api.models.create_domain_reply import CreateDomainReply as CreateDomainReply -from koyeb.api.models.create_organization_invitation_reply import ( - CreateOrganizationInvitationReply as CreateOrganizationInvitationReply, -) -from koyeb.api.models.create_organization_invitation_request import ( - CreateOrganizationInvitationRequest as CreateOrganizationInvitationRequest, -) -from koyeb.api.models.create_organization_reply import ( - CreateOrganizationReply as CreateOrganizationReply, -) -from koyeb.api.models.create_organization_request import ( - CreateOrganizationRequest as CreateOrganizationRequest, -) -from koyeb.api.models.create_payment_authorization_reply import ( - CreatePaymentAuthorizationReply as CreatePaymentAuthorizationReply, -) -from koyeb.api.models.create_persistent_volume_reply import ( - CreatePersistentVolumeReply as CreatePersistentVolumeReply, -) -from koyeb.api.models.create_persistent_volume_request import ( - CreatePersistentVolumeRequest as CreatePersistentVolumeRequest, -) +from koyeb.api.models.create_organization_invitation_reply import CreateOrganizationInvitationReply as CreateOrganizationInvitationReply +from koyeb.api.models.create_organization_invitation_request import CreateOrganizationInvitationRequest as CreateOrganizationInvitationRequest +from koyeb.api.models.create_organization_reply import CreateOrganizationReply as CreateOrganizationReply +from koyeb.api.models.create_organization_request import CreateOrganizationRequest as CreateOrganizationRequest +from koyeb.api.models.create_payment_authorization_reply import CreatePaymentAuthorizationReply as CreatePaymentAuthorizationReply +from koyeb.api.models.create_persistent_volume_reply import CreatePersistentVolumeReply as CreatePersistentVolumeReply +from koyeb.api.models.create_persistent_volume_request import CreatePersistentVolumeRequest as CreatePersistentVolumeRequest +from koyeb.api.models.create_project import CreateProject as CreateProject +from koyeb.api.models.create_project_reply import CreateProjectReply as CreateProjectReply from koyeb.api.models.create_secret import CreateSecret as CreateSecret from koyeb.api.models.create_secret_reply import CreateSecretReply as CreateSecretReply from koyeb.api.models.create_service import CreateService as CreateService -from koyeb.api.models.create_service_reply import ( - CreateServiceReply as CreateServiceReply, -) -from koyeb.api.models.create_snapshot_reply import ( - CreateSnapshotReply as CreateSnapshotReply, -) -from koyeb.api.models.create_snapshot_request import ( - CreateSnapshotRequest as CreateSnapshotRequest, -) -from koyeb.api.models.create_stage_attempt_request import ( - CreateStageAttemptRequest as CreateStageAttemptRequest, -) +from koyeb.api.models.create_service_reply import CreateServiceReply as CreateServiceReply +from koyeb.api.models.create_snapshot_reply import CreateSnapshotReply as CreateSnapshotReply +from koyeb.api.models.create_snapshot_request import CreateSnapshotRequest as CreateSnapshotRequest +from koyeb.api.models.create_stage_attempt_request import CreateStageAttemptRequest as CreateStageAttemptRequest from koyeb.api.models.credential import Credential as Credential from koyeb.api.models.credential_type import CredentialType as CredentialType -from koyeb.api.models.database_deployment_metadata import ( - DatabaseDeploymentMetadata as DatabaseDeploymentMetadata, -) -from koyeb.api.models.database_role_password import ( - DatabaseRolePassword as DatabaseRolePassword, -) +from koyeb.api.models.database_deployment_metadata import DatabaseDeploymentMetadata as DatabaseDeploymentMetadata +from koyeb.api.models.database_role_password import DatabaseRolePassword as DatabaseRolePassword from koyeb.api.models.database_source import DatabaseSource as DatabaseSource from koyeb.api.models.database_usage import DatabaseUsage as DatabaseUsage -from koyeb.api.models.database_usage_details import ( - DatabaseUsageDetails as DatabaseUsageDetails, -) -from koyeb.api.models.datacenter_list_item import ( - DatacenterListItem as DatacenterListItem, -) -from koyeb.api.models.deactivate_organization_reply import ( - DeactivateOrganizationReply as DeactivateOrganizationReply, -) -from koyeb.api.models.deactivate_organization_request import ( - DeactivateOrganizationRequest as DeactivateOrganizationRequest, -) -from koyeb.api.models.declare_stage_progress_request import ( - DeclareStageProgressRequest as DeclareStageProgressRequest, -) -from koyeb.api.models.declare_step_progress_request import ( - DeclareStepProgressRequest as DeclareStepProgressRequest, -) -from koyeb.api.models.decline_organization_invitation_reply import ( - DeclineOrganizationInvitationReply as DeclineOrganizationInvitationReply, -) -from koyeb.api.models.delete_organization_reply import ( - DeleteOrganizationReply as DeleteOrganizationReply, -) -from koyeb.api.models.delete_persistent_volume_reply import ( - DeletePersistentVolumeReply as DeletePersistentVolumeReply, -) -from koyeb.api.models.delete_snapshot_reply import ( - DeleteSnapshotReply as DeleteSnapshotReply, -) +from koyeb.api.models.database_usage_details import DatabaseUsageDetails as DatabaseUsageDetails +from koyeb.api.models.datacenter_list_item import DatacenterListItem as DatacenterListItem +from koyeb.api.models.deactivate_organization_reply import DeactivateOrganizationReply as DeactivateOrganizationReply +from koyeb.api.models.deactivate_organization_request import DeactivateOrganizationRequest as DeactivateOrganizationRequest +from koyeb.api.models.declare_stage_progress_request import DeclareStageProgressRequest as DeclareStageProgressRequest +from koyeb.api.models.declare_step_progress_request import DeclareStepProgressRequest as DeclareStepProgressRequest +from koyeb.api.models.decline_organization_invitation_reply import DeclineOrganizationInvitationReply as DeclineOrganizationInvitationReply +from koyeb.api.models.delete_organization_reply import DeleteOrganizationReply as DeleteOrganizationReply +from koyeb.api.models.delete_persistent_volume_reply import DeletePersistentVolumeReply as DeletePersistentVolumeReply +from koyeb.api.models.delete_snapshot_reply import DeleteSnapshotReply as DeleteSnapshotReply from koyeb.api.models.delete_user_reply import DeleteUserReply as DeleteUserReply from koyeb.api.models.deployment import Deployment as Deployment -from koyeb.api.models.deployment_database_info import ( - DeploymentDatabaseInfo as DeploymentDatabaseInfo, -) -from koyeb.api.models.deployment_definition import ( - DeploymentDefinition as DeploymentDefinition, -) -from koyeb.api.models.deployment_definition_type import ( - DeploymentDefinitionType as DeploymentDefinitionType, -) +from koyeb.api.models.deployment_database_info import DeploymentDatabaseInfo as DeploymentDatabaseInfo +from koyeb.api.models.deployment_definition import DeploymentDefinition as DeploymentDefinition +from koyeb.api.models.deployment_definition_type import DeploymentDefinitionType as DeploymentDefinitionType from koyeb.api.models.deployment_env import DeploymentEnv as DeploymentEnv from koyeb.api.models.deployment_event import DeploymentEvent as DeploymentEvent -from koyeb.api.models.deployment_health_check import ( - DeploymentHealthCheck as DeploymentHealthCheck, -) -from koyeb.api.models.deployment_instance_type import ( - DeploymentInstanceType as DeploymentInstanceType, -) -from koyeb.api.models.deployment_list_item import ( - DeploymentListItem as DeploymentListItem, -) -from koyeb.api.models.deployment_metadata import ( - DeploymentMetadata as DeploymentMetadata, -) -from koyeb.api.models.deployment_neon_postgres_database_info import ( - DeploymentNeonPostgresDatabaseInfo as DeploymentNeonPostgresDatabaseInfo, -) -from koyeb.api.models.deployment_neon_postgres_database_info_role import ( - DeploymentNeonPostgresDatabaseInfoRole as DeploymentNeonPostgresDatabaseInfoRole, -) +from koyeb.api.models.deployment_health_check import DeploymentHealthCheck as DeploymentHealthCheck +from koyeb.api.models.deployment_instance_type import DeploymentInstanceType as DeploymentInstanceType +from koyeb.api.models.deployment_list_item import DeploymentListItem as DeploymentListItem +from koyeb.api.models.deployment_metadata import DeploymentMetadata as DeploymentMetadata +from koyeb.api.models.deployment_neon_postgres_database_info import DeploymentNeonPostgresDatabaseInfo as DeploymentNeonPostgresDatabaseInfo +from koyeb.api.models.deployment_neon_postgres_database_info_role import DeploymentNeonPostgresDatabaseInfoRole as DeploymentNeonPostgresDatabaseInfoRole from koyeb.api.models.deployment_port import DeploymentPort as DeploymentPort -from koyeb.api.models.deployment_provisioning_info import ( - DeploymentProvisioningInfo as DeploymentProvisioningInfo, -) -from koyeb.api.models.deployment_provisioning_info_stage import ( - DeploymentProvisioningInfoStage as DeploymentProvisioningInfoStage, -) -from koyeb.api.models.deployment_provisioning_info_stage_build_attempt import ( - DeploymentProvisioningInfoStageBuildAttempt as DeploymentProvisioningInfoStageBuildAttempt, -) -from koyeb.api.models.deployment_provisioning_info_stage_build_attempt_build_step import ( - DeploymentProvisioningInfoStageBuildAttemptBuildStep as DeploymentProvisioningInfoStageBuildAttemptBuildStep, -) -from koyeb.api.models.deployment_provisioning_info_stage_status import ( - DeploymentProvisioningInfoStageStatus as DeploymentProvisioningInfoStageStatus, -) -from koyeb.api.models.deployment_proxy_port import ( - DeploymentProxyPort as DeploymentProxyPort, -) -from koyeb.api.models.deployment_proxy_port_metadata import ( - DeploymentProxyPortMetadata as DeploymentProxyPortMetadata, -) +from koyeb.api.models.deployment_provisioning_info import DeploymentProvisioningInfo as DeploymentProvisioningInfo +from koyeb.api.models.deployment_provisioning_info_stage import DeploymentProvisioningInfoStage as DeploymentProvisioningInfoStage +from koyeb.api.models.deployment_provisioning_info_stage_build_attempt import DeploymentProvisioningInfoStageBuildAttempt as DeploymentProvisioningInfoStageBuildAttempt +from koyeb.api.models.deployment_provisioning_info_stage_build_attempt_build_step import DeploymentProvisioningInfoStageBuildAttemptBuildStep as DeploymentProvisioningInfoStageBuildAttemptBuildStep +from koyeb.api.models.deployment_provisioning_info_stage_status import DeploymentProvisioningInfoStageStatus as DeploymentProvisioningInfoStageStatus +from koyeb.api.models.deployment_proxy_port import DeploymentProxyPort as DeploymentProxyPort +from koyeb.api.models.deployment_proxy_port_metadata import DeploymentProxyPortMetadata as DeploymentProxyPortMetadata from koyeb.api.models.deployment_role import DeploymentRole as DeploymentRole from koyeb.api.models.deployment_route import DeploymentRoute as DeploymentRoute from koyeb.api.models.deployment_scaling import DeploymentScaling as DeploymentScaling -from koyeb.api.models.deployment_scaling_target import ( - DeploymentScalingTarget as DeploymentScalingTarget, -) -from koyeb.api.models.deployment_scaling_target_average_cpu import ( - DeploymentScalingTargetAverageCPU as DeploymentScalingTargetAverageCPU, -) -from koyeb.api.models.deployment_scaling_target_average_mem import ( - DeploymentScalingTargetAverageMem as DeploymentScalingTargetAverageMem, -) -from koyeb.api.models.deployment_scaling_target_concurrent_requests import ( - DeploymentScalingTargetConcurrentRequests as DeploymentScalingTargetConcurrentRequests, -) -from koyeb.api.models.deployment_scaling_target_requests_per_second import ( - DeploymentScalingTargetRequestsPerSecond as DeploymentScalingTargetRequestsPerSecond, -) -from koyeb.api.models.deployment_scaling_target_requests_response_time import ( - DeploymentScalingTargetRequestsResponseTime as DeploymentScalingTargetRequestsResponseTime, -) -from koyeb.api.models.deployment_scaling_target_sleep_idle_delay import ( - DeploymentScalingTargetSleepIdleDelay as DeploymentScalingTargetSleepIdleDelay, -) +from koyeb.api.models.deployment_scaling_target import DeploymentScalingTarget as DeploymentScalingTarget +from koyeb.api.models.deployment_scaling_target_average_cpu import DeploymentScalingTargetAverageCPU as DeploymentScalingTargetAverageCPU +from koyeb.api.models.deployment_scaling_target_average_mem import DeploymentScalingTargetAverageMem as DeploymentScalingTargetAverageMem +from koyeb.api.models.deployment_scaling_target_concurrent_requests import DeploymentScalingTargetConcurrentRequests as DeploymentScalingTargetConcurrentRequests +from koyeb.api.models.deployment_scaling_target_requests_per_second import DeploymentScalingTargetRequestsPerSecond as DeploymentScalingTargetRequestsPerSecond +from koyeb.api.models.deployment_scaling_target_requests_response_time import DeploymentScalingTargetRequestsResponseTime as DeploymentScalingTargetRequestsResponseTime +from koyeb.api.models.deployment_scaling_target_sleep_idle_delay import DeploymentScalingTargetSleepIdleDelay as DeploymentScalingTargetSleepIdleDelay from koyeb.api.models.deployment_status import DeploymentStatus as DeploymentStatus -from koyeb.api.models.deployment_strategy import ( - DeploymentStrategy as DeploymentStrategy, -) -from koyeb.api.models.deployment_strategy_type import ( - DeploymentStrategyType as DeploymentStrategyType, -) +from koyeb.api.models.deployment_strategy import DeploymentStrategy as DeploymentStrategy +from koyeb.api.models.deployment_strategy_type import DeploymentStrategyType as DeploymentStrategyType from koyeb.api.models.deployment_volume import DeploymentVolume as DeploymentVolume from koyeb.api.models.desired_deployment import DesiredDeployment as DesiredDeployment -from koyeb.api.models.desired_deployment_group import ( - DesiredDeploymentGroup as DesiredDeploymentGroup, -) -from koyeb.api.models.digital_ocean_registry_configuration import ( - DigitalOceanRegistryConfiguration as DigitalOceanRegistryConfiguration, -) -from koyeb.api.models.discourse_auth_reply import ( - DiscourseAuthReply as DiscourseAuthReply, -) -from koyeb.api.models.discourse_auth_request import ( - DiscourseAuthRequest as DiscourseAuthRequest, -) +from koyeb.api.models.desired_deployment_group import DesiredDeploymentGroup as DesiredDeploymentGroup +from koyeb.api.models.digital_ocean_registry_configuration import DigitalOceanRegistryConfiguration as DigitalOceanRegistryConfiguration +from koyeb.api.models.discourse_auth_reply import DiscourseAuthReply as DiscourseAuthReply +from koyeb.api.models.discourse_auth_request import DiscourseAuthRequest as DiscourseAuthRequest from koyeb.api.models.docker_builder import DockerBuilder as DockerBuilder -from koyeb.api.models.docker_hub_registry_configuration import ( - DockerHubRegistryConfiguration as DockerHubRegistryConfiguration, -) +from koyeb.api.models.docker_hub_registry_configuration import DockerHubRegistryConfiguration as DockerHubRegistryConfiguration from koyeb.api.models.docker_source import DockerSource as DockerSource from koyeb.api.models.domain import Domain as Domain -from koyeb.api.models.domain_load_balancer_koyeb import ( - DomainLoadBalancerKoyeb as DomainLoadBalancerKoyeb, -) -from koyeb.api.models.domain_load_balancer_quotas import ( - DomainLoadBalancerQuotas as DomainLoadBalancerQuotas, -) +from koyeb.api.models.domain_load_balancer_koyeb import DomainLoadBalancerKoyeb as DomainLoadBalancerKoyeb +from koyeb.api.models.domain_load_balancer_quotas import DomainLoadBalancerQuotas as DomainLoadBalancerQuotas from koyeb.api.models.domain_status import DomainStatus as DomainStatus from koyeb.api.models.domain_type import DomainType as DomainType from koyeb.api.models.domains_summary import DomainsSummary as DomainsSummary @@ -771,124 +641,58 @@ from koyeb.api.models.error_with_fields import ErrorWithFields as ErrorWithFields from koyeb.api.models.exec_command_io import ExecCommandIO as ExecCommandIO from koyeb.api.models.exec_command_reply import ExecCommandReply as ExecCommandReply -from koyeb.api.models.exec_command_request_body import ( - ExecCommandRequestBody as ExecCommandRequestBody, -) -from koyeb.api.models.exec_command_request_id_type import ( - ExecCommandRequestIdType as ExecCommandRequestIdType, -) -from koyeb.api.models.exec_command_request_terminal_size import ( - ExecCommandRequestTerminalSize as ExecCommandRequestTerminalSize, -) -from koyeb.api.models.gcp_container_registry_configuration import ( - GCPContainerRegistryConfiguration as GCPContainerRegistryConfiguration, -) +from koyeb.api.models.exec_command_request_body import ExecCommandRequestBody as ExecCommandRequestBody +from koyeb.api.models.exec_command_request_id_type import ExecCommandRequestIdType as ExecCommandRequestIdType +from koyeb.api.models.exec_command_request_terminal_size import ExecCommandRequestTerminalSize as ExecCommandRequestTerminalSize +from koyeb.api.models.gcp_container_registry_configuration import GCPContainerRegistryConfiguration as GCPContainerRegistryConfiguration from koyeb.api.models.get_app_reply import GetAppReply as GetAppReply from koyeb.api.models.get_budget_reply import GetBudgetReply as GetBudgetReply -from koyeb.api.models.get_catalog_instance_reply import ( - GetCatalogInstanceReply as GetCatalogInstanceReply, -) -from koyeb.api.models.get_credential_reply import ( - GetCredentialReply as GetCredentialReply, -) -from koyeb.api.models.get_deployment_reply import ( - GetDeploymentReply as GetDeploymentReply, -) -from koyeb.api.models.get_deployment_scaling_reply import ( - GetDeploymentScalingReply as GetDeploymentScalingReply, -) -from koyeb.api.models.get_deployment_scaling_reply_item import ( - GetDeploymentScalingReplyItem as GetDeploymentScalingReplyItem, -) +from koyeb.api.models.get_catalog_instance_reply import GetCatalogInstanceReply as GetCatalogInstanceReply +from koyeb.api.models.get_credential_reply import GetCredentialReply as GetCredentialReply +from koyeb.api.models.get_deployment_reply import GetDeploymentReply as GetDeploymentReply +from koyeb.api.models.get_deployment_scaling_reply import GetDeploymentScalingReply as GetDeploymentScalingReply +from koyeb.api.models.get_deployment_scaling_reply_item import GetDeploymentScalingReplyItem as GetDeploymentScalingReplyItem from koyeb.api.models.get_domain_reply import GetDomainReply as GetDomainReply -from koyeb.api.models.get_github_installation_reply import ( - GetGithubInstallationReply as GetGithubInstallationReply, -) -from koyeb.api.models.get_idenfy_token_reply import ( - GetIdenfyTokenReply as GetIdenfyTokenReply, -) +from koyeb.api.models.get_github_installation_reply import GetGithubInstallationReply as GetGithubInstallationReply +from koyeb.api.models.get_idenfy_token_reply import GetIdenfyTokenReply as GetIdenfyTokenReply from koyeb.api.models.get_instance_reply import GetInstanceReply as GetInstanceReply -from koyeb.api.models.get_intercom_profile_reply import ( - GetIntercomProfileReply as GetIntercomProfileReply, -) +from koyeb.api.models.get_intercom_profile_reply import GetIntercomProfileReply as GetIntercomProfileReply from koyeb.api.models.get_metrics_reply import GetMetricsReply as GetMetricsReply -from koyeb.api.models.get_metrics_reply_metric import ( - GetMetricsReplyMetric as GetMetricsReplyMetric, -) -from koyeb.api.models.get_o_auth_options_reply import ( - GetOAuthOptionsReply as GetOAuthOptionsReply, -) -from koyeb.api.models.get_organization_invitation_reply import ( - GetOrganizationInvitationReply as GetOrganizationInvitationReply, -) -from koyeb.api.models.get_organization_reply import ( - GetOrganizationReply as GetOrganizationReply, -) -from koyeb.api.models.get_organization_summary_reply import ( - GetOrganizationSummaryReply as GetOrganizationSummaryReply, -) -from koyeb.api.models.get_organization_usage_details_reply import ( - GetOrganizationUsageDetailsReply as GetOrganizationUsageDetailsReply, -) -from koyeb.api.models.get_organization_usage_reply import ( - GetOrganizationUsageReply as GetOrganizationUsageReply, -) -from koyeb.api.models.get_payment_method_reply import ( - GetPaymentMethodReply as GetPaymentMethodReply, -) -from koyeb.api.models.get_persistent_volume_reply import ( - GetPersistentVolumeReply as GetPersistentVolumeReply, -) +from koyeb.api.models.get_metrics_reply_metric import GetMetricsReplyMetric as GetMetricsReplyMetric +from koyeb.api.models.get_o_auth_options_reply import GetOAuthOptionsReply as GetOAuthOptionsReply +from koyeb.api.models.get_organization_invitation_reply import GetOrganizationInvitationReply as GetOrganizationInvitationReply +from koyeb.api.models.get_organization_reply import GetOrganizationReply as GetOrganizationReply +from koyeb.api.models.get_organization_summary_reply import GetOrganizationSummaryReply as GetOrganizationSummaryReply +from koyeb.api.models.get_organization_usage_details_reply import GetOrganizationUsageDetailsReply as GetOrganizationUsageDetailsReply +from koyeb.api.models.get_organization_usage_reply import GetOrganizationUsageReply as GetOrganizationUsageReply +from koyeb.api.models.get_payment_method_reply import GetPaymentMethodReply as GetPaymentMethodReply +from koyeb.api.models.get_persistent_volume_reply import GetPersistentVolumeReply as GetPersistentVolumeReply +from koyeb.api.models.get_project_reply import GetProjectReply as GetProjectReply from koyeb.api.models.get_quotas_reply import GetQuotasReply as GetQuotasReply from koyeb.api.models.get_region_reply import GetRegionReply as GetRegionReply -from koyeb.api.models.get_regional_deployment_reply import ( - GetRegionalDeploymentReply as GetRegionalDeploymentReply, -) +from koyeb.api.models.get_regional_deployment_reply import GetRegionalDeploymentReply as GetRegionalDeploymentReply from koyeb.api.models.get_secret_reply import GetSecretReply as GetSecretReply from koyeb.api.models.get_service_reply import GetServiceReply as GetServiceReply +from koyeb.api.models.get_service_scaling_reply import GetServiceScalingReply as GetServiceScalingReply from koyeb.api.models.get_snapshot_reply import GetSnapshotReply as GetSnapshotReply -from koyeb.api.models.get_subscription_reply import ( - GetSubscriptionReply as GetSubscriptionReply, -) -from koyeb.api.models.get_user_organization_invitation_reply import ( - GetUserOrganizationInvitationReply as GetUserOrganizationInvitationReply, -) -from koyeb.api.models.get_user_settings_reply import ( - GetUserSettingsReply as GetUserSettingsReply, -) -from koyeb.api.models.git_deployment_metadata import ( - GitDeploymentMetadata as GitDeploymentMetadata, -) -from koyeb.api.models.git_env_deployment_metadata import ( - GitEnvDeploymentMetadata as GitEnvDeploymentMetadata, -) -from koyeb.api.models.git_hub_registry_configuration import ( - GitHubRegistryConfiguration as GitHubRegistryConfiguration, -) -from koyeb.api.models.git_lab_registry_configuration import ( - GitLabRegistryConfiguration as GitLabRegistryConfiguration, -) +from koyeb.api.models.get_subscription_reply import GetSubscriptionReply as GetSubscriptionReply +from koyeb.api.models.get_user_organization_invitation_reply import GetUserOrganizationInvitationReply as GetUserOrganizationInvitationReply +from koyeb.api.models.get_user_settings_reply import GetUserSettingsReply as GetUserSettingsReply +from koyeb.api.models.git_deployment_metadata import GitDeploymentMetadata as GitDeploymentMetadata +from koyeb.api.models.git_env_deployment_metadata import GitEnvDeploymentMetadata as GitEnvDeploymentMetadata +from koyeb.api.models.git_hub_registry_configuration import GitHubRegistryConfiguration as GitHubRegistryConfiguration +from koyeb.api.models.git_lab_registry_configuration import GitLabRegistryConfiguration as GitLabRegistryConfiguration from koyeb.api.models.git_source import GitSource as GitSource -from koyeb.api.models.github_installation_reply import ( - GithubInstallationReply as GithubInstallationReply, -) -from koyeb.api.models.github_installation_request import ( - GithubInstallationRequest as GithubInstallationRequest, -) +from koyeb.api.models.github_installation_reply import GithubInstallationReply as GithubInstallationReply +from koyeb.api.models.github_installation_request import GithubInstallationRequest as GithubInstallationRequest from koyeb.api.models.google_protobuf_any import GoogleProtobufAny as GoogleProtobufAny -from koyeb.api.models.google_protobuf_null_value import ( - GoogleProtobufNullValue as GoogleProtobufNullValue, -) +from koyeb.api.models.google_protobuf_null_value import GoogleProtobufNullValue as GoogleProtobufNullValue from koyeb.api.models.google_rpc_status import GoogleRpcStatus as GoogleRpcStatus from koyeb.api.models.http_header import HTTPHeader as HTTPHeader from koyeb.api.models.http_health_check import HTTPHealthCheck as HTTPHealthCheck -from koyeb.api.models.has_unpaid_invoices_reply import ( - HasUnpaidInvoicesReply as HasUnpaidInvoicesReply, -) +from koyeb.api.models.has_unpaid_invoices_reply import HasUnpaidInvoicesReply as HasUnpaidInvoicesReply from koyeb.api.models.instance import Instance as Instance -from koyeb.api.models.instance_availability import ( - InstanceAvailability as InstanceAvailability, -) +from koyeb.api.models.instance_availability import InstanceAvailability as InstanceAvailability from koyeb.api.models.instance_event import InstanceEvent as InstanceEvent from koyeb.api.models.instance_list_item import InstanceListItem as InstanceListItem from koyeb.api.models.instance_status import InstanceStatus as InstanceStatus @@ -896,278 +700,132 @@ from koyeb.api.models.instances_summary import InstancesSummary as InstancesSummary from koyeb.api.models.invite_user_request import InviteUserRequest as InviteUserRequest from koyeb.api.models.kgitproxy_branch import KgitproxyBranch as KgitproxyBranch -from koyeb.api.models.kgitproxy_git_hub_repository import ( - KgitproxyGitHubRepository as KgitproxyGitHubRepository, -) -from koyeb.api.models.kgitproxy_github_installation_status import ( - KgitproxyGithubInstallationStatus as KgitproxyGithubInstallationStatus, -) -from koyeb.api.models.kgitproxy_indexing_status import ( - KgitproxyIndexingStatus as KgitproxyIndexingStatus, -) -from koyeb.api.models.kgitproxy_list_branches_reply import ( - KgitproxyListBranchesReply as KgitproxyListBranchesReply, -) -from koyeb.api.models.kgitproxy_list_repositories_reply import ( - KgitproxyListRepositoriesReply as KgitproxyListRepositoriesReply, -) -from koyeb.api.models.kgitproxy_repository import ( - KgitproxyRepository as KgitproxyRepository, -) -from koyeb.api.models.kgitproxy_repository_provider import ( - KgitproxyRepositoryProvider as KgitproxyRepositoryProvider, -) +from koyeb.api.models.kgitproxy_git_hub_repository import KgitproxyGitHubRepository as KgitproxyGitHubRepository +from koyeb.api.models.kgitproxy_github_installation_status import KgitproxyGithubInstallationStatus as KgitproxyGithubInstallationStatus +from koyeb.api.models.kgitproxy_indexing_status import KgitproxyIndexingStatus as KgitproxyIndexingStatus +from koyeb.api.models.kgitproxy_list_branches_reply import KgitproxyListBranchesReply as KgitproxyListBranchesReply +from koyeb.api.models.kgitproxy_list_repositories_reply import KgitproxyListRepositoriesReply as KgitproxyListRepositoriesReply +from koyeb.api.models.kgitproxy_repository import KgitproxyRepository as KgitproxyRepository +from koyeb.api.models.kgitproxy_repository_provider import KgitproxyRepositoryProvider as KgitproxyRepositoryProvider from koyeb.api.models.ksearch_app import KsearchApp as KsearchApp -from koyeb.api.models.ksearch_global_deployment import ( - KsearchGlobalDeployment as KsearchGlobalDeployment, -) +from koyeb.api.models.ksearch_global_deployment import KsearchGlobalDeployment as KsearchGlobalDeployment from koyeb.api.models.ksearch_instance import KsearchInstance as KsearchInstance -from koyeb.api.models.ksearch_organization import ( - KsearchOrganization as KsearchOrganization, -) -from koyeb.api.models.ksearch_regional_deployment import ( - KsearchRegionalDeployment as KsearchRegionalDeployment, -) -from koyeb.api.models.ksearch_search_reply import ( - KsearchSearchReply as KsearchSearchReply, -) +from koyeb.api.models.ksearch_organization import KsearchOrganization as KsearchOrganization +from koyeb.api.models.ksearch_regional_deployment import KsearchRegionalDeployment as KsearchRegionalDeployment +from koyeb.api.models.ksearch_search_reply import KsearchSearchReply as KsearchSearchReply from koyeb.api.models.ksearch_service import KsearchService as KsearchService from koyeb.api.models.ksearch_user import KsearchUser as KsearchUser -from koyeb.api.models.list_app_events_reply import ( - ListAppEventsReply as ListAppEventsReply, -) +from koyeb.api.models.lifecycle_quotas import LifecycleQuotas as LifecycleQuotas +from koyeb.api.models.list_app_events_reply import ListAppEventsReply as ListAppEventsReply from koyeb.api.models.list_apps_reply import ListAppsReply as ListAppsReply -from koyeb.api.models.list_catalog_instances_reply import ( - ListCatalogInstancesReply as ListCatalogInstancesReply, -) -from koyeb.api.models.list_credentials_reply import ( - ListCredentialsReply as ListCredentialsReply, -) -from koyeb.api.models.list_datacenters_reply import ( - ListDatacentersReply as ListDatacentersReply, -) -from koyeb.api.models.list_deployment_events_reply import ( - ListDeploymentEventsReply as ListDeploymentEventsReply, -) -from koyeb.api.models.list_deployments_reply import ( - ListDeploymentsReply as ListDeploymentsReply, -) +from koyeb.api.models.list_catalog_instances_reply import ListCatalogInstancesReply as ListCatalogInstancesReply +from koyeb.api.models.list_credentials_reply import ListCredentialsReply as ListCredentialsReply +from koyeb.api.models.list_datacenters_reply import ListDatacentersReply as ListDatacentersReply +from koyeb.api.models.list_deployment_events_reply import ListDeploymentEventsReply as ListDeploymentEventsReply +from koyeb.api.models.list_deployments_reply import ListDeploymentsReply as ListDeploymentsReply from koyeb.api.models.list_domains_reply import ListDomainsReply as ListDomainsReply -from koyeb.api.models.list_instance_events_reply import ( - ListInstanceEventsReply as ListInstanceEventsReply, -) -from koyeb.api.models.list_instances_reply import ( - ListInstancesReply as ListInstancesReply, -) -from koyeb.api.models.list_organization_invitations_reply import ( - ListOrganizationInvitationsReply as ListOrganizationInvitationsReply, -) -from koyeb.api.models.list_organization_members_reply import ( - ListOrganizationMembersReply as ListOrganizationMembersReply, -) -from koyeb.api.models.list_payment_methods_reply import ( - ListPaymentMethodsReply as ListPaymentMethodsReply, -) -from koyeb.api.models.list_persistent_volume_events_reply import ( - ListPersistentVolumeEventsReply as ListPersistentVolumeEventsReply, -) -from koyeb.api.models.list_persistent_volumes_reply import ( - ListPersistentVolumesReply as ListPersistentVolumesReply, -) -from koyeb.api.models.list_regional_deployment_events_reply import ( - ListRegionalDeploymentEventsReply as ListRegionalDeploymentEventsReply, -) -from koyeb.api.models.list_regional_deployments_reply import ( - ListRegionalDeploymentsReply as ListRegionalDeploymentsReply, -) +from koyeb.api.models.list_instance_events_reply import ListInstanceEventsReply as ListInstanceEventsReply +from koyeb.api.models.list_instances_reply import ListInstancesReply as ListInstancesReply +from koyeb.api.models.list_organization_invitations_reply import ListOrganizationInvitationsReply as ListOrganizationInvitationsReply +from koyeb.api.models.list_organization_members_reply import ListOrganizationMembersReply as ListOrganizationMembersReply +from koyeb.api.models.list_payment_methods_reply import ListPaymentMethodsReply as ListPaymentMethodsReply +from koyeb.api.models.list_persistent_volume_events_reply import ListPersistentVolumeEventsReply as ListPersistentVolumeEventsReply +from koyeb.api.models.list_persistent_volumes_reply import ListPersistentVolumesReply as ListPersistentVolumesReply +from koyeb.api.models.list_projects_reply import ListProjectsReply as ListProjectsReply +from koyeb.api.models.list_regional_deployment_events_reply import ListRegionalDeploymentEventsReply as ListRegionalDeploymentEventsReply +from koyeb.api.models.list_regional_deployments_reply import ListRegionalDeploymentsReply as ListRegionalDeploymentsReply from koyeb.api.models.list_regions_reply import ListRegionsReply as ListRegionsReply from koyeb.api.models.list_secrets_reply import ListSecretsReply as ListSecretsReply -from koyeb.api.models.list_service_events_reply import ( - ListServiceEventsReply as ListServiceEventsReply, -) +from koyeb.api.models.list_service_events_reply import ListServiceEventsReply as ListServiceEventsReply from koyeb.api.models.list_services_reply import ListServicesReply as ListServicesReply -from koyeb.api.models.list_snapshots_reply import ( - ListSnapshotsReply as ListSnapshotsReply, -) +from koyeb.api.models.list_snapshots_reply import ListSnapshotsReply as ListSnapshotsReply from koyeb.api.models.list_usage_reply import ListUsageReply as ListUsageReply -from koyeb.api.models.list_user_organization_invitations_reply import ( - ListUserOrganizationInvitationsReply as ListUserOrganizationInvitationsReply, -) -from koyeb.api.models.list_user_organizations_reply import ( - ListUserOrganizationsReply as ListUserOrganizationsReply, -) +from koyeb.api.models.list_user_organization_invitations_reply import ListUserOrganizationInvitationsReply as ListUserOrganizationInvitationsReply +from koyeb.api.models.list_user_organizations_reply import ListUserOrganizationsReply as ListUserOrganizationsReply from koyeb.api.models.log_entry import LogEntry as LogEntry from koyeb.api.models.login_method_reply import LoginMethodReply as LoginMethodReply -from koyeb.api.models.login_method_reply_method import ( - LoginMethodReplyMethod as LoginMethodReplyMethod, -) +from koyeb.api.models.login_method_reply_method import LoginMethodReplyMethod as LoginMethodReplyMethod from koyeb.api.models.login_reply import LoginReply as LoginReply from koyeb.api.models.login_request import LoginRequest as LoginRequest from koyeb.api.models.manage_reply import ManageReply as ManageReply +from koyeb.api.models.manual_service_scaling import ManualServiceScaling as ManualServiceScaling from koyeb.api.models.members_summary import MembersSummary as MembersSummary from koyeb.api.models.metric_name import MetricName as MetricName -from koyeb.api.models.neon_postgres_database import ( - NeonPostgresDatabase as NeonPostgresDatabase, -) -from koyeb.api.models.neon_postgres_database_deployment_metadata import ( - NeonPostgresDatabaseDeploymentMetadata as NeonPostgresDatabaseDeploymentMetadata, -) -from koyeb.api.models.neon_postgres_database_neon_database import ( - NeonPostgresDatabaseNeonDatabase as NeonPostgresDatabaseNeonDatabase, -) -from koyeb.api.models.neon_postgres_database_neon_role import ( - NeonPostgresDatabaseNeonRole as NeonPostgresDatabaseNeonRole, -) -from koyeb.api.models.neon_postgres_summary import ( - NeonPostgresSummary as NeonPostgresSummary, -) +from koyeb.api.models.neon_postgres_database import NeonPostgresDatabase as NeonPostgresDatabase +from koyeb.api.models.neon_postgres_database_deployment_metadata import NeonPostgresDatabaseDeploymentMetadata as NeonPostgresDatabaseDeploymentMetadata +from koyeb.api.models.neon_postgres_database_neon_database import NeonPostgresDatabaseNeonDatabase as NeonPostgresDatabaseNeonDatabase +from koyeb.api.models.neon_postgres_database_neon_role import NeonPostgresDatabaseNeonRole as NeonPostgresDatabaseNeonRole +from koyeb.api.models.neon_postgres_summary import NeonPostgresSummary as NeonPostgresSummary from koyeb.api.models.next_invoice_reply import NextInvoiceReply as NextInvoiceReply -from koyeb.api.models.next_invoice_reply_discount import ( - NextInvoiceReplyDiscount as NextInvoiceReplyDiscount, -) -from koyeb.api.models.next_invoice_reply_discount_type import ( - NextInvoiceReplyDiscountType as NextInvoiceReplyDiscountType, -) -from koyeb.api.models.next_invoice_reply_line import ( - NextInvoiceReplyLine as NextInvoiceReplyLine, -) -from koyeb.api.models.next_invoice_reply_line_period import ( - NextInvoiceReplyLinePeriod as NextInvoiceReplyLinePeriod, -) -from koyeb.api.models.next_invoice_reply_line_price import ( - NextInvoiceReplyLinePrice as NextInvoiceReplyLinePrice, -) +from koyeb.api.models.next_invoice_reply_discount import NextInvoiceReplyDiscount as NextInvoiceReplyDiscount +from koyeb.api.models.next_invoice_reply_discount_type import NextInvoiceReplyDiscountType as NextInvoiceReplyDiscountType +from koyeb.api.models.next_invoice_reply_line import NextInvoiceReplyLine as NextInvoiceReplyLine +from koyeb.api.models.next_invoice_reply_line_period import NextInvoiceReplyLinePeriod as NextInvoiceReplyLinePeriod +from koyeb.api.models.next_invoice_reply_line_price import NextInvoiceReplyLinePrice as NextInvoiceReplyLinePrice from koyeb.api.models.notification import Notification as Notification from koyeb.api.models.notification_list import NotificationList as NotificationList -from koyeb.api.models.o_auth_callback_reply import ( - OAuthCallbackReply as OAuthCallbackReply, -) -from koyeb.api.models.o_auth_callback_request import ( - OAuthCallbackRequest as OAuthCallbackRequest, -) +from koyeb.api.models.o_auth_callback_reply import OAuthCallbackReply as OAuthCallbackReply +from koyeb.api.models.o_auth_callback_request import OAuthCallbackRequest as OAuthCallbackRequest from koyeb.api.models.o_auth_provider import OAuthProvider as OAuthProvider from koyeb.api.models.object import Object as Object from koyeb.api.models.organization import Organization as Organization -from koyeb.api.models.organization_deactivation_reason import ( - OrganizationDeactivationReason as OrganizationDeactivationReason, -) -from koyeb.api.models.organization_detailed_status import ( - OrganizationDetailedStatus as OrganizationDetailedStatus, -) -from koyeb.api.models.organization_invitation import ( - OrganizationInvitation as OrganizationInvitation, -) -from koyeb.api.models.organization_invitation_status import ( - OrganizationInvitationStatus as OrganizationInvitationStatus, -) -from koyeb.api.models.organization_member import ( - OrganizationMember as OrganizationMember, -) -from koyeb.api.models.organization_member_status import ( - OrganizationMemberStatus as OrganizationMemberStatus, -) -from koyeb.api.models.organization_status import ( - OrganizationStatus as OrganizationStatus, -) -from koyeb.api.models.organization_summary import ( - OrganizationSummary as OrganizationSummary, -) +from koyeb.api.models.organization_deactivation_reason import OrganizationDeactivationReason as OrganizationDeactivationReason +from koyeb.api.models.organization_detailed_status import OrganizationDetailedStatus as OrganizationDetailedStatus +from koyeb.api.models.organization_invitation import OrganizationInvitation as OrganizationInvitation +from koyeb.api.models.organization_invitation_status import OrganizationInvitationStatus as OrganizationInvitationStatus +from koyeb.api.models.organization_member import OrganizationMember as OrganizationMember +from koyeb.api.models.organization_member_status import OrganizationMemberStatus as OrganizationMemberStatus +from koyeb.api.models.organization_status import OrganizationStatus as OrganizationStatus +from koyeb.api.models.organization_summary import OrganizationSummary as OrganizationSummary from koyeb.api.models.payment_method import PaymentMethod as PaymentMethod -from koyeb.api.models.payment_method_status import ( - PaymentMethodStatus as PaymentMethodStatus, -) +from koyeb.api.models.payment_method_status import PaymentMethodStatus as PaymentMethodStatus from koyeb.api.models.period_usage import PeriodUsage as PeriodUsage from koyeb.api.models.persistent_volume import PersistentVolume as PersistentVolume -from koyeb.api.models.persistent_volume_backing_store import ( - PersistentVolumeBackingStore as PersistentVolumeBackingStore, -) -from koyeb.api.models.persistent_volume_event import ( - PersistentVolumeEvent as PersistentVolumeEvent, -) -from koyeb.api.models.persistent_volume_quotas import ( - PersistentVolumeQuotas as PersistentVolumeQuotas, -) -from koyeb.api.models.persistent_volume_status import ( - PersistentVolumeStatus as PersistentVolumeStatus, -) +from koyeb.api.models.persistent_volume_backing_store import PersistentVolumeBackingStore as PersistentVolumeBackingStore +from koyeb.api.models.persistent_volume_event import PersistentVolumeEvent as PersistentVolumeEvent +from koyeb.api.models.persistent_volume_quotas import PersistentVolumeQuotas as PersistentVolumeQuotas +from koyeb.api.models.persistent_volume_status import PersistentVolumeStatus as PersistentVolumeStatus from koyeb.api.models.plan import Plan as Plan from koyeb.api.models.port import Port as Port -from koyeb.api.models.private_registry_configuration import ( - PrivateRegistryConfiguration as PrivateRegistryConfiguration, -) +from koyeb.api.models.private_registry_configuration import PrivateRegistryConfiguration as PrivateRegistryConfiguration +from koyeb.api.models.project import Project as Project from koyeb.api.models.proxy_port_protocol import ProxyPortProtocol as ProxyPortProtocol -from koyeb.api.models.public_organization import ( - PublicOrganization as PublicOrganization, -) +from koyeb.api.models.public_organization import PublicOrganization as PublicOrganization from koyeb.api.models.public_user import PublicUser as PublicUser from koyeb.api.models.query_logs_reply import QueryLogsReply as QueryLogsReply -from koyeb.api.models.query_logs_reply_pagination import ( - QueryLogsReplyPagination as QueryLogsReplyPagination, -) +from koyeb.api.models.query_logs_reply_pagination import QueryLogsReplyPagination as QueryLogsReplyPagination from koyeb.api.models.quotas import Quotas as Quotas -from koyeb.api.models.reactivate_organization_reply import ( - ReactivateOrganizationReply as ReactivateOrganizationReply, -) -from koyeb.api.models.redeem_coupon_request import ( - RedeemCouponRequest as RedeemCouponRequest, -) +from koyeb.api.models.reactivate_organization_reply import ReactivateOrganizationReply as ReactivateOrganizationReply +from koyeb.api.models.redeem_coupon_request import RedeemCouponRequest as RedeemCouponRequest from koyeb.api.models.redeploy_reply import RedeployReply as RedeployReply -from koyeb.api.models.redeploy_request_info import ( - RedeployRequestInfo as RedeployRequestInfo, -) +from koyeb.api.models.redeploy_request_info import RedeployRequestInfo as RedeployRequestInfo from koyeb.api.models.region import Region as Region -from koyeb.api.models.region_availability import ( - RegionAvailability as RegionAvailability, -) +from koyeb.api.models.region_availability import RegionAvailability as RegionAvailability from koyeb.api.models.region_list_item import RegionListItem as RegionListItem from koyeb.api.models.region_usage import RegionUsage as RegionUsage -from koyeb.api.models.regional_deployment import ( - RegionalDeployment as RegionalDeployment, -) -from koyeb.api.models.regional_deployment_definition import ( - RegionalDeploymentDefinition as RegionalDeploymentDefinition, -) -from koyeb.api.models.regional_deployment_definition_type import ( - RegionalDeploymentDefinitionType as RegionalDeploymentDefinitionType, -) -from koyeb.api.models.regional_deployment_event import ( - RegionalDeploymentEvent as RegionalDeploymentEvent, -) -from koyeb.api.models.regional_deployment_list_item import ( - RegionalDeploymentListItem as RegionalDeploymentListItem, -) -from koyeb.api.models.regional_deployment_role import ( - RegionalDeploymentRole as RegionalDeploymentRole, -) -from koyeb.api.models.regional_deployment_status import ( - RegionalDeploymentStatus as RegionalDeploymentStatus, -) -from koyeb.api.models.regional_deployment_volume import ( - RegionalDeploymentVolume as RegionalDeploymentVolume, -) -from koyeb.api.models.remove_organization_member_reply import ( - RemoveOrganizationMemberReply as RemoveOrganizationMemberReply, -) -from koyeb.api.models.resend_organization_invitation_reply import ( - ResendOrganizationInvitationReply as ResendOrganizationInvitationReply, -) -from koyeb.api.models.reset_password_request import ( - ResetPasswordRequest as ResetPasswordRequest, -) +from koyeb.api.models.regional_deployment import RegionalDeployment as RegionalDeployment +from koyeb.api.models.regional_deployment_definition import RegionalDeploymentDefinition as RegionalDeploymentDefinition +from koyeb.api.models.regional_deployment_definition_type import RegionalDeploymentDefinitionType as RegionalDeploymentDefinitionType +from koyeb.api.models.regional_deployment_event import RegionalDeploymentEvent as RegionalDeploymentEvent +from koyeb.api.models.regional_deployment_list_item import RegionalDeploymentListItem as RegionalDeploymentListItem +from koyeb.api.models.regional_deployment_role import RegionalDeploymentRole as RegionalDeploymentRole +from koyeb.api.models.regional_deployment_status import RegionalDeploymentStatus as RegionalDeploymentStatus +from koyeb.api.models.regional_deployment_volume import RegionalDeploymentVolume as RegionalDeploymentVolume +from koyeb.api.models.remove_organization_member_reply import RemoveOrganizationMemberReply as RemoveOrganizationMemberReply +from koyeb.api.models.resend_organization_invitation_reply import ResendOrganizationInvitationReply as ResendOrganizationInvitationReply +from koyeb.api.models.reset_password_request import ResetPasswordRequest as ResetPasswordRequest from koyeb.api.models.reveal_secret_reply import RevealSecretReply as RevealSecretReply -from koyeb.api.models.review_organization_capacity_reply import ( - ReviewOrganizationCapacityReply as ReviewOrganizationCapacityReply, -) -from koyeb.api.models.review_organization_capacity_request import ( - ReviewOrganizationCapacityRequest as ReviewOrganizationCapacityRequest, -) +from koyeb.api.models.review_organization_capacity_reply import ReviewOrganizationCapacityReply as ReviewOrganizationCapacityReply +from koyeb.api.models.review_organization_capacity_request import ReviewOrganizationCapacityRequest as ReviewOrganizationCapacityRequest from koyeb.api.models.route import Route as Route from koyeb.api.models.sample import Sample as Sample +from koyeb.api.models.sandbox_metadata import SandboxMetadata as SandboxMetadata from koyeb.api.models.scale_to_zero_quotas import ScaleToZeroQuotas as ScaleToZeroQuotas from koyeb.api.models.scaling import Scaling as Scaling from koyeb.api.models.secret import Secret as Secret from koyeb.api.models.secret_type import SecretType as SecretType from koyeb.api.models.secrets_summary import SecretsSummary as SecretsSummary +from koyeb.api.models.security_policies import SecurityPolicies as SecurityPolicies from koyeb.api.models.service import Service as Service from koyeb.api.models.service_event import ServiceEvent as ServiceEvent from koyeb.api.models.service_life_cycle import ServiceLifeCycle as ServiceLifeCycle @@ -1180,100 +838,48 @@ from koyeb.api.models.snapshot import Snapshot as Snapshot from koyeb.api.models.snapshot_status import SnapshotStatus as SnapshotStatus from koyeb.api.models.snapshot_type import SnapshotType as SnapshotType -from koyeb.api.models.stream_result_of_exec_command_reply import ( - StreamResultOfExecCommandReply as StreamResultOfExecCommandReply, -) -from koyeb.api.models.stream_result_of_log_entry import ( - StreamResultOfLogEntry as StreamResultOfLogEntry, -) +from koyeb.api.models.stream_result_of_exec_command_reply import StreamResultOfExecCommandReply as StreamResultOfExecCommandReply +from koyeb.api.models.stream_result_of_log_entry import StreamResultOfLogEntry as StreamResultOfLogEntry from koyeb.api.models.subscription import Subscription as Subscription -from koyeb.api.models.subscription_payment_failure import ( - SubscriptionPaymentFailure as SubscriptionPaymentFailure, -) -from koyeb.api.models.subscription_payment_failure_stripe_sdk import ( - SubscriptionPaymentFailureStripeSDK as SubscriptionPaymentFailureStripeSDK, -) -from koyeb.api.models.subscription_status import ( - SubscriptionStatus as SubscriptionStatus, -) +from koyeb.api.models.subscription_payment_failure import SubscriptionPaymentFailure as SubscriptionPaymentFailure +from koyeb.api.models.subscription_payment_failure_stripe_sdk import SubscriptionPaymentFailureStripeSDK as SubscriptionPaymentFailureStripeSDK +from koyeb.api.models.subscription_status import SubscriptionStatus as SubscriptionStatus from koyeb.api.models.tcp_health_check import TCPHealthCheck as TCPHealthCheck from koyeb.api.models.token import Token as Token -from koyeb.api.models.trigger_deployment_metadata import ( - TriggerDeploymentMetadata as TriggerDeploymentMetadata, -) -from koyeb.api.models.trigger_deployment_metadata_actor_type import ( - TriggerDeploymentMetadataActorType as TriggerDeploymentMetadataActorType, -) -from koyeb.api.models.trigger_deployment_metadata_trigger_type import ( - TriggerDeploymentMetadataTriggerType as TriggerDeploymentMetadataTriggerType, -) -from koyeb.api.models.trigger_git_deployment_metadata import ( - TriggerGitDeploymentMetadata as TriggerGitDeploymentMetadata, -) -from koyeb.api.models.trigger_git_deployment_metadata_provider import ( - TriggerGitDeploymentMetadataProvider as TriggerGitDeploymentMetadataProvider, -) +from koyeb.api.models.trigger_deployment_metadata import TriggerDeploymentMetadata as TriggerDeploymentMetadata +from koyeb.api.models.trigger_deployment_metadata_actor_type import TriggerDeploymentMetadataActorType as TriggerDeploymentMetadataActorType +from koyeb.api.models.trigger_deployment_metadata_trigger_type import TriggerDeploymentMetadataTriggerType as TriggerDeploymentMetadataTriggerType +from koyeb.api.models.trigger_git_deployment_metadata import TriggerGitDeploymentMetadata as TriggerGitDeploymentMetadata +from koyeb.api.models.trigger_git_deployment_metadata_provider import TriggerGitDeploymentMetadataProvider as TriggerGitDeploymentMetadataProvider from koyeb.api.models.update_app import UpdateApp as UpdateApp from koyeb.api.models.update_app_reply import UpdateAppReply as UpdateAppReply from koyeb.api.models.update_budget_reply import UpdateBudgetReply as UpdateBudgetReply -from koyeb.api.models.update_budget_request import ( - UpdateBudgetRequest as UpdateBudgetRequest, -) -from koyeb.api.models.update_credential_reply import ( - UpdateCredentialReply as UpdateCredentialReply, -) +from koyeb.api.models.update_budget_request import UpdateBudgetRequest as UpdateBudgetRequest +from koyeb.api.models.update_credential_reply import UpdateCredentialReply as UpdateCredentialReply from koyeb.api.models.update_domain import UpdateDomain as UpdateDomain from koyeb.api.models.update_domain_reply import UpdateDomainReply as UpdateDomainReply -from koyeb.api.models.update_organization_name_reply import ( - UpdateOrganizationNameReply as UpdateOrganizationNameReply, -) -from koyeb.api.models.update_organization_name_request import ( - UpdateOrganizationNameRequest as UpdateOrganizationNameRequest, -) -from koyeb.api.models.update_organization_plan_reply import ( - UpdateOrganizationPlanReply as UpdateOrganizationPlanReply, -) -from koyeb.api.models.update_organization_plan_request import ( - UpdateOrganizationPlanRequest as UpdateOrganizationPlanRequest, -) -from koyeb.api.models.update_organization_reply import ( - UpdateOrganizationReply as UpdateOrganizationReply, -) -from koyeb.api.models.update_password_request import ( - UpdatePasswordRequest as UpdatePasswordRequest, -) -from koyeb.api.models.update_persistent_volume_reply import ( - UpdatePersistentVolumeReply as UpdatePersistentVolumeReply, -) -from koyeb.api.models.update_persistent_volume_request import ( - UpdatePersistentVolumeRequest as UpdatePersistentVolumeRequest, -) +from koyeb.api.models.update_organization_default_project_reply import UpdateOrganizationDefaultProjectReply as UpdateOrganizationDefaultProjectReply +from koyeb.api.models.update_organization_default_project_request import UpdateOrganizationDefaultProjectRequest as UpdateOrganizationDefaultProjectRequest +from koyeb.api.models.update_organization_name_reply import UpdateOrganizationNameReply as UpdateOrganizationNameReply +from koyeb.api.models.update_organization_name_request import UpdateOrganizationNameRequest as UpdateOrganizationNameRequest +from koyeb.api.models.update_organization_plan_reply import UpdateOrganizationPlanReply as UpdateOrganizationPlanReply +from koyeb.api.models.update_organization_plan_request import UpdateOrganizationPlanRequest as UpdateOrganizationPlanRequest +from koyeb.api.models.update_organization_reply import UpdateOrganizationReply as UpdateOrganizationReply +from koyeb.api.models.update_password_request import UpdatePasswordRequest as UpdatePasswordRequest +from koyeb.api.models.update_persistent_volume_reply import UpdatePersistentVolumeReply as UpdatePersistentVolumeReply +from koyeb.api.models.update_persistent_volume_request import UpdatePersistentVolumeRequest as UpdatePersistentVolumeRequest +from koyeb.api.models.update_project_reply import UpdateProjectReply as UpdateProjectReply from koyeb.api.models.update_secret_reply import UpdateSecretReply as UpdateSecretReply from koyeb.api.models.update_service import UpdateService as UpdateService -from koyeb.api.models.update_service_reply import ( - UpdateServiceReply as UpdateServiceReply, -) -from koyeb.api.models.update_snapshot_reply import ( - UpdateSnapshotReply as UpdateSnapshotReply, -) -from koyeb.api.models.update_snapshot_request import ( - UpdateSnapshotRequest as UpdateSnapshotRequest, -) -from koyeb.api.models.update_user_request_user_update_body import ( - UpdateUserRequestUserUpdateBody as UpdateUserRequestUserUpdateBody, -) -from koyeb.api.models.update_user_settings_reply import ( - UpdateUserSettingsReply as UpdateUserSettingsReply, -) -from koyeb.api.models.update_user_settings_request import ( - UpdateUserSettingsRequest as UpdateUserSettingsRequest, -) -from koyeb.api.models.upsert_signup_qualification_reply import ( - UpsertSignupQualificationReply as UpsertSignupQualificationReply, -) -from koyeb.api.models.upsert_signup_qualification_request import ( - UpsertSignupQualificationRequest as UpsertSignupQualificationRequest, -) +from koyeb.api.models.update_service_reply import UpdateServiceReply as UpdateServiceReply +from koyeb.api.models.update_service_scaling_request import UpdateServiceScalingRequest as UpdateServiceScalingRequest +from koyeb.api.models.update_snapshot_reply import UpdateSnapshotReply as UpdateSnapshotReply +from koyeb.api.models.update_snapshot_request import UpdateSnapshotRequest as UpdateSnapshotRequest +from koyeb.api.models.update_user_request_user_update_body import UpdateUserRequestUserUpdateBody as UpdateUserRequestUserUpdateBody +from koyeb.api.models.update_user_settings_reply import UpdateUserSettingsReply as UpdateUserSettingsReply +from koyeb.api.models.update_user_settings_request import UpdateUserSettingsRequest as UpdateUserSettingsRequest +from koyeb.api.models.upsert_signup_qualification_reply import UpsertSignupQualificationReply as UpsertSignupQualificationReply +from koyeb.api.models.upsert_signup_qualification_request import UpsertSignupQualificationRequest as UpsertSignupQualificationRequest from koyeb.api.models.usage import Usage as Usage from koyeb.api.models.usage_details import UsageDetails as UsageDetails from koyeb.api.models.user import User as User @@ -1281,9 +887,6 @@ from koyeb.api.models.user_reply import UserReply as UserReply from koyeb.api.models.user_role_role import UserRoleRole as UserRoleRole from koyeb.api.models.user_settings import UserSettings as UserSettings -from koyeb.api.models.verify_docker_image_reply import ( - VerifyDockerImageReply as VerifyDockerImageReply, -) -from koyeb.api.models.verify_docker_image_reply_err_code import ( - VerifyDockerImageReplyErrCode as VerifyDockerImageReplyErrCode, -) +from koyeb.api.models.verify_docker_image_reply import VerifyDockerImageReply as VerifyDockerImageReply +from koyeb.api.models.verify_docker_image_reply_err_code import VerifyDockerImageReplyErrCode as VerifyDockerImageReplyErrCode + diff --git a/koyeb/api/api/__init__.py b/koyeb/api/api/__init__.py index de6735ed..bf342f4d 100644 --- a/koyeb/api/api/__init__.py +++ b/koyeb/api/api/__init__.py @@ -24,6 +24,7 @@ from koyeb.api.api.payment_methods_api import PaymentMethodsApi from koyeb.api.api.persistent_volumes_api import PersistentVolumesApi from koyeb.api.api.profile_api import ProfileApi +from koyeb.api.api.projects_api import ProjectsApi from koyeb.api.api.provisioning_api import ProvisioningApi from koyeb.api.api.quotas_api import QuotasApi from koyeb.api.api.regional_deployments_api import RegionalDeploymentsApi @@ -42,3 +43,4 @@ from koyeb.api.api.invite_api import InviteApi from koyeb.api.api.organization_api import OrganizationApi from koyeb.api.api.sso_api import SsoApi + diff --git a/koyeb/api/api/activity_api.py b/koyeb/api/api/activity_api.py index d6dce02e..de64a059 100644 --- a/koyeb/api/api/activity_api.py +++ b/koyeb/api/api/activity_api.py @@ -1,16 +1,15 @@ -# coding: utf-8 - """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 + import warnings from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt from typing import Any, Dict, List, Optional, Tuple, Union @@ -39,6 +38,7 @@ def __init__(self, api_client=None) -> None: api_client = ApiClient.get_default() self.api_client = api_client + @validate_call def get_account_activities( self, @@ -48,8 +48,9 @@ def get_account_activities( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -83,7 +84,7 @@ def get_account_activities( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._get_account_activities_serialize( limit=limit, @@ -91,20 +92,21 @@ def get_account_activities( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ActivityList", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "ActivityList", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -112,6 +114,7 @@ def get_account_activities( response_types_map=_response_types_map, ).data + @validate_call def get_account_activities_with_http_info( self, @@ -121,8 +124,9 @@ def get_account_activities_with_http_info( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -156,7 +160,7 @@ def get_account_activities_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._get_account_activities_serialize( limit=limit, @@ -164,20 +168,21 @@ def get_account_activities_with_http_info( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ActivityList", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "ActivityList", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -185,6 +190,7 @@ def get_account_activities_with_http_info( response_types_map=_response_types_map, ) + @validate_call def get_account_activities_without_preload_content( self, @@ -194,8 +200,9 @@ def get_account_activities_without_preload_content( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -229,7 +236,7 @@ def get_account_activities_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._get_account_activities_serialize( limit=limit, @@ -237,23 +244,25 @@ def get_account_activities_without_preload_content( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ActivityList", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "ActivityList", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) return response_data.response + def _get_account_activities_serialize( self, limit, @@ -266,7 +275,8 @@ def _get_account_activities_serialize( _host = None - _collection_formats: Dict[str, str] = {} + _collection_formats: Dict[str, str] = { + } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -280,27 +290,35 @@ def _get_account_activities_serialize( # process the path parameters # process the query parameters if limit is not None: - - _query_params.append(("limit", limit)) - + + _query_params.append(('limit', limit)) + if offset is not None: - - _query_params.append(("offset", offset)) - + + _query_params.append(('offset', offset)) + # process the header parameters # process the form parameters # process the body parameter + # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept(["*/*"]) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + '*/*' + ] + ) + # authentication setting - _auth_settings: List[str] = ["Bearer"] + _auth_settings: List[str] = [ + 'Bearer' + ] return self.api_client.param_serialize( - method="GET", - resource_path="/v1/account/activities", + method='GET', + resource_path='/v1/account/activities', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -310,24 +328,25 @@ def _get_account_activities_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth, + _request_auth=_request_auth ) + + + @validate_call def list_activities( self, limit: Optional[StrictStr] = None, offset: Optional[StrictStr] = None, - types: Annotated[ - Optional[List[StrictStr]], - Field(description="(Optional) Filter on object type"), - ] = None, + types: Annotated[Optional[List[StrictStr]], Field(description="(Optional) Filter on object type")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -363,7 +382,7 @@ def list_activities( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._list_activities_serialize( limit=limit, @@ -372,20 +391,21 @@ def list_activities( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ActivityList", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "ActivityList", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -393,21 +413,20 @@ def list_activities( response_types_map=_response_types_map, ).data + @validate_call def list_activities_with_http_info( self, limit: Optional[StrictStr] = None, offset: Optional[StrictStr] = None, - types: Annotated[ - Optional[List[StrictStr]], - Field(description="(Optional) Filter on object type"), - ] = None, + types: Annotated[Optional[List[StrictStr]], Field(description="(Optional) Filter on object type")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -443,7 +462,7 @@ def list_activities_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._list_activities_serialize( limit=limit, @@ -452,20 +471,21 @@ def list_activities_with_http_info( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ActivityList", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "ActivityList", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -473,21 +493,20 @@ def list_activities_with_http_info( response_types_map=_response_types_map, ) + @validate_call def list_activities_without_preload_content( self, limit: Optional[StrictStr] = None, offset: Optional[StrictStr] = None, - types: Annotated[ - Optional[List[StrictStr]], - Field(description="(Optional) Filter on object type"), - ] = None, + types: Annotated[Optional[List[StrictStr]], Field(description="(Optional) Filter on object type")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -523,7 +542,7 @@ def list_activities_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._list_activities_serialize( limit=limit, @@ -532,23 +551,25 @@ def list_activities_without_preload_content( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ActivityList", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "ActivityList", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) return response_data.response + def _list_activities_serialize( self, limit, @@ -563,7 +584,7 @@ def _list_activities_serialize( _host = None _collection_formats: Dict[str, str] = { - "types": "multi", + 'types': 'multi', } _path_params: Dict[str, str] = {} @@ -578,31 +599,39 @@ def _list_activities_serialize( # process the path parameters # process the query parameters if limit is not None: - - _query_params.append(("limit", limit)) - + + _query_params.append(('limit', limit)) + if offset is not None: - - _query_params.append(("offset", offset)) - + + _query_params.append(('offset', offset)) + if types is not None: - - _query_params.append(("types", types)) - + + _query_params.append(('types', types)) + # process the header parameters # process the form parameters # process the body parameter + # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept(["*/*"]) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + '*/*' + ] + ) + # authentication setting - _auth_settings: List[str] = ["Bearer"] + _auth_settings: List[str] = [ + 'Bearer' + ] return self.api_client.param_serialize( - method="GET", - resource_path="/v1/activities", + method='GET', + resource_path='/v1/activities', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -612,9 +641,12 @@ def _list_activities_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth, + _request_auth=_request_auth ) + + + @validate_call def list_notifications( self, @@ -628,8 +660,9 @@ def list_notifications( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -671,7 +704,7 @@ def list_notifications( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._list_notifications_serialize( limit=limit, @@ -683,20 +716,21 @@ def list_notifications( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "NotificationList", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "NotificationList", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -704,6 +738,7 @@ def list_notifications( response_types_map=_response_types_map, ).data + @validate_call def list_notifications_with_http_info( self, @@ -717,8 +752,9 @@ def list_notifications_with_http_info( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -760,7 +796,7 @@ def list_notifications_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._list_notifications_serialize( limit=limit, @@ -772,20 +808,21 @@ def list_notifications_with_http_info( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "NotificationList", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "NotificationList", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -793,6 +830,7 @@ def list_notifications_with_http_info( response_types_map=_response_types_map, ) + @validate_call def list_notifications_without_preload_content( self, @@ -806,8 +844,9 @@ def list_notifications_without_preload_content( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -849,7 +888,7 @@ def list_notifications_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._list_notifications_serialize( limit=limit, @@ -861,23 +900,25 @@ def list_notifications_without_preload_content( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "NotificationList", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "NotificationList", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) return response_data.response + def _list_notifications_serialize( self, limit, @@ -894,7 +935,8 @@ def _list_notifications_serialize( _host = None - _collection_formats: Dict[str, str] = {} + _collection_formats: Dict[str, str] = { + } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -908,43 +950,51 @@ def _list_notifications_serialize( # process the path parameters # process the query parameters if limit is not None: - - _query_params.append(("limit", limit)) - + + _query_params.append(('limit', limit)) + if offset is not None: - - _query_params.append(("offset", offset)) - + + _query_params.append(('offset', offset)) + if mark_read is not None: - - _query_params.append(("mark_read", mark_read)) - + + _query_params.append(('mark_read', mark_read)) + if mark_seen is not None: - - _query_params.append(("mark_seen", mark_seen)) - + + _query_params.append(('mark_seen', mark_seen)) + if unread is not None: - - _query_params.append(("unread", unread)) - + + _query_params.append(('unread', unread)) + if unseen is not None: - - _query_params.append(("unseen", unseen)) - + + _query_params.append(('unseen', unseen)) + # process the header parameters # process the form parameters # process the body parameter + # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept(["*/*"]) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + '*/*' + ] + ) + # authentication setting - _auth_settings: List[str] = ["Bearer"] + _auth_settings: List[str] = [ + 'Bearer' + ] return self.api_client.param_serialize( - method="GET", - resource_path="/v1/notifications", + method='GET', + resource_path='/v1/notifications', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -954,5 +1004,7 @@ def _list_notifications_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth, + _request_auth=_request_auth ) + + diff --git a/koyeb/api/api/apps_api.py b/koyeb/api/api/apps_api.py index 18c642cb..6d5d1066 100644 --- a/koyeb/api/api/apps_api.py +++ b/koyeb/api/api/apps_api.py @@ -1,16 +1,15 @@ -# coding: utf-8 - """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 + import warnings from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt from typing import Any, Dict, List, Optional, Tuple, Union @@ -44,6 +43,7 @@ def __init__(self, api_client=None) -> None: api_client = ApiClient.get_default() self.api_client = api_client + @validate_call def create_app( self, @@ -52,8 +52,9 @@ def create_app( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -85,27 +86,28 @@ def create_app( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._create_app_serialize( app=app, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "CreateAppReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "CreateAppReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -113,6 +115,7 @@ def create_app( response_types_map=_response_types_map, ).data + @validate_call def create_app_with_http_info( self, @@ -121,8 +124,9 @@ def create_app_with_http_info( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -154,27 +158,28 @@ def create_app_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._create_app_serialize( app=app, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "CreateAppReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "CreateAppReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -182,6 +187,7 @@ def create_app_with_http_info( response_types_map=_response_types_map, ) + @validate_call def create_app_without_preload_content( self, @@ -190,8 +196,9 @@ def create_app_without_preload_content( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -223,30 +230,32 @@ def create_app_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._create_app_serialize( app=app, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "CreateAppReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "CreateAppReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) return response_data.response + def _create_app_serialize( self, app, @@ -258,7 +267,8 @@ def _create_app_serialize( _host = None - _collection_formats: Dict[str, str] = {} + _collection_formats: Dict[str, str] = { + } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -277,16 +287,24 @@ def _create_app_serialize( if app is not None: _body_params = app + # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept(["*/*"]) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + '*/*' + ] + ) + # authentication setting - _auth_settings: List[str] = ["Bearer"] + _auth_settings: List[str] = [ + 'Bearer' + ] return self.api_client.param_serialize( - method="POST", - resource_path="/v1/apps", + method='POST', + resource_path='/v1/apps', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -296,9 +314,12 @@ def _create_app_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth, + _request_auth=_request_auth ) + + + @validate_call def delete_app( self, @@ -307,8 +328,9 @@ def delete_app( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -341,27 +363,28 @@ def delete_app( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._delete_app_serialize( id=id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "object", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "object", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -369,6 +392,7 @@ def delete_app( response_types_map=_response_types_map, ).data + @validate_call def delete_app_with_http_info( self, @@ -377,8 +401,9 @@ def delete_app_with_http_info( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -411,27 +436,28 @@ def delete_app_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._delete_app_serialize( id=id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "object", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "object", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -439,6 +465,7 @@ def delete_app_with_http_info( response_types_map=_response_types_map, ) + @validate_call def delete_app_without_preload_content( self, @@ -447,8 +474,9 @@ def delete_app_without_preload_content( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -481,30 +509,32 @@ def delete_app_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._delete_app_serialize( id=id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "object", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "object", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) return response_data.response + def _delete_app_serialize( self, id, @@ -516,7 +546,8 @@ def _delete_app_serialize( _host = None - _collection_formats: Dict[str, str] = {} + _collection_formats: Dict[str, str] = { + } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -529,22 +560,30 @@ def _delete_app_serialize( # process the path parameters if id is not None: - _path_params["id"] = id + _path_params['id'] = id # process the query parameters # process the header parameters # process the form parameters # process the body parameter + # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept(["*/*"]) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + '*/*' + ] + ) + # authentication setting - _auth_settings: List[str] = ["Bearer"] + _auth_settings: List[str] = [ + 'Bearer' + ] return self.api_client.param_serialize( - method="DELETE", - resource_path="/v1/apps/{id}", + method='DELETE', + resource_path='/v1/apps/{id}', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -554,9 +593,12 @@ def _delete_app_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth, + _request_auth=_request_auth ) + + + @validate_call def get_app( self, @@ -565,8 +607,9 @@ def get_app( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -598,27 +641,28 @@ def get_app( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._get_app_serialize( id=id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "GetAppReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "GetAppReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -626,6 +670,7 @@ def get_app( response_types_map=_response_types_map, ).data + @validate_call def get_app_with_http_info( self, @@ -634,8 +679,9 @@ def get_app_with_http_info( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -667,27 +713,28 @@ def get_app_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._get_app_serialize( id=id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "GetAppReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "GetAppReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -695,6 +742,7 @@ def get_app_with_http_info( response_types_map=_response_types_map, ) + @validate_call def get_app_without_preload_content( self, @@ -703,8 +751,9 @@ def get_app_without_preload_content( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -736,30 +785,32 @@ def get_app_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._get_app_serialize( id=id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "GetAppReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "GetAppReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) return response_data.response + def _get_app_serialize( self, id, @@ -771,7 +822,8 @@ def _get_app_serialize( _host = None - _collection_formats: Dict[str, str] = {} + _collection_formats: Dict[str, str] = { + } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -784,22 +836,30 @@ def _get_app_serialize( # process the path parameters if id is not None: - _path_params["id"] = id + _path_params['id'] = id # process the query parameters # process the header parameters # process the form parameters # process the body parameter + # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept(["*/*"]) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + '*/*' + ] + ) + # authentication setting - _auth_settings: List[str] = ["Bearer"] + _auth_settings: List[str] = [ + 'Bearer' + ] return self.api_client.param_serialize( - method="GET", - resource_path="/v1/apps/{id}", + method='GET', + resource_path='/v1/apps/{id}', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -809,39 +869,27 @@ def _get_app_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth, + _request_auth=_request_auth ) + + + @validate_call def list_app_events( self, - app_id: Annotated[ - Optional[StrictStr], Field(description="(Optional) Filter on app id") - ] = None, - types: Annotated[ - Optional[List[StrictStr]], - Field(description="(Optional) Filter on app event types"), - ] = None, - limit: Annotated[ - Optional[StrictStr], - Field(description="(Optional) The number of items to return"), - ] = None, - offset: Annotated[ - Optional[StrictStr], - Field(description="(Optional) The offset in the list of item to return"), - ] = None, - order: Annotated[ - Optional[StrictStr], - Field( - description="(Optional) Sorts the list in the ascending or the descending order" - ), - ] = None, + app_id: Annotated[Optional[StrictStr], Field(description="(Optional) Filter on app id")] = None, + types: Annotated[Optional[List[StrictStr]], Field(description="(Optional) Filter on app event types")] = None, + limit: Annotated[Optional[StrictStr], Field(description="(Optional) The number of items to return")] = None, + offset: Annotated[Optional[StrictStr], Field(description="(Optional) The offset in the list of item to return")] = None, + order: Annotated[Optional[StrictStr], Field(description="(Optional) Sorts the list in the ascending or the descending order")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -881,7 +929,7 @@ def list_app_events( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._list_app_events_serialize( app_id=app_id, @@ -892,20 +940,21 @@ def list_app_events( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ListAppEventsReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "ListAppEventsReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -913,36 +962,22 @@ def list_app_events( response_types_map=_response_types_map, ).data + @validate_call def list_app_events_with_http_info( self, - app_id: Annotated[ - Optional[StrictStr], Field(description="(Optional) Filter on app id") - ] = None, - types: Annotated[ - Optional[List[StrictStr]], - Field(description="(Optional) Filter on app event types"), - ] = None, - limit: Annotated[ - Optional[StrictStr], - Field(description="(Optional) The number of items to return"), - ] = None, - offset: Annotated[ - Optional[StrictStr], - Field(description="(Optional) The offset in the list of item to return"), - ] = None, - order: Annotated[ - Optional[StrictStr], - Field( - description="(Optional) Sorts the list in the ascending or the descending order" - ), - ] = None, + app_id: Annotated[Optional[StrictStr], Field(description="(Optional) Filter on app id")] = None, + types: Annotated[Optional[List[StrictStr]], Field(description="(Optional) Filter on app event types")] = None, + limit: Annotated[Optional[StrictStr], Field(description="(Optional) The number of items to return")] = None, + offset: Annotated[Optional[StrictStr], Field(description="(Optional) The offset in the list of item to return")] = None, + order: Annotated[Optional[StrictStr], Field(description="(Optional) Sorts the list in the ascending or the descending order")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -982,7 +1017,7 @@ def list_app_events_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._list_app_events_serialize( app_id=app_id, @@ -993,20 +1028,21 @@ def list_app_events_with_http_info( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ListAppEventsReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "ListAppEventsReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -1014,36 +1050,22 @@ def list_app_events_with_http_info( response_types_map=_response_types_map, ) + @validate_call def list_app_events_without_preload_content( self, - app_id: Annotated[ - Optional[StrictStr], Field(description="(Optional) Filter on app id") - ] = None, - types: Annotated[ - Optional[List[StrictStr]], - Field(description="(Optional) Filter on app event types"), - ] = None, - limit: Annotated[ - Optional[StrictStr], - Field(description="(Optional) The number of items to return"), - ] = None, - offset: Annotated[ - Optional[StrictStr], - Field(description="(Optional) The offset in the list of item to return"), - ] = None, - order: Annotated[ - Optional[StrictStr], - Field( - description="(Optional) Sorts the list in the ascending or the descending order" - ), - ] = None, + app_id: Annotated[Optional[StrictStr], Field(description="(Optional) Filter on app id")] = None, + types: Annotated[Optional[List[StrictStr]], Field(description="(Optional) Filter on app event types")] = None, + limit: Annotated[Optional[StrictStr], Field(description="(Optional) The number of items to return")] = None, + offset: Annotated[Optional[StrictStr], Field(description="(Optional) The offset in the list of item to return")] = None, + order: Annotated[Optional[StrictStr], Field(description="(Optional) Sorts the list in the ascending or the descending order")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -1083,7 +1105,7 @@ def list_app_events_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._list_app_events_serialize( app_id=app_id, @@ -1094,23 +1116,25 @@ def list_app_events_without_preload_content( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ListAppEventsReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "ListAppEventsReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) return response_data.response + def _list_app_events_serialize( self, app_id, @@ -1127,7 +1151,7 @@ def _list_app_events_serialize( _host = None _collection_formats: Dict[str, str] = { - "types": "multi", + 'types': 'multi', } _path_params: Dict[str, str] = {} @@ -1142,39 +1166,47 @@ def _list_app_events_serialize( # process the path parameters # process the query parameters if app_id is not None: - - _query_params.append(("app_id", app_id)) - + + _query_params.append(('app_id', app_id)) + if types is not None: - - _query_params.append(("types", types)) - + + _query_params.append(('types', types)) + if limit is not None: - - _query_params.append(("limit", limit)) - + + _query_params.append(('limit', limit)) + if offset is not None: - - _query_params.append(("offset", offset)) - + + _query_params.append(('offset', offset)) + if order is not None: - - _query_params.append(("order", order)) - + + _query_params.append(('order', order)) + # process the header parameters # process the form parameters # process the body parameter + # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept(["*/*"]) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + '*/*' + ] + ) + # authentication setting - _auth_settings: List[str] = ["Bearer"] + _auth_settings: List[str] = [ + 'Bearer' + ] return self.api_client.param_serialize( - method="GET", - resource_path="/v1/app_events", + method='GET', + resource_path='/v1/app_events', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -1184,29 +1216,26 @@ def _list_app_events_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth, + _request_auth=_request_auth ) + + + @validate_call def list_apps( self, - limit: Annotated[ - Optional[StrictStr], - Field(description="(Optional) The number of items to return"), - ] = None, - offset: Annotated[ - Optional[StrictStr], - Field(description="(Optional) The offset in the list of item to return"), - ] = None, - name: Annotated[ - Optional[StrictStr], Field(description="(Optional) A filter for name") - ] = None, + limit: Annotated[Optional[StrictStr], Field(description="(Optional) The number of items to return")] = None, + offset: Annotated[Optional[StrictStr], Field(description="(Optional) The offset in the list of item to return")] = None, + name: Annotated[Optional[StrictStr], Field(description="(Optional) A filter for name")] = None, + project_id: Annotated[Optional[StrictStr], Field(description="(Optional) A filter for the project ID")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -1222,6 +1251,8 @@ def list_apps( :type offset: str :param name: (Optional) A filter for name :type name: str + :param project_id: (Optional) A filter for the project ID + :type project_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -1242,29 +1273,31 @@ def list_apps( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._list_apps_serialize( limit=limit, offset=offset, name=name, + project_id=project_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ListAppsReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "ListAppsReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -1272,26 +1305,21 @@ def list_apps( response_types_map=_response_types_map, ).data + @validate_call def list_apps_with_http_info( self, - limit: Annotated[ - Optional[StrictStr], - Field(description="(Optional) The number of items to return"), - ] = None, - offset: Annotated[ - Optional[StrictStr], - Field(description="(Optional) The offset in the list of item to return"), - ] = None, - name: Annotated[ - Optional[StrictStr], Field(description="(Optional) A filter for name") - ] = None, + limit: Annotated[Optional[StrictStr], Field(description="(Optional) The number of items to return")] = None, + offset: Annotated[Optional[StrictStr], Field(description="(Optional) The offset in the list of item to return")] = None, + name: Annotated[Optional[StrictStr], Field(description="(Optional) A filter for name")] = None, + project_id: Annotated[Optional[StrictStr], Field(description="(Optional) A filter for the project ID")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -1307,6 +1335,8 @@ def list_apps_with_http_info( :type offset: str :param name: (Optional) A filter for name :type name: str + :param project_id: (Optional) A filter for the project ID + :type project_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -1327,29 +1357,31 @@ def list_apps_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._list_apps_serialize( limit=limit, offset=offset, name=name, + project_id=project_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ListAppsReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "ListAppsReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -1357,26 +1389,21 @@ def list_apps_with_http_info( response_types_map=_response_types_map, ) + @validate_call def list_apps_without_preload_content( self, - limit: Annotated[ - Optional[StrictStr], - Field(description="(Optional) The number of items to return"), - ] = None, - offset: Annotated[ - Optional[StrictStr], - Field(description="(Optional) The offset in the list of item to return"), - ] = None, - name: Annotated[ - Optional[StrictStr], Field(description="(Optional) A filter for name") - ] = None, + limit: Annotated[Optional[StrictStr], Field(description="(Optional) The number of items to return")] = None, + offset: Annotated[Optional[StrictStr], Field(description="(Optional) The offset in the list of item to return")] = None, + name: Annotated[Optional[StrictStr], Field(description="(Optional) A filter for name")] = None, + project_id: Annotated[Optional[StrictStr], Field(description="(Optional) A filter for the project ID")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -1392,6 +1419,8 @@ def list_apps_without_preload_content( :type offset: str :param name: (Optional) A filter for name :type name: str + :param project_id: (Optional) A filter for the project ID + :type project_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -1412,37 +1441,41 @@ def list_apps_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._list_apps_serialize( limit=limit, offset=offset, name=name, + project_id=project_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ListAppsReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "ListAppsReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) return response_data.response + def _list_apps_serialize( self, limit, offset, name, + project_id, _request_auth, _content_type, _headers, @@ -1451,7 +1484,8 @@ def _list_apps_serialize( _host = None - _collection_formats: Dict[str, str] = {} + _collection_formats: Dict[str, str] = { + } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -1465,31 +1499,43 @@ def _list_apps_serialize( # process the path parameters # process the query parameters if limit is not None: - - _query_params.append(("limit", limit)) - + + _query_params.append(('limit', limit)) + if offset is not None: - - _query_params.append(("offset", offset)) - + + _query_params.append(('offset', offset)) + if name is not None: - - _query_params.append(("name", name)) - + + _query_params.append(('name', name)) + + if project_id is not None: + + _query_params.append(('project_id', project_id)) + # process the header parameters # process the form parameters # process the body parameter + # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept(["*/*"]) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + '*/*' + ] + ) + # authentication setting - _auth_settings: List[str] = ["Bearer"] + _auth_settings: List[str] = [ + 'Bearer' + ] return self.api_client.param_serialize( - method="GET", - resource_path="/v1/apps", + method='GET', + resource_path='/v1/apps', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -1499,9 +1545,12 @@ def _list_apps_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth, + _request_auth=_request_auth ) + + + @validate_call def pause_app( self, @@ -1510,8 +1559,9 @@ def pause_app( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -1544,27 +1594,28 @@ def pause_app( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._pause_app_serialize( id=id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "object", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "object", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -1572,6 +1623,7 @@ def pause_app( response_types_map=_response_types_map, ).data + @validate_call def pause_app_with_http_info( self, @@ -1580,8 +1632,9 @@ def pause_app_with_http_info( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -1614,27 +1667,28 @@ def pause_app_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._pause_app_serialize( id=id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "object", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "object", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -1642,6 +1696,7 @@ def pause_app_with_http_info( response_types_map=_response_types_map, ) + @validate_call def pause_app_without_preload_content( self, @@ -1650,8 +1705,9 @@ def pause_app_without_preload_content( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -1684,30 +1740,32 @@ def pause_app_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._pause_app_serialize( id=id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "object", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "object", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) return response_data.response + def _pause_app_serialize( self, id, @@ -1719,7 +1777,8 @@ def _pause_app_serialize( _host = None - _collection_formats: Dict[str, str] = {} + _collection_formats: Dict[str, str] = { + } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -1732,22 +1791,30 @@ def _pause_app_serialize( # process the path parameters if id is not None: - _path_params["id"] = id + _path_params['id'] = id # process the query parameters # process the header parameters # process the form parameters # process the body parameter + # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept(["*/*"]) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + '*/*' + ] + ) + # authentication setting - _auth_settings: List[str] = ["Bearer"] + _auth_settings: List[str] = [ + 'Bearer' + ] return self.api_client.param_serialize( - method="POST", - resource_path="/v1/apps/{id}/pause", + method='POST', + resource_path='/v1/apps/{id}/pause', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -1757,9 +1824,12 @@ def _pause_app_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth, + _request_auth=_request_auth ) + + + @validate_call def resume_app( self, @@ -1768,8 +1838,9 @@ def resume_app( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -1802,27 +1873,28 @@ def resume_app( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._resume_app_serialize( id=id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "object", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "object", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -1830,6 +1902,7 @@ def resume_app( response_types_map=_response_types_map, ).data + @validate_call def resume_app_with_http_info( self, @@ -1838,8 +1911,9 @@ def resume_app_with_http_info( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -1872,27 +1946,28 @@ def resume_app_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._resume_app_serialize( id=id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "object", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "object", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -1900,6 +1975,7 @@ def resume_app_with_http_info( response_types_map=_response_types_map, ) + @validate_call def resume_app_without_preload_content( self, @@ -1908,8 +1984,9 @@ def resume_app_without_preload_content( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -1942,30 +2019,32 @@ def resume_app_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._resume_app_serialize( id=id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "object", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "object", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) return response_data.response + def _resume_app_serialize( self, id, @@ -1977,7 +2056,8 @@ def _resume_app_serialize( _host = None - _collection_formats: Dict[str, str] = {} + _collection_formats: Dict[str, str] = { + } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -1990,22 +2070,30 @@ def _resume_app_serialize( # process the path parameters if id is not None: - _path_params["id"] = id + _path_params['id'] = id # process the query parameters # process the header parameters # process the form parameters # process the body parameter + # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept(["*/*"]) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + '*/*' + ] + ) + # authentication setting - _auth_settings: List[str] = ["Bearer"] + _auth_settings: List[str] = [ + 'Bearer' + ] return self.api_client.param_serialize( - method="POST", - resource_path="/v1/apps/{id}/resume", + method='POST', + resource_path='/v1/apps/{id}/resume', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -2015,9 +2103,12 @@ def _resume_app_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth, + _request_auth=_request_auth ) + + + @validate_call def update_app( self, @@ -2028,8 +2119,9 @@ def update_app( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -2065,7 +2157,7 @@ def update_app( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._update_app_serialize( id=id, @@ -2074,20 +2166,21 @@ def update_app( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "UpdateAppReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "UpdateAppReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -2095,6 +2188,7 @@ def update_app( response_types_map=_response_types_map, ).data + @validate_call def update_app_with_http_info( self, @@ -2105,8 +2199,9 @@ def update_app_with_http_info( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -2142,7 +2237,7 @@ def update_app_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._update_app_serialize( id=id, @@ -2151,20 +2246,21 @@ def update_app_with_http_info( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "UpdateAppReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "UpdateAppReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -2172,6 +2268,7 @@ def update_app_with_http_info( response_types_map=_response_types_map, ) + @validate_call def update_app_without_preload_content( self, @@ -2182,8 +2279,9 @@ def update_app_without_preload_content( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -2219,7 +2317,7 @@ def update_app_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._update_app_serialize( id=id, @@ -2228,23 +2326,25 @@ def update_app_without_preload_content( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "UpdateAppReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "UpdateAppReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) return response_data.response + def _update_app_serialize( self, id, @@ -2258,7 +2358,8 @@ def _update_app_serialize( _host = None - _collection_formats: Dict[str, str] = {} + _collection_formats: Dict[str, str] = { + } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -2271,28 +2372,36 @@ def _update_app_serialize( # process the path parameters if id is not None: - _path_params["id"] = id + _path_params['id'] = id # process the query parameters if update_mask is not None: - - _query_params.append(("update_mask", update_mask)) - + + _query_params.append(('update_mask', update_mask)) + # process the header parameters # process the form parameters # process the body parameter if app is not None: _body_params = app + # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept(["*/*"]) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + '*/*' + ] + ) + # authentication setting - _auth_settings: List[str] = ["Bearer"] + _auth_settings: List[str] = [ + 'Bearer' + ] return self.api_client.param_serialize( - method="PUT", - resource_path="/v1/apps/{id}", + method='PUT', + resource_path='/v1/apps/{id}', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -2302,9 +2411,12 @@ def _update_app_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth, + _request_auth=_request_auth ) + + + @validate_call def update_app2( self, @@ -2315,8 +2427,9 @@ def update_app2( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -2352,7 +2465,7 @@ def update_app2( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._update_app2_serialize( id=id, @@ -2361,20 +2474,21 @@ def update_app2( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "UpdateAppReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "UpdateAppReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -2382,6 +2496,7 @@ def update_app2( response_types_map=_response_types_map, ).data + @validate_call def update_app2_with_http_info( self, @@ -2392,8 +2507,9 @@ def update_app2_with_http_info( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -2429,7 +2545,7 @@ def update_app2_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._update_app2_serialize( id=id, @@ -2438,20 +2554,21 @@ def update_app2_with_http_info( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "UpdateAppReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "UpdateAppReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -2459,6 +2576,7 @@ def update_app2_with_http_info( response_types_map=_response_types_map, ) + @validate_call def update_app2_without_preload_content( self, @@ -2469,8 +2587,9 @@ def update_app2_without_preload_content( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -2506,7 +2625,7 @@ def update_app2_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._update_app2_serialize( id=id, @@ -2515,23 +2634,25 @@ def update_app2_without_preload_content( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "UpdateAppReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "UpdateAppReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) return response_data.response + def _update_app2_serialize( self, id, @@ -2545,7 +2666,8 @@ def _update_app2_serialize( _host = None - _collection_formats: Dict[str, str] = {} + _collection_formats: Dict[str, str] = { + } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -2558,28 +2680,36 @@ def _update_app2_serialize( # process the path parameters if id is not None: - _path_params["id"] = id + _path_params['id'] = id # process the query parameters if update_mask is not None: - - _query_params.append(("update_mask", update_mask)) - + + _query_params.append(('update_mask', update_mask)) + # process the header parameters # process the form parameters # process the body parameter if app is not None: _body_params = app + # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept(["*/*"]) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + '*/*' + ] + ) + # authentication setting - _auth_settings: List[str] = ["Bearer"] + _auth_settings: List[str] = [ + 'Bearer' + ] return self.api_client.param_serialize( - method="PATCH", - resource_path="/v1/apps/{id}", + method='PATCH', + resource_path='/v1/apps/{id}', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -2589,5 +2719,7 @@ def _update_app2_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth, + _request_auth=_request_auth ) + + diff --git a/koyeb/api/api/archives_api.py b/koyeb/api/api/archives_api.py index 227f2a74..1d625096 100644 --- a/koyeb/api/api/archives_api.py +++ b/koyeb/api/api/archives_api.py @@ -1,16 +1,15 @@ -# coding: utf-8 - """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 + import warnings from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt from typing import Any, Dict, List, Optional, Tuple, Union @@ -36,6 +35,7 @@ def __init__(self, api_client=None) -> None: api_client = ApiClient.get_default() self.api_client = api_client + @validate_call def create_archive( self, @@ -44,8 +44,9 @@ def create_archive( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -78,27 +79,28 @@ def create_archive( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._create_archive_serialize( archive=archive, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "CreateArchiveReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "CreateArchiveReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -106,6 +108,7 @@ def create_archive( response_types_map=_response_types_map, ).data + @validate_call def create_archive_with_http_info( self, @@ -114,8 +117,9 @@ def create_archive_with_http_info( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -148,27 +152,28 @@ def create_archive_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._create_archive_serialize( archive=archive, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "CreateArchiveReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "CreateArchiveReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -176,6 +181,7 @@ def create_archive_with_http_info( response_types_map=_response_types_map, ) + @validate_call def create_archive_without_preload_content( self, @@ -184,8 +190,9 @@ def create_archive_without_preload_content( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -218,30 +225,32 @@ def create_archive_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._create_archive_serialize( archive=archive, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "CreateArchiveReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "CreateArchiveReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) return response_data.response + def _create_archive_serialize( self, archive, @@ -253,7 +262,8 @@ def _create_archive_serialize( _host = None - _collection_formats: Dict[str, str] = {} + _collection_formats: Dict[str, str] = { + } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -272,16 +282,24 @@ def _create_archive_serialize( if archive is not None: _body_params = archive + # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept(["*/*"]) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + '*/*' + ] + ) + # authentication setting - _auth_settings: List[str] = ["Bearer"] + _auth_settings: List[str] = [ + 'Bearer' + ] return self.api_client.param_serialize( - method="POST", - resource_path="/v1/archives", + method='POST', + resource_path='/v1/archives', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -291,5 +309,7 @@ def _create_archive_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth, + _request_auth=_request_auth ) + + diff --git a/koyeb/api/api/billing_api.py b/koyeb/api/api/billing_api.py index fcdb0609..c8d71169 100644 --- a/koyeb/api/api/billing_api.py +++ b/koyeb/api/api/billing_api.py @@ -1,16 +1,15 @@ -# coding: utf-8 - """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 + import warnings from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt from typing import Any, Dict, List, Optional, Tuple, Union @@ -37,6 +36,7 @@ def __init__(self, api_client=None) -> None: api_client = ApiClient.get_default() self.api_client = api_client + @validate_call def has_unpaid_invoices( self, @@ -44,8 +44,9 @@ def has_unpaid_invoices( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -76,26 +77,27 @@ def has_unpaid_invoices( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._has_unpaid_invoices_serialize( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "HasUnpaidInvoicesReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "HasUnpaidInvoicesReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -103,6 +105,7 @@ def has_unpaid_invoices( response_types_map=_response_types_map, ).data + @validate_call def has_unpaid_invoices_with_http_info( self, @@ -110,8 +113,9 @@ def has_unpaid_invoices_with_http_info( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -142,26 +146,27 @@ def has_unpaid_invoices_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._has_unpaid_invoices_serialize( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "HasUnpaidInvoicesReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "HasUnpaidInvoicesReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -169,6 +174,7 @@ def has_unpaid_invoices_with_http_info( response_types_map=_response_types_map, ) + @validate_call def has_unpaid_invoices_without_preload_content( self, @@ -176,8 +182,9 @@ def has_unpaid_invoices_without_preload_content( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -208,29 +215,31 @@ def has_unpaid_invoices_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._has_unpaid_invoices_serialize( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "HasUnpaidInvoicesReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "HasUnpaidInvoicesReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) return response_data.response + def _has_unpaid_invoices_serialize( self, _request_auth, @@ -241,7 +250,8 @@ def _has_unpaid_invoices_serialize( _host = None - _collection_formats: Dict[str, str] = {} + _collection_formats: Dict[str, str] = { + } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -258,16 +268,24 @@ def _has_unpaid_invoices_serialize( # process the form parameters # process the body parameter + # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept(["*/*"]) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + '*/*' + ] + ) + # authentication setting - _auth_settings: List[str] = ["Bearer"] + _auth_settings: List[str] = [ + 'Bearer' + ] return self.api_client.param_serialize( - method="GET", - resource_path="/v1/billing/has_unpaid_invoices", + method='GET', + resource_path='/v1/billing/has_unpaid_invoices', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -277,9 +295,12 @@ def _has_unpaid_invoices_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth, + _request_auth=_request_auth ) + + + @validate_call def manage( self, @@ -287,8 +308,9 @@ def manage( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -318,26 +340,27 @@ def manage( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._manage_serialize( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ManageReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "ManageReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -345,6 +368,7 @@ def manage( response_types_map=_response_types_map, ).data + @validate_call def manage_with_http_info( self, @@ -352,8 +376,9 @@ def manage_with_http_info( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -383,26 +408,27 @@ def manage_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._manage_serialize( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ManageReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "ManageReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -410,6 +436,7 @@ def manage_with_http_info( response_types_map=_response_types_map, ) + @validate_call def manage_without_preload_content( self, @@ -417,8 +444,9 @@ def manage_without_preload_content( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -448,29 +476,31 @@ def manage_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._manage_serialize( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ManageReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "ManageReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) return response_data.response + def _manage_serialize( self, _request_auth, @@ -481,7 +511,8 @@ def _manage_serialize( _host = None - _collection_formats: Dict[str, str] = {} + _collection_formats: Dict[str, str] = { + } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -498,16 +529,24 @@ def _manage_serialize( # process the form parameters # process the body parameter + # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept(["*/*"]) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + '*/*' + ] + ) + # authentication setting - _auth_settings: List[str] = ["Bearer"] + _auth_settings: List[str] = [ + 'Bearer' + ] return self.api_client.param_serialize( - method="GET", - resource_path="/v1/billing/manage", + method='GET', + resource_path='/v1/billing/manage', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -517,9 +556,12 @@ def _manage_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth, + _request_auth=_request_auth ) + + + @validate_call def next_invoice( self, @@ -527,8 +569,9 @@ def next_invoice( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -559,26 +602,27 @@ def next_invoice( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._next_invoice_serialize( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "NextInvoiceReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "NextInvoiceReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -586,6 +630,7 @@ def next_invoice( response_types_map=_response_types_map, ).data + @validate_call def next_invoice_with_http_info( self, @@ -593,8 +638,9 @@ def next_invoice_with_http_info( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -625,26 +671,27 @@ def next_invoice_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._next_invoice_serialize( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "NextInvoiceReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "NextInvoiceReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -652,6 +699,7 @@ def next_invoice_with_http_info( response_types_map=_response_types_map, ) + @validate_call def next_invoice_without_preload_content( self, @@ -659,8 +707,9 @@ def next_invoice_without_preload_content( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -691,29 +740,31 @@ def next_invoice_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._next_invoice_serialize( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "NextInvoiceReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "NextInvoiceReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) return response_data.response + def _next_invoice_serialize( self, _request_auth, @@ -724,7 +775,8 @@ def _next_invoice_serialize( _host = None - _collection_formats: Dict[str, str] = {} + _collection_formats: Dict[str, str] = { + } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -741,16 +793,24 @@ def _next_invoice_serialize( # process the form parameters # process the body parameter + # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept(["*/*"]) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + '*/*' + ] + ) + # authentication setting - _auth_settings: List[str] = ["Bearer"] + _auth_settings: List[str] = [ + 'Bearer' + ] return self.api_client.param_serialize( - method="GET", - resource_path="/v1/billing/next_invoice", + method='GET', + resource_path='/v1/billing/next_invoice', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -760,5 +820,7 @@ def _next_invoice_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth, + _request_auth=_request_auth ) + + diff --git a/koyeb/api/api/catalog_datacenters_api.py b/koyeb/api/api/catalog_datacenters_api.py index d9cce931..c26f57af 100644 --- a/koyeb/api/api/catalog_datacenters_api.py +++ b/koyeb/api/api/catalog_datacenters_api.py @@ -1,16 +1,15 @@ -# coding: utf-8 - """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 + import warnings from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt from typing import Any, Dict, List, Optional, Tuple, Union @@ -35,6 +34,7 @@ def __init__(self, api_client=None) -> None: api_client = ApiClient.get_default() self.api_client = api_client + @validate_call def list_datacenters( self, @@ -42,8 +42,9 @@ def list_datacenters( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -73,20 +74,21 @@ def list_datacenters( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._list_datacenters_serialize( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ListDatacentersReply", + '200': "ListDatacentersReply", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -94,6 +96,7 @@ def list_datacenters( response_types_map=_response_types_map, ).data + @validate_call def list_datacenters_with_http_info( self, @@ -101,8 +104,9 @@ def list_datacenters_with_http_info( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -132,20 +136,21 @@ def list_datacenters_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._list_datacenters_serialize( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ListDatacentersReply", + '200': "ListDatacentersReply", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -153,6 +158,7 @@ def list_datacenters_with_http_info( response_types_map=_response_types_map, ) + @validate_call def list_datacenters_without_preload_content( self, @@ -160,8 +166,9 @@ def list_datacenters_without_preload_content( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -191,23 +198,25 @@ def list_datacenters_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._list_datacenters_serialize( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ListDatacentersReply", + '200': "ListDatacentersReply", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) return response_data.response + def _list_datacenters_serialize( self, _request_auth, @@ -218,7 +227,8 @@ def _list_datacenters_serialize( _host = None - _collection_formats: Dict[str, str] = {} + _collection_formats: Dict[str, str] = { + } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -235,16 +245,24 @@ def _list_datacenters_serialize( # process the form parameters # process the body parameter + # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept(["*/*"]) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + '*/*' + ] + ) + # authentication setting - _auth_settings: List[str] = ["Bearer"] + _auth_settings: List[str] = [ + 'Bearer' + ] return self.api_client.param_serialize( - method="GET", - resource_path="/v1/catalog/datacenters", + method='GET', + resource_path='/v1/catalog/datacenters', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -254,5 +272,7 @@ def _list_datacenters_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth, + _request_auth=_request_auth ) + + diff --git a/koyeb/api/api/catalog_instance_usage_api.py b/koyeb/api/api/catalog_instance_usage_api.py index cd581395..317c82d6 100644 --- a/koyeb/api/api/catalog_instance_usage_api.py +++ b/koyeb/api/api/catalog_instance_usage_api.py @@ -1,16 +1,15 @@ -# coding: utf-8 - """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 + import warnings from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt from typing import Any, Dict, List, Optional, Tuple, Union @@ -37,6 +36,7 @@ def __init__(self, api_client=None) -> None: api_client = ApiClient.get_default() self.api_client = api_client + @validate_call def list_usage( self, @@ -45,8 +45,9 @@ def list_usage( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -78,21 +79,22 @@ def list_usage( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._list_usage_serialize( region=region, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ListUsageReply", + '200': "ListUsageReply", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -100,6 +102,7 @@ def list_usage( response_types_map=_response_types_map, ).data + @validate_call def list_usage_with_http_info( self, @@ -108,8 +111,9 @@ def list_usage_with_http_info( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -141,21 +145,22 @@ def list_usage_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._list_usage_serialize( region=region, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ListUsageReply", + '200': "ListUsageReply", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -163,6 +168,7 @@ def list_usage_with_http_info( response_types_map=_response_types_map, ) + @validate_call def list_usage_without_preload_content( self, @@ -171,8 +177,9 @@ def list_usage_without_preload_content( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -204,24 +211,26 @@ def list_usage_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._list_usage_serialize( region=region, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ListUsageReply", + '200': "ListUsageReply", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) return response_data.response + def _list_usage_serialize( self, region, @@ -233,7 +242,8 @@ def _list_usage_serialize( _host = None - _collection_formats: Dict[str, str] = {} + _collection_formats: Dict[str, str] = { + } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -247,23 +257,31 @@ def _list_usage_serialize( # process the path parameters # process the query parameters if region is not None: - - _query_params.append(("region", region)) - + + _query_params.append(('region', region)) + # process the header parameters # process the form parameters # process the body parameter + # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept(["*/*"]) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + '*/*' + ] + ) + # authentication setting - _auth_settings: List[str] = ["Bearer"] + _auth_settings: List[str] = [ + 'Bearer' + ] return self.api_client.param_serialize( - method="GET", - resource_path="/v1/catalog/usage", + method='GET', + resource_path='/v1/catalog/usage', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -273,5 +291,7 @@ def _list_usage_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth, + _request_auth=_request_auth ) + + diff --git a/koyeb/api/api/catalog_instances_api.py b/koyeb/api/api/catalog_instances_api.py index fdee1643..9d9bdb4f 100644 --- a/koyeb/api/api/catalog_instances_api.py +++ b/koyeb/api/api/catalog_instances_api.py @@ -1,16 +1,15 @@ -# coding: utf-8 - """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 + import warnings from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt from typing import Any, Dict, List, Optional, Tuple, Union @@ -39,6 +38,7 @@ def __init__(self, api_client=None) -> None: api_client = ApiClient.get_default() self.api_client = api_client + @validate_call def get_catalog_instance( self, @@ -47,8 +47,9 @@ def get_catalog_instance( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -80,21 +81,22 @@ def get_catalog_instance( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._get_catalog_instance_serialize( id=id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "GetCatalogInstanceReply", + '200': "GetCatalogInstanceReply", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -102,6 +104,7 @@ def get_catalog_instance( response_types_map=_response_types_map, ).data + @validate_call def get_catalog_instance_with_http_info( self, @@ -110,8 +113,9 @@ def get_catalog_instance_with_http_info( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -143,21 +147,22 @@ def get_catalog_instance_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._get_catalog_instance_serialize( id=id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "GetCatalogInstanceReply", + '200': "GetCatalogInstanceReply", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -165,6 +170,7 @@ def get_catalog_instance_with_http_info( response_types_map=_response_types_map, ) + @validate_call def get_catalog_instance_without_preload_content( self, @@ -173,8 +179,9 @@ def get_catalog_instance_without_preload_content( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -206,24 +213,26 @@ def get_catalog_instance_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._get_catalog_instance_serialize( id=id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "GetCatalogInstanceReply", + '200': "GetCatalogInstanceReply", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) return response_data.response + def _get_catalog_instance_serialize( self, id, @@ -235,7 +244,8 @@ def _get_catalog_instance_serialize( _host = None - _collection_formats: Dict[str, str] = {} + _collection_formats: Dict[str, str] = { + } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -248,22 +258,30 @@ def _get_catalog_instance_serialize( # process the path parameters if id is not None: - _path_params["id"] = id + _path_params['id'] = id # process the query parameters # process the header parameters # process the form parameters # process the body parameter + # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept(["*/*"]) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + '*/*' + ] + ) + # authentication setting - _auth_settings: List[str] = ["Bearer"] + _auth_settings: List[str] = [ + 'Bearer' + ] return self.api_client.param_serialize( - method="GET", - resource_path="/v1/catalog/instances/{id}", + method='GET', + resource_path='/v1/catalog/instances/{id}', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -273,29 +291,25 @@ def _get_catalog_instance_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth, + _request_auth=_request_auth ) + + + @validate_call def list_catalog_instances( self, - limit: Annotated[ - Optional[StrictStr], - Field(description="(Optional) The number of items to return"), - ] = None, - offset: Annotated[ - Optional[StrictStr], - Field(description="(Optional) The offset in the list of item to return"), - ] = None, - id: Annotated[ - Optional[StrictStr], Field(description="(Optional) A filter for instances") - ] = None, + limit: Annotated[Optional[StrictStr], Field(description="(Optional) The number of items to return")] = None, + offset: Annotated[Optional[StrictStr], Field(description="(Optional) The offset in the list of item to return")] = None, + id: Annotated[Optional[StrictStr], Field(description="(Optional) A filter for instances")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -331,7 +345,7 @@ def list_catalog_instances( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._list_catalog_instances_serialize( limit=limit, @@ -340,14 +354,15 @@ def list_catalog_instances( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ListCatalogInstancesReply", + '200': "ListCatalogInstancesReply", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -355,26 +370,20 @@ def list_catalog_instances( response_types_map=_response_types_map, ).data + @validate_call def list_catalog_instances_with_http_info( self, - limit: Annotated[ - Optional[StrictStr], - Field(description="(Optional) The number of items to return"), - ] = None, - offset: Annotated[ - Optional[StrictStr], - Field(description="(Optional) The offset in the list of item to return"), - ] = None, - id: Annotated[ - Optional[StrictStr], Field(description="(Optional) A filter for instances") - ] = None, + limit: Annotated[Optional[StrictStr], Field(description="(Optional) The number of items to return")] = None, + offset: Annotated[Optional[StrictStr], Field(description="(Optional) The offset in the list of item to return")] = None, + id: Annotated[Optional[StrictStr], Field(description="(Optional) A filter for instances")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -410,7 +419,7 @@ def list_catalog_instances_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._list_catalog_instances_serialize( limit=limit, @@ -419,14 +428,15 @@ def list_catalog_instances_with_http_info( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ListCatalogInstancesReply", + '200': "ListCatalogInstancesReply", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -434,26 +444,20 @@ def list_catalog_instances_with_http_info( response_types_map=_response_types_map, ) + @validate_call def list_catalog_instances_without_preload_content( self, - limit: Annotated[ - Optional[StrictStr], - Field(description="(Optional) The number of items to return"), - ] = None, - offset: Annotated[ - Optional[StrictStr], - Field(description="(Optional) The offset in the list of item to return"), - ] = None, - id: Annotated[ - Optional[StrictStr], Field(description="(Optional) A filter for instances") - ] = None, + limit: Annotated[Optional[StrictStr], Field(description="(Optional) The number of items to return")] = None, + offset: Annotated[Optional[StrictStr], Field(description="(Optional) The offset in the list of item to return")] = None, + id: Annotated[Optional[StrictStr], Field(description="(Optional) A filter for instances")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -489,7 +493,7 @@ def list_catalog_instances_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._list_catalog_instances_serialize( limit=limit, @@ -498,17 +502,19 @@ def list_catalog_instances_without_preload_content( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ListCatalogInstancesReply", + '200': "ListCatalogInstancesReply", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) return response_data.response + def _list_catalog_instances_serialize( self, limit, @@ -522,7 +528,8 @@ def _list_catalog_instances_serialize( _host = None - _collection_formats: Dict[str, str] = {} + _collection_formats: Dict[str, str] = { + } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -536,31 +543,39 @@ def _list_catalog_instances_serialize( # process the path parameters # process the query parameters if limit is not None: - - _query_params.append(("limit", limit)) - + + _query_params.append(('limit', limit)) + if offset is not None: - - _query_params.append(("offset", offset)) - + + _query_params.append(('offset', offset)) + if id is not None: - - _query_params.append(("id", id)) - + + _query_params.append(('id', id)) + # process the header parameters # process the form parameters # process the body parameter + # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept(["*/*"]) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + '*/*' + ] + ) + # authentication setting - _auth_settings: List[str] = ["Bearer"] + _auth_settings: List[str] = [ + 'Bearer' + ] return self.api_client.param_serialize( - method="GET", - resource_path="/v1/catalog/instances", + method='GET', + resource_path='/v1/catalog/instances', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -570,5 +585,7 @@ def _list_catalog_instances_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth, + _request_auth=_request_auth ) + + diff --git a/koyeb/api/api/catalog_regions_api.py b/koyeb/api/api/catalog_regions_api.py index 6aa5a385..4a898fc0 100644 --- a/koyeb/api/api/catalog_regions_api.py +++ b/koyeb/api/api/catalog_regions_api.py @@ -1,16 +1,15 @@ -# coding: utf-8 - """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 + import warnings from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt from typing import Any, Dict, List, Optional, Tuple, Union @@ -39,6 +38,7 @@ def __init__(self, api_client=None) -> None: api_client = ApiClient.get_default() self.api_client = api_client + @validate_call def get_region( self, @@ -47,8 +47,9 @@ def get_region( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -80,21 +81,22 @@ def get_region( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._get_region_serialize( id=id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "GetRegionReply", + '200': "GetRegionReply", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -102,6 +104,7 @@ def get_region( response_types_map=_response_types_map, ).data + @validate_call def get_region_with_http_info( self, @@ -110,8 +113,9 @@ def get_region_with_http_info( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -143,21 +147,22 @@ def get_region_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._get_region_serialize( id=id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "GetRegionReply", + '200': "GetRegionReply", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -165,6 +170,7 @@ def get_region_with_http_info( response_types_map=_response_types_map, ) + @validate_call def get_region_without_preload_content( self, @@ -173,8 +179,9 @@ def get_region_without_preload_content( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -206,24 +213,26 @@ def get_region_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._get_region_serialize( id=id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "GetRegionReply", + '200': "GetRegionReply", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) return response_data.response + def _get_region_serialize( self, id, @@ -235,7 +244,8 @@ def _get_region_serialize( _host = None - _collection_formats: Dict[str, str] = {} + _collection_formats: Dict[str, str] = { + } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -248,22 +258,30 @@ def _get_region_serialize( # process the path parameters if id is not None: - _path_params["id"] = id + _path_params['id'] = id # process the query parameters # process the header parameters # process the form parameters # process the body parameter + # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept(["*/*"]) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + '*/*' + ] + ) + # authentication setting - _auth_settings: List[str] = ["Bearer"] + _auth_settings: List[str] = [ + 'Bearer' + ] return self.api_client.param_serialize( - method="GET", - resource_path="/v1/catalog/regions/{id}", + method='GET', + resource_path='/v1/catalog/regions/{id}', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -273,29 +291,25 @@ def _get_region_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth, + _request_auth=_request_auth ) + + + @validate_call def list_regions( self, - limit: Annotated[ - Optional[StrictStr], - Field(description="(Optional) The number of items to return"), - ] = None, - offset: Annotated[ - Optional[StrictStr], - Field(description="(Optional) The offset in the list of item to return"), - ] = None, - id: Annotated[ - Optional[StrictStr], Field(description="(Optional) A filter for regions") - ] = None, + limit: Annotated[Optional[StrictStr], Field(description="(Optional) The number of items to return")] = None, + offset: Annotated[Optional[StrictStr], Field(description="(Optional) The offset in the list of item to return")] = None, + id: Annotated[Optional[StrictStr], Field(description="(Optional) A filter for regions")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -331,7 +345,7 @@ def list_regions( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._list_regions_serialize( limit=limit, @@ -340,14 +354,15 @@ def list_regions( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ListRegionsReply", + '200': "ListRegionsReply", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -355,26 +370,20 @@ def list_regions( response_types_map=_response_types_map, ).data + @validate_call def list_regions_with_http_info( self, - limit: Annotated[ - Optional[StrictStr], - Field(description="(Optional) The number of items to return"), - ] = None, - offset: Annotated[ - Optional[StrictStr], - Field(description="(Optional) The offset in the list of item to return"), - ] = None, - id: Annotated[ - Optional[StrictStr], Field(description="(Optional) A filter for regions") - ] = None, + limit: Annotated[Optional[StrictStr], Field(description="(Optional) The number of items to return")] = None, + offset: Annotated[Optional[StrictStr], Field(description="(Optional) The offset in the list of item to return")] = None, + id: Annotated[Optional[StrictStr], Field(description="(Optional) A filter for regions")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -410,7 +419,7 @@ def list_regions_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._list_regions_serialize( limit=limit, @@ -419,14 +428,15 @@ def list_regions_with_http_info( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ListRegionsReply", + '200': "ListRegionsReply", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -434,26 +444,20 @@ def list_regions_with_http_info( response_types_map=_response_types_map, ) + @validate_call def list_regions_without_preload_content( self, - limit: Annotated[ - Optional[StrictStr], - Field(description="(Optional) The number of items to return"), - ] = None, - offset: Annotated[ - Optional[StrictStr], - Field(description="(Optional) The offset in the list of item to return"), - ] = None, - id: Annotated[ - Optional[StrictStr], Field(description="(Optional) A filter for regions") - ] = None, + limit: Annotated[Optional[StrictStr], Field(description="(Optional) The number of items to return")] = None, + offset: Annotated[Optional[StrictStr], Field(description="(Optional) The offset in the list of item to return")] = None, + id: Annotated[Optional[StrictStr], Field(description="(Optional) A filter for regions")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -489,7 +493,7 @@ def list_regions_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._list_regions_serialize( limit=limit, @@ -498,17 +502,19 @@ def list_regions_without_preload_content( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ListRegionsReply", + '200': "ListRegionsReply", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) return response_data.response + def _list_regions_serialize( self, limit, @@ -522,7 +528,8 @@ def _list_regions_serialize( _host = None - _collection_formats: Dict[str, str] = {} + _collection_formats: Dict[str, str] = { + } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -536,31 +543,39 @@ def _list_regions_serialize( # process the path parameters # process the query parameters if limit is not None: - - _query_params.append(("limit", limit)) - + + _query_params.append(('limit', limit)) + if offset is not None: - - _query_params.append(("offset", offset)) - + + _query_params.append(('offset', offset)) + if id is not None: - - _query_params.append(("id", id)) - + + _query_params.append(('id', id)) + # process the header parameters # process the form parameters # process the body parameter + # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept(["*/*"]) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + '*/*' + ] + ) + # authentication setting - _auth_settings: List[str] = ["Bearer"] + _auth_settings: List[str] = [ + 'Bearer' + ] return self.api_client.param_serialize( - method="GET", - resource_path="/v1/catalog/regions", + method='GET', + resource_path='/v1/catalog/regions', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -570,5 +585,7 @@ def _list_regions_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth, + _request_auth=_request_auth ) + + diff --git a/koyeb/api/api/compose_api.py b/koyeb/api/api/compose_api.py index 0d62aa8e..90750e64 100644 --- a/koyeb/api/api/compose_api.py +++ b/koyeb/api/api/compose_api.py @@ -1,16 +1,15 @@ -# coding: utf-8 - """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 + import warnings from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt from typing import Any, Dict, List, Optional, Tuple, Union @@ -36,6 +35,7 @@ def __init__(self, api_client=None) -> None: api_client = ApiClient.get_default() self.api_client = api_client + @validate_call def compose( self, @@ -44,8 +44,9 @@ def compose( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -77,27 +78,28 @@ def compose( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._compose_serialize( compose=compose, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ComposeReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "ComposeReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -105,6 +107,7 @@ def compose( response_types_map=_response_types_map, ).data + @validate_call def compose_with_http_info( self, @@ -113,8 +116,9 @@ def compose_with_http_info( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -146,27 +150,28 @@ def compose_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._compose_serialize( compose=compose, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ComposeReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "ComposeReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -174,6 +179,7 @@ def compose_with_http_info( response_types_map=_response_types_map, ) + @validate_call def compose_without_preload_content( self, @@ -182,8 +188,9 @@ def compose_without_preload_content( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -215,30 +222,32 @@ def compose_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._compose_serialize( compose=compose, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ComposeReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "ComposeReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) return response_data.response + def _compose_serialize( self, compose, @@ -250,7 +259,8 @@ def _compose_serialize( _host = None - _collection_formats: Dict[str, str] = {} + _collection_formats: Dict[str, str] = { + } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -269,16 +279,24 @@ def _compose_serialize( if compose is not None: _body_params = compose + # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept(["*/*"]) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + '*/*' + ] + ) + # authentication setting - _auth_settings: List[str] = ["Bearer"] + _auth_settings: List[str] = [ + 'Bearer' + ] return self.api_client.param_serialize( - method="POST", - resource_path="/v1/compose", + method='POST', + resource_path='/v1/compose', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -288,5 +306,7 @@ def _compose_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth, + _request_auth=_request_auth ) + + diff --git a/koyeb/api/api/coupons_api.py b/koyeb/api/api/coupons_api.py index afbf2035..9f27766a 100644 --- a/koyeb/api/api/coupons_api.py +++ b/koyeb/api/api/coupons_api.py @@ -1,22 +1,23 @@ -# coding: utf-8 - """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 + import warnings from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt from typing import Any, Dict, List, Optional, Tuple, Union from typing_extensions import Annotated +from pydantic import StrictStr from typing import Any, Dict +from koyeb.api.models.check_coupon_reply import CheckCouponReply from koyeb.api.models.redeem_coupon_request import RedeemCouponRequest from koyeb.api.api_client import ApiClient, RequestSerialized @@ -36,6 +37,286 @@ def __init__(self, api_client=None) -> None: api_client = ApiClient.get_default() self.api_client = api_client + + @validate_call + def check_coupon( + self, + code: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> CheckCouponReply: + """Check Coupon + + This API allows to check if a given coupon is valid. It is heavily rate-limited. + + :param code: (required) + :type code: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._check_coupon_serialize( + code=code, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CheckCouponReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def check_coupon_with_http_info( + self, + code: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[CheckCouponReply]: + """Check Coupon + + This API allows to check if a given coupon is valid. It is heavily rate-limited. + + :param code: (required) + :type code: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._check_coupon_serialize( + code=code, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CheckCouponReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def check_coupon_without_preload_content( + self, + code: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Check Coupon + + This API allows to check if a given coupon is valid. It is heavily rate-limited. + + :param code: (required) + :type code: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._check_coupon_serialize( + code=code, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CheckCouponReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _check_coupon_serialize( + self, + code, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if code is not None: + _path_params['code'] = code + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + '*/*' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'Bearer' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/v1/coupons/{code}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + @validate_call def redeem_coupon( self, @@ -44,8 +325,9 @@ def redeem_coupon( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -78,27 +360,28 @@ def redeem_coupon( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._redeem_coupon_serialize( body=body, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "object", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "object", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -106,6 +389,7 @@ def redeem_coupon( response_types_map=_response_types_map, ).data + @validate_call def redeem_coupon_with_http_info( self, @@ -114,8 +398,9 @@ def redeem_coupon_with_http_info( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -148,27 +433,28 @@ def redeem_coupon_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._redeem_coupon_serialize( body=body, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "object", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "object", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -176,6 +462,7 @@ def redeem_coupon_with_http_info( response_types_map=_response_types_map, ) + @validate_call def redeem_coupon_without_preload_content( self, @@ -184,8 +471,9 @@ def redeem_coupon_without_preload_content( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -218,30 +506,32 @@ def redeem_coupon_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._redeem_coupon_serialize( body=body, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "object", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "object", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) return response_data.response + def _redeem_coupon_serialize( self, body, @@ -253,7 +543,8 @@ def _redeem_coupon_serialize( _host = None - _collection_formats: Dict[str, str] = {} + _collection_formats: Dict[str, str] = { + } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -272,16 +563,24 @@ def _redeem_coupon_serialize( if body is not None: _body_params = body + # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept(["*/*"]) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + '*/*' + ] + ) + # authentication setting - _auth_settings: List[str] = ["Bearer"] + _auth_settings: List[str] = [ + 'Bearer' + ] return self.api_client.param_serialize( - method="POST", - resource_path="/v1/coupons", + method='POST', + resource_path='/v1/coupons', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -291,5 +590,7 @@ def _redeem_coupon_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth, + _request_auth=_request_auth ) + + diff --git a/koyeb/api/api/credentials_api.py b/koyeb/api/api/credentials_api.py index e1d7e609..a06aa533 100644 --- a/koyeb/api/api/credentials_api.py +++ b/koyeb/api/api/credentials_api.py @@ -1,16 +1,15 @@ -# coding: utf-8 - """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 + import warnings from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt from typing import Any, Dict, List, Optional, Tuple, Union @@ -43,6 +42,7 @@ def __init__(self, api_client=None) -> None: api_client = ApiClient.get_default() self.api_client = api_client + @validate_call def create_credential( self, @@ -51,8 +51,9 @@ def create_credential( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -84,27 +85,28 @@ def create_credential( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._create_credential_serialize( credential=credential, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "CreateCredentialReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "CreateCredentialReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -112,6 +114,7 @@ def create_credential( response_types_map=_response_types_map, ).data + @validate_call def create_credential_with_http_info( self, @@ -120,8 +123,9 @@ def create_credential_with_http_info( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -153,27 +157,28 @@ def create_credential_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._create_credential_serialize( credential=credential, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "CreateCredentialReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "CreateCredentialReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -181,6 +186,7 @@ def create_credential_with_http_info( response_types_map=_response_types_map, ) + @validate_call def create_credential_without_preload_content( self, @@ -189,8 +195,9 @@ def create_credential_without_preload_content( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -222,30 +229,32 @@ def create_credential_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._create_credential_serialize( credential=credential, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "CreateCredentialReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "CreateCredentialReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) return response_data.response + def _create_credential_serialize( self, credential, @@ -257,7 +266,8 @@ def _create_credential_serialize( _host = None - _collection_formats: Dict[str, str] = {} + _collection_formats: Dict[str, str] = { + } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -276,16 +286,24 @@ def _create_credential_serialize( if credential is not None: _body_params = credential + # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept(["*/*"]) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + '*/*' + ] + ) + # authentication setting - _auth_settings: List[str] = ["Bearer"] + _auth_settings: List[str] = [ + 'Bearer' + ] return self.api_client.param_serialize( - method="POST", - resource_path="/v1/credentials", + method='POST', + resource_path='/v1/credentials', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -295,9 +313,12 @@ def _create_credential_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth, + _request_auth=_request_auth ) + + + @validate_call def delete_credential( self, @@ -306,8 +327,9 @@ def delete_credential( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -339,27 +361,28 @@ def delete_credential( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._delete_credential_serialize( id=id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "object", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "object", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -367,6 +390,7 @@ def delete_credential( response_types_map=_response_types_map, ).data + @validate_call def delete_credential_with_http_info( self, @@ -375,8 +399,9 @@ def delete_credential_with_http_info( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -408,27 +433,28 @@ def delete_credential_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._delete_credential_serialize( id=id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "object", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "object", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -436,6 +462,7 @@ def delete_credential_with_http_info( response_types_map=_response_types_map, ) + @validate_call def delete_credential_without_preload_content( self, @@ -444,8 +471,9 @@ def delete_credential_without_preload_content( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -477,30 +505,32 @@ def delete_credential_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._delete_credential_serialize( id=id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "object", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "object", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) return response_data.response + def _delete_credential_serialize( self, id, @@ -512,7 +542,8 @@ def _delete_credential_serialize( _host = None - _collection_formats: Dict[str, str] = {} + _collection_formats: Dict[str, str] = { + } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -525,22 +556,30 @@ def _delete_credential_serialize( # process the path parameters if id is not None: - _path_params["id"] = id + _path_params['id'] = id # process the query parameters # process the header parameters # process the form parameters # process the body parameter + # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept(["*/*"]) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + '*/*' + ] + ) + # authentication setting - _auth_settings: List[str] = ["Bearer"] + _auth_settings: List[str] = [ + 'Bearer' + ] return self.api_client.param_serialize( - method="DELETE", - resource_path="/v1/credentials/{id}", + method='DELETE', + resource_path='/v1/credentials/{id}', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -550,9 +589,12 @@ def _delete_credential_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth, + _request_auth=_request_auth ) + + + @validate_call def get_credential( self, @@ -561,8 +603,9 @@ def get_credential( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -594,27 +637,28 @@ def get_credential( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._get_credential_serialize( id=id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "GetCredentialReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "GetCredentialReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -622,6 +666,7 @@ def get_credential( response_types_map=_response_types_map, ).data + @validate_call def get_credential_with_http_info( self, @@ -630,8 +675,9 @@ def get_credential_with_http_info( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -663,27 +709,28 @@ def get_credential_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._get_credential_serialize( id=id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "GetCredentialReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "GetCredentialReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -691,6 +738,7 @@ def get_credential_with_http_info( response_types_map=_response_types_map, ) + @validate_call def get_credential_without_preload_content( self, @@ -699,8 +747,9 @@ def get_credential_without_preload_content( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -732,30 +781,32 @@ def get_credential_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._get_credential_serialize( id=id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "GetCredentialReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "GetCredentialReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) return response_data.response + def _get_credential_serialize( self, id, @@ -767,7 +818,8 @@ def _get_credential_serialize( _host = None - _collection_formats: Dict[str, str] = {} + _collection_formats: Dict[str, str] = { + } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -780,22 +832,30 @@ def _get_credential_serialize( # process the path parameters if id is not None: - _path_params["id"] = id + _path_params['id'] = id # process the query parameters # process the header parameters # process the form parameters # process the body parameter + # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept(["*/*"]) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + '*/*' + ] + ) + # authentication setting - _auth_settings: List[str] = ["Bearer"] + _auth_settings: List[str] = [ + 'Bearer' + ] return self.api_client.param_serialize( - method="GET", - resource_path="/v1/credentials/{id}", + method='GET', + resource_path='/v1/credentials/{id}', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -805,39 +865,28 @@ def _get_credential_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth, + _request_auth=_request_auth ) + + + @validate_call def list_credentials( self, - type: Annotated[ - Optional[StrictStr], Field(description="(Optional) A filter for type") - ] = None, - name: Annotated[ - Optional[StrictStr], Field(description="(Optional) A filter for name") - ] = None, - organization_id: Annotated[ - Optional[StrictStr], - Field(description="(Optional) Filter for an organization"), - ] = None, - user_id: Annotated[ - Optional[StrictStr], Field(description="(Optional) Filter for an user") - ] = None, - limit: Annotated[ - Optional[StrictStr], - Field(description="(Optional) The number of items to return"), - ] = None, - offset: Annotated[ - Optional[StrictStr], - Field(description="(Optional) The offset in the list of item to return"), - ] = None, + type: Annotated[Optional[StrictStr], Field(description="(Optional) A filter for type")] = None, + name: Annotated[Optional[StrictStr], Field(description="(Optional) A filter for name")] = None, + organization_id: Annotated[Optional[StrictStr], Field(description="(Optional) Filter for an organization")] = None, + user_id: Annotated[Optional[StrictStr], Field(description="(Optional) Filter for an user")] = None, + limit: Annotated[Optional[StrictStr], Field(description="(Optional) The number of items to return")] = None, + offset: Annotated[Optional[StrictStr], Field(description="(Optional) The offset in the list of item to return")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -879,7 +928,7 @@ def list_credentials( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._list_credentials_serialize( type=type, @@ -891,20 +940,21 @@ def list_credentials( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ListCredentialsReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "ListCredentialsReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -912,36 +962,23 @@ def list_credentials( response_types_map=_response_types_map, ).data + @validate_call def list_credentials_with_http_info( self, - type: Annotated[ - Optional[StrictStr], Field(description="(Optional) A filter for type") - ] = None, - name: Annotated[ - Optional[StrictStr], Field(description="(Optional) A filter for name") - ] = None, - organization_id: Annotated[ - Optional[StrictStr], - Field(description="(Optional) Filter for an organization"), - ] = None, - user_id: Annotated[ - Optional[StrictStr], Field(description="(Optional) Filter for an user") - ] = None, - limit: Annotated[ - Optional[StrictStr], - Field(description="(Optional) The number of items to return"), - ] = None, - offset: Annotated[ - Optional[StrictStr], - Field(description="(Optional) The offset in the list of item to return"), - ] = None, + type: Annotated[Optional[StrictStr], Field(description="(Optional) A filter for type")] = None, + name: Annotated[Optional[StrictStr], Field(description="(Optional) A filter for name")] = None, + organization_id: Annotated[Optional[StrictStr], Field(description="(Optional) Filter for an organization")] = None, + user_id: Annotated[Optional[StrictStr], Field(description="(Optional) Filter for an user")] = None, + limit: Annotated[Optional[StrictStr], Field(description="(Optional) The number of items to return")] = None, + offset: Annotated[Optional[StrictStr], Field(description="(Optional) The offset in the list of item to return")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -983,7 +1020,7 @@ def list_credentials_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._list_credentials_serialize( type=type, @@ -995,20 +1032,21 @@ def list_credentials_with_http_info( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ListCredentialsReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "ListCredentialsReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -1016,36 +1054,23 @@ def list_credentials_with_http_info( response_types_map=_response_types_map, ) + @validate_call def list_credentials_without_preload_content( self, - type: Annotated[ - Optional[StrictStr], Field(description="(Optional) A filter for type") - ] = None, - name: Annotated[ - Optional[StrictStr], Field(description="(Optional) A filter for name") - ] = None, - organization_id: Annotated[ - Optional[StrictStr], - Field(description="(Optional) Filter for an organization"), - ] = None, - user_id: Annotated[ - Optional[StrictStr], Field(description="(Optional) Filter for an user") - ] = None, - limit: Annotated[ - Optional[StrictStr], - Field(description="(Optional) The number of items to return"), - ] = None, - offset: Annotated[ - Optional[StrictStr], - Field(description="(Optional) The offset in the list of item to return"), - ] = None, + type: Annotated[Optional[StrictStr], Field(description="(Optional) A filter for type")] = None, + name: Annotated[Optional[StrictStr], Field(description="(Optional) A filter for name")] = None, + organization_id: Annotated[Optional[StrictStr], Field(description="(Optional) Filter for an organization")] = None, + user_id: Annotated[Optional[StrictStr], Field(description="(Optional) Filter for an user")] = None, + limit: Annotated[Optional[StrictStr], Field(description="(Optional) The number of items to return")] = None, + offset: Annotated[Optional[StrictStr], Field(description="(Optional) The offset in the list of item to return")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -1087,7 +1112,7 @@ def list_credentials_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._list_credentials_serialize( type=type, @@ -1099,23 +1124,25 @@ def list_credentials_without_preload_content( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ListCredentialsReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "ListCredentialsReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) return response_data.response + def _list_credentials_serialize( self, type, @@ -1132,7 +1159,8 @@ def _list_credentials_serialize( _host = None - _collection_formats: Dict[str, str] = {} + _collection_formats: Dict[str, str] = { + } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -1146,43 +1174,51 @@ def _list_credentials_serialize( # process the path parameters # process the query parameters if type is not None: - - _query_params.append(("type", type)) - + + _query_params.append(('type', type)) + if name is not None: - - _query_params.append(("name", name)) - + + _query_params.append(('name', name)) + if organization_id is not None: - - _query_params.append(("organization_id", organization_id)) - + + _query_params.append(('organization_id', organization_id)) + if user_id is not None: - - _query_params.append(("user_id", user_id)) - + + _query_params.append(('user_id', user_id)) + if limit is not None: - - _query_params.append(("limit", limit)) - + + _query_params.append(('limit', limit)) + if offset is not None: - - _query_params.append(("offset", offset)) - + + _query_params.append(('offset', offset)) + # process the header parameters # process the form parameters # process the body parameter + # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept(["*/*"]) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + '*/*' + ] + ) + # authentication setting - _auth_settings: List[str] = ["Bearer"] + _auth_settings: List[str] = [ + 'Bearer' + ] return self.api_client.param_serialize( - method="GET", - resource_path="/v1/credentials", + method='GET', + resource_path='/v1/credentials', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -1192,9 +1228,12 @@ def _list_credentials_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth, + _request_auth=_request_auth ) + + + @validate_call def update_credential( self, @@ -1205,8 +1244,9 @@ def update_credential( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -1242,7 +1282,7 @@ def update_credential( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._update_credential_serialize( id=id, @@ -1251,20 +1291,21 @@ def update_credential( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "UpdateCredentialReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "UpdateCredentialReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -1272,6 +1313,7 @@ def update_credential( response_types_map=_response_types_map, ).data + @validate_call def update_credential_with_http_info( self, @@ -1282,8 +1324,9 @@ def update_credential_with_http_info( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -1319,7 +1362,7 @@ def update_credential_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._update_credential_serialize( id=id, @@ -1328,20 +1371,21 @@ def update_credential_with_http_info( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "UpdateCredentialReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "UpdateCredentialReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -1349,6 +1393,7 @@ def update_credential_with_http_info( response_types_map=_response_types_map, ) + @validate_call def update_credential_without_preload_content( self, @@ -1359,8 +1404,9 @@ def update_credential_without_preload_content( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -1396,7 +1442,7 @@ def update_credential_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._update_credential_serialize( id=id, @@ -1405,23 +1451,25 @@ def update_credential_without_preload_content( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "UpdateCredentialReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "UpdateCredentialReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) return response_data.response + def _update_credential_serialize( self, id, @@ -1435,7 +1483,8 @@ def _update_credential_serialize( _host = None - _collection_formats: Dict[str, str] = {} + _collection_formats: Dict[str, str] = { + } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -1448,28 +1497,36 @@ def _update_credential_serialize( # process the path parameters if id is not None: - _path_params["id"] = id + _path_params['id'] = id # process the query parameters if update_mask is not None: - - _query_params.append(("update_mask", update_mask)) - + + _query_params.append(('update_mask', update_mask)) + # process the header parameters # process the form parameters # process the body parameter if credential is not None: _body_params = credential + # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept(["*/*"]) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + '*/*' + ] + ) + # authentication setting - _auth_settings: List[str] = ["Bearer"] + _auth_settings: List[str] = [ + 'Bearer' + ] return self.api_client.param_serialize( - method="PUT", - resource_path="/v1/credentials/{id}", + method='PUT', + resource_path='/v1/credentials/{id}', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -1479,9 +1536,12 @@ def _update_credential_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth, + _request_auth=_request_auth ) + + + @validate_call def update_credential2( self, @@ -1492,8 +1552,9 @@ def update_credential2( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -1529,7 +1590,7 @@ def update_credential2( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._update_credential2_serialize( id=id, @@ -1538,20 +1599,21 @@ def update_credential2( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "UpdateCredentialReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "UpdateCredentialReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -1559,6 +1621,7 @@ def update_credential2( response_types_map=_response_types_map, ).data + @validate_call def update_credential2_with_http_info( self, @@ -1569,8 +1632,9 @@ def update_credential2_with_http_info( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -1606,7 +1670,7 @@ def update_credential2_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._update_credential2_serialize( id=id, @@ -1615,20 +1679,21 @@ def update_credential2_with_http_info( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "UpdateCredentialReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "UpdateCredentialReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -1636,6 +1701,7 @@ def update_credential2_with_http_info( response_types_map=_response_types_map, ) + @validate_call def update_credential2_without_preload_content( self, @@ -1646,8 +1712,9 @@ def update_credential2_without_preload_content( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -1683,7 +1750,7 @@ def update_credential2_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._update_credential2_serialize( id=id, @@ -1692,23 +1759,25 @@ def update_credential2_without_preload_content( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "UpdateCredentialReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "UpdateCredentialReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) return response_data.response + def _update_credential2_serialize( self, id, @@ -1722,7 +1791,8 @@ def _update_credential2_serialize( _host = None - _collection_formats: Dict[str, str] = {} + _collection_formats: Dict[str, str] = { + } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -1735,28 +1805,36 @@ def _update_credential2_serialize( # process the path parameters if id is not None: - _path_params["id"] = id + _path_params['id'] = id # process the query parameters if update_mask is not None: - - _query_params.append(("update_mask", update_mask)) - + + _query_params.append(('update_mask', update_mask)) + # process the header parameters # process the form parameters # process the body parameter if credential is not None: _body_params = credential + # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept(["*/*"]) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + '*/*' + ] + ) + # authentication setting - _auth_settings: List[str] = ["Bearer"] + _auth_settings: List[str] = [ + 'Bearer' + ] return self.api_client.param_serialize( - method="PATCH", - resource_path="/v1/credentials/{id}", + method='PATCH', + resource_path='/v1/credentials/{id}', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -1766,5 +1844,7 @@ def _update_credential2_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth, + _request_auth=_request_auth ) + + diff --git a/koyeb/api/api/deployments_api.py b/koyeb/api/api/deployments_api.py index 8468494c..f03f8bd6 100644 --- a/koyeb/api/api/deployments_api.py +++ b/koyeb/api/api/deployments_api.py @@ -1,16 +1,15 @@ -# coding: utf-8 - """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 + import warnings from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt from typing import Any, Dict, List, Optional, Tuple, Union @@ -41,18 +40,18 @@ def __init__(self, api_client=None) -> None: api_client = ApiClient.get_default() self.api_client = api_client + @validate_call def cancel_deployment( self, - id: Annotated[ - StrictStr, Field(description="The id of the deployment to cancel.") - ], + id: Annotated[StrictStr, Field(description="The id of the deployment to cancel.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -85,27 +84,28 @@ def cancel_deployment( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._cancel_deployment_serialize( id=id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "object", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "object", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -113,18 +113,18 @@ def cancel_deployment( response_types_map=_response_types_map, ).data + @validate_call def cancel_deployment_with_http_info( self, - id: Annotated[ - StrictStr, Field(description="The id of the deployment to cancel.") - ], + id: Annotated[StrictStr, Field(description="The id of the deployment to cancel.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -157,27 +157,28 @@ def cancel_deployment_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._cancel_deployment_serialize( id=id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "object", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "object", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -185,18 +186,18 @@ def cancel_deployment_with_http_info( response_types_map=_response_types_map, ) + @validate_call def cancel_deployment_without_preload_content( self, - id: Annotated[ - StrictStr, Field(description="The id of the deployment to cancel.") - ], + id: Annotated[StrictStr, Field(description="The id of the deployment to cancel.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -229,30 +230,32 @@ def cancel_deployment_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._cancel_deployment_serialize( id=id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "object", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "object", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) return response_data.response + def _cancel_deployment_serialize( self, id, @@ -264,7 +267,8 @@ def _cancel_deployment_serialize( _host = None - _collection_formats: Dict[str, str] = {} + _collection_formats: Dict[str, str] = { + } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -277,22 +281,30 @@ def _cancel_deployment_serialize( # process the path parameters if id is not None: - _path_params["id"] = id + _path_params['id'] = id # process the query parameters # process the header parameters # process the form parameters # process the body parameter + # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept(["*/*"]) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + '*/*' + ] + ) + # authentication setting - _auth_settings: List[str] = ["Bearer"] + _auth_settings: List[str] = [ + 'Bearer' + ] return self.api_client.param_serialize( - method="POST", - resource_path="/v1/deployments/{id}/cancel", + method='POST', + resource_path='/v1/deployments/{id}/cancel', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -302,9 +314,12 @@ def _cancel_deployment_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth, + _request_auth=_request_auth ) + + + @validate_call def get_deployment( self, @@ -313,8 +328,9 @@ def get_deployment( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -346,27 +362,28 @@ def get_deployment( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._get_deployment_serialize( id=id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "GetDeploymentReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "GetDeploymentReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -374,6 +391,7 @@ def get_deployment( response_types_map=_response_types_map, ).data + @validate_call def get_deployment_with_http_info( self, @@ -382,8 +400,9 @@ def get_deployment_with_http_info( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -415,27 +434,28 @@ def get_deployment_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._get_deployment_serialize( id=id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "GetDeploymentReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "GetDeploymentReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -443,6 +463,7 @@ def get_deployment_with_http_info( response_types_map=_response_types_map, ) + @validate_call def get_deployment_without_preload_content( self, @@ -451,8 +472,9 @@ def get_deployment_without_preload_content( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -484,30 +506,32 @@ def get_deployment_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._get_deployment_serialize( id=id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "GetDeploymentReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "GetDeploymentReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) return response_data.response + def _get_deployment_serialize( self, id, @@ -519,7 +543,8 @@ def _get_deployment_serialize( _host = None - _collection_formats: Dict[str, str] = {} + _collection_formats: Dict[str, str] = { + } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -532,22 +557,30 @@ def _get_deployment_serialize( # process the path parameters if id is not None: - _path_params["id"] = id + _path_params['id'] = id # process the query parameters # process the header parameters # process the form parameters # process the body parameter + # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept(["*/*"]) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + '*/*' + ] + ) + # authentication setting - _auth_settings: List[str] = ["Bearer"] + _auth_settings: List[str] = [ + 'Bearer' + ] return self.api_client.param_serialize( - method="GET", - resource_path="/v1/deployments/{id}", + method='GET', + resource_path='/v1/deployments/{id}', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -557,25 +590,25 @@ def _get_deployment_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth, + _request_auth=_request_auth ) + + + @validate_call def get_deployment_scaling( self, id: StrictStr, - region: Annotated[ - Optional[StrictStr], Field(description="(Optional) Filter on region") - ] = None, - replica_index: Annotated[ - Optional[StrictInt], Field(description="(Optional) Filter on replica_index") - ] = None, + region: Annotated[Optional[StrictStr], Field(description="(Optional) Filter on region")] = None, + replica_index: Annotated[Optional[StrictInt], Field(description="(Optional) Filter on replica_index")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -611,7 +644,7 @@ def get_deployment_scaling( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._get_deployment_scaling_serialize( id=id, @@ -620,20 +653,21 @@ def get_deployment_scaling( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "GetDeploymentScalingReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "GetDeploymentScalingReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -641,22 +675,20 @@ def get_deployment_scaling( response_types_map=_response_types_map, ).data + @validate_call def get_deployment_scaling_with_http_info( self, id: StrictStr, - region: Annotated[ - Optional[StrictStr], Field(description="(Optional) Filter on region") - ] = None, - replica_index: Annotated[ - Optional[StrictInt], Field(description="(Optional) Filter on replica_index") - ] = None, + region: Annotated[Optional[StrictStr], Field(description="(Optional) Filter on region")] = None, + replica_index: Annotated[Optional[StrictInt], Field(description="(Optional) Filter on replica_index")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -692,7 +724,7 @@ def get_deployment_scaling_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._get_deployment_scaling_serialize( id=id, @@ -701,20 +733,21 @@ def get_deployment_scaling_with_http_info( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "GetDeploymentScalingReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "GetDeploymentScalingReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -722,22 +755,20 @@ def get_deployment_scaling_with_http_info( response_types_map=_response_types_map, ) + @validate_call def get_deployment_scaling_without_preload_content( self, id: StrictStr, - region: Annotated[ - Optional[StrictStr], Field(description="(Optional) Filter on region") - ] = None, - replica_index: Annotated[ - Optional[StrictInt], Field(description="(Optional) Filter on replica_index") - ] = None, + region: Annotated[Optional[StrictStr], Field(description="(Optional) Filter on region")] = None, + replica_index: Annotated[Optional[StrictInt], Field(description="(Optional) Filter on replica_index")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -773,7 +804,7 @@ def get_deployment_scaling_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._get_deployment_scaling_serialize( id=id, @@ -782,23 +813,25 @@ def get_deployment_scaling_without_preload_content( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "GetDeploymentScalingReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "GetDeploymentScalingReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) return response_data.response + def _get_deployment_scaling_serialize( self, id, @@ -812,7 +845,8 @@ def _get_deployment_scaling_serialize( _host = None - _collection_formats: Dict[str, str] = {} + _collection_formats: Dict[str, str] = { + } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -825,30 +859,38 @@ def _get_deployment_scaling_serialize( # process the path parameters if id is not None: - _path_params["id"] = id + _path_params['id'] = id # process the query parameters if region is not None: - - _query_params.append(("region", region)) - + + _query_params.append(('region', region)) + if replica_index is not None: - - _query_params.append(("replica_index", replica_index)) - + + _query_params.append(('replica_index', replica_index)) + # process the header parameters # process the form parameters # process the body parameter + # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept(["*/*"]) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + '*/*' + ] + ) + # authentication setting - _auth_settings: List[str] = ["Bearer"] + _auth_settings: List[str] = [ + 'Bearer' + ] return self.api_client.param_serialize( - method="GET", - resource_path="/v1/deployment/{id}/scaling", + method='GET', + resource_path='/v1/deployment/{id}/scaling', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -858,39 +900,27 @@ def _get_deployment_scaling_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth, + _request_auth=_request_auth ) + + + @validate_call def list_deployment_events( self, - deployment_id: Annotated[ - Optional[StrictStr], Field(description="(Optional) Filter on deployment id") - ] = None, - types: Annotated[ - Optional[List[StrictStr]], - Field(description="(Optional) Filter on deployment event types"), - ] = None, - limit: Annotated[ - Optional[StrictStr], - Field(description="(Optional) The number of items to return"), - ] = None, - offset: Annotated[ - Optional[StrictStr], - Field(description="(Optional) The offset in the list of item to return"), - ] = None, - order: Annotated[ - Optional[StrictStr], - Field( - description="(Optional) Sorts the list in the ascending or the descending order" - ), - ] = None, + deployment_id: Annotated[Optional[StrictStr], Field(description="(Optional) Filter on deployment id")] = None, + types: Annotated[Optional[List[StrictStr]], Field(description="(Optional) Filter on deployment event types")] = None, + limit: Annotated[Optional[StrictStr], Field(description="(Optional) The number of items to return")] = None, + offset: Annotated[Optional[StrictStr], Field(description="(Optional) The offset in the list of item to return")] = None, + order: Annotated[Optional[StrictStr], Field(description="(Optional) Sorts the list in the ascending or the descending order")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -930,7 +960,7 @@ def list_deployment_events( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._list_deployment_events_serialize( deployment_id=deployment_id, @@ -941,20 +971,21 @@ def list_deployment_events( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ListDeploymentEventsReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "ListDeploymentEventsReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -962,36 +993,22 @@ def list_deployment_events( response_types_map=_response_types_map, ).data + @validate_call def list_deployment_events_with_http_info( self, - deployment_id: Annotated[ - Optional[StrictStr], Field(description="(Optional) Filter on deployment id") - ] = None, - types: Annotated[ - Optional[List[StrictStr]], - Field(description="(Optional) Filter on deployment event types"), - ] = None, - limit: Annotated[ - Optional[StrictStr], - Field(description="(Optional) The number of items to return"), - ] = None, - offset: Annotated[ - Optional[StrictStr], - Field(description="(Optional) The offset in the list of item to return"), - ] = None, - order: Annotated[ - Optional[StrictStr], - Field( - description="(Optional) Sorts the list in the ascending or the descending order" - ), - ] = None, + deployment_id: Annotated[Optional[StrictStr], Field(description="(Optional) Filter on deployment id")] = None, + types: Annotated[Optional[List[StrictStr]], Field(description="(Optional) Filter on deployment event types")] = None, + limit: Annotated[Optional[StrictStr], Field(description="(Optional) The number of items to return")] = None, + offset: Annotated[Optional[StrictStr], Field(description="(Optional) The offset in the list of item to return")] = None, + order: Annotated[Optional[StrictStr], Field(description="(Optional) Sorts the list in the ascending or the descending order")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -1031,7 +1048,7 @@ def list_deployment_events_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._list_deployment_events_serialize( deployment_id=deployment_id, @@ -1042,20 +1059,21 @@ def list_deployment_events_with_http_info( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ListDeploymentEventsReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "ListDeploymentEventsReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -1063,36 +1081,22 @@ def list_deployment_events_with_http_info( response_types_map=_response_types_map, ) + @validate_call def list_deployment_events_without_preload_content( self, - deployment_id: Annotated[ - Optional[StrictStr], Field(description="(Optional) Filter on deployment id") - ] = None, - types: Annotated[ - Optional[List[StrictStr]], - Field(description="(Optional) Filter on deployment event types"), - ] = None, - limit: Annotated[ - Optional[StrictStr], - Field(description="(Optional) The number of items to return"), - ] = None, - offset: Annotated[ - Optional[StrictStr], - Field(description="(Optional) The offset in the list of item to return"), - ] = None, - order: Annotated[ - Optional[StrictStr], - Field( - description="(Optional) Sorts the list in the ascending or the descending order" - ), - ] = None, + deployment_id: Annotated[Optional[StrictStr], Field(description="(Optional) Filter on deployment id")] = None, + types: Annotated[Optional[List[StrictStr]], Field(description="(Optional) Filter on deployment event types")] = None, + limit: Annotated[Optional[StrictStr], Field(description="(Optional) The number of items to return")] = None, + offset: Annotated[Optional[StrictStr], Field(description="(Optional) The offset in the list of item to return")] = None, + order: Annotated[Optional[StrictStr], Field(description="(Optional) Sorts the list in the ascending or the descending order")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -1132,7 +1136,7 @@ def list_deployment_events_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._list_deployment_events_serialize( deployment_id=deployment_id, @@ -1143,23 +1147,25 @@ def list_deployment_events_without_preload_content( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ListDeploymentEventsReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "ListDeploymentEventsReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) return response_data.response + def _list_deployment_events_serialize( self, deployment_id, @@ -1176,7 +1182,7 @@ def _list_deployment_events_serialize( _host = None _collection_formats: Dict[str, str] = { - "types": "multi", + 'types': 'multi', } _path_params: Dict[str, str] = {} @@ -1191,39 +1197,47 @@ def _list_deployment_events_serialize( # process the path parameters # process the query parameters if deployment_id is not None: - - _query_params.append(("deployment_id", deployment_id)) - + + _query_params.append(('deployment_id', deployment_id)) + if types is not None: - - _query_params.append(("types", types)) - + + _query_params.append(('types', types)) + if limit is not None: - - _query_params.append(("limit", limit)) - + + _query_params.append(('limit', limit)) + if offset is not None: - - _query_params.append(("offset", offset)) - + + _query_params.append(('offset', offset)) + if order is not None: - - _query_params.append(("order", order)) - + + _query_params.append(('order', order)) + # process the header parameters # process the form parameters # process the body parameter + # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept(["*/*"]) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + '*/*' + ] + ) + # authentication setting - _auth_settings: List[str] = ["Bearer"] + _auth_settings: List[str] = [ + 'Bearer' + ] return self.api_client.param_serialize( - method="GET", - resource_path="/v1/deployment_events", + method='GET', + resource_path='/v1/deployment_events', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -1233,37 +1247,27 @@ def _list_deployment_events_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth, + _request_auth=_request_auth ) + + + @validate_call def list_deployments( self, - app_id: Annotated[ - Optional[StrictStr], - Field(description="(Optional) Filter on application id"), - ] = None, - service_id: Annotated[ - Optional[StrictStr], Field(description="(Optional) Filter on service id") - ] = None, - limit: Annotated[ - Optional[StrictStr], - Field(description="(Optional) The number of items to return"), - ] = None, - offset: Annotated[ - Optional[StrictStr], - Field(description="(Optional) The offset in the list of item to return"), - ] = None, - statuses: Annotated[ - Optional[List[StrictStr]], - Field(description="(Optional) Filter on statuses"), - ] = None, + app_id: Annotated[Optional[StrictStr], Field(description="(Optional) Filter on application id")] = None, + service_id: Annotated[Optional[StrictStr], Field(description="(Optional) Filter on service id")] = None, + limit: Annotated[Optional[StrictStr], Field(description="(Optional) The number of items to return")] = None, + offset: Annotated[Optional[StrictStr], Field(description="(Optional) The offset in the list of item to return")] = None, + statuses: Annotated[Optional[List[StrictStr]], Field(description="(Optional) Filter on statuses")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -1303,7 +1307,7 @@ def list_deployments( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._list_deployments_serialize( app_id=app_id, @@ -1314,20 +1318,21 @@ def list_deployments( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ListDeploymentsReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "ListDeploymentsReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -1335,34 +1340,22 @@ def list_deployments( response_types_map=_response_types_map, ).data + @validate_call def list_deployments_with_http_info( self, - app_id: Annotated[ - Optional[StrictStr], - Field(description="(Optional) Filter on application id"), - ] = None, - service_id: Annotated[ - Optional[StrictStr], Field(description="(Optional) Filter on service id") - ] = None, - limit: Annotated[ - Optional[StrictStr], - Field(description="(Optional) The number of items to return"), - ] = None, - offset: Annotated[ - Optional[StrictStr], - Field(description="(Optional) The offset in the list of item to return"), - ] = None, - statuses: Annotated[ - Optional[List[StrictStr]], - Field(description="(Optional) Filter on statuses"), - ] = None, + app_id: Annotated[Optional[StrictStr], Field(description="(Optional) Filter on application id")] = None, + service_id: Annotated[Optional[StrictStr], Field(description="(Optional) Filter on service id")] = None, + limit: Annotated[Optional[StrictStr], Field(description="(Optional) The number of items to return")] = None, + offset: Annotated[Optional[StrictStr], Field(description="(Optional) The offset in the list of item to return")] = None, + statuses: Annotated[Optional[List[StrictStr]], Field(description="(Optional) Filter on statuses")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -1402,7 +1395,7 @@ def list_deployments_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._list_deployments_serialize( app_id=app_id, @@ -1413,20 +1406,21 @@ def list_deployments_with_http_info( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ListDeploymentsReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "ListDeploymentsReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -1434,34 +1428,22 @@ def list_deployments_with_http_info( response_types_map=_response_types_map, ) + @validate_call def list_deployments_without_preload_content( self, - app_id: Annotated[ - Optional[StrictStr], - Field(description="(Optional) Filter on application id"), - ] = None, - service_id: Annotated[ - Optional[StrictStr], Field(description="(Optional) Filter on service id") - ] = None, - limit: Annotated[ - Optional[StrictStr], - Field(description="(Optional) The number of items to return"), - ] = None, - offset: Annotated[ - Optional[StrictStr], - Field(description="(Optional) The offset in the list of item to return"), - ] = None, - statuses: Annotated[ - Optional[List[StrictStr]], - Field(description="(Optional) Filter on statuses"), - ] = None, + app_id: Annotated[Optional[StrictStr], Field(description="(Optional) Filter on application id")] = None, + service_id: Annotated[Optional[StrictStr], Field(description="(Optional) Filter on service id")] = None, + limit: Annotated[Optional[StrictStr], Field(description="(Optional) The number of items to return")] = None, + offset: Annotated[Optional[StrictStr], Field(description="(Optional) The offset in the list of item to return")] = None, + statuses: Annotated[Optional[List[StrictStr]], Field(description="(Optional) Filter on statuses")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -1501,7 +1483,7 @@ def list_deployments_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._list_deployments_serialize( app_id=app_id, @@ -1512,23 +1494,25 @@ def list_deployments_without_preload_content( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ListDeploymentsReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "ListDeploymentsReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) return response_data.response + def _list_deployments_serialize( self, app_id, @@ -1545,7 +1529,7 @@ def _list_deployments_serialize( _host = None _collection_formats: Dict[str, str] = { - "statuses": "multi", + 'statuses': 'multi', } _path_params: Dict[str, str] = {} @@ -1560,39 +1544,47 @@ def _list_deployments_serialize( # process the path parameters # process the query parameters if app_id is not None: - - _query_params.append(("app_id", app_id)) - + + _query_params.append(('app_id', app_id)) + if service_id is not None: - - _query_params.append(("service_id", service_id)) - + + _query_params.append(('service_id', service_id)) + if limit is not None: - - _query_params.append(("limit", limit)) - + + _query_params.append(('limit', limit)) + if offset is not None: - - _query_params.append(("offset", offset)) - + + _query_params.append(('offset', offset)) + if statuses is not None: - - _query_params.append(("statuses", statuses)) - + + _query_params.append(('statuses', statuses)) + # process the header parameters # process the form parameters # process the body parameter + # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept(["*/*"]) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + '*/*' + ] + ) + # authentication setting - _auth_settings: List[str] = ["Bearer"] + _auth_settings: List[str] = [ + 'Bearer' + ] return self.api_client.param_serialize( - method="GET", - resource_path="/v1/deployments", + method='GET', + resource_path='/v1/deployments', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -1602,5 +1594,7 @@ def _list_deployments_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth, + _request_auth=_request_auth ) + + diff --git a/koyeb/api/api/docker_helper_api.py b/koyeb/api/api/docker_helper_api.py index f305bcd2..18626d97 100644 --- a/koyeb/api/api/docker_helper_api.py +++ b/koyeb/api/api/docker_helper_api.py @@ -1,16 +1,15 @@ -# coding: utf-8 - """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 + import warnings from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt from typing import Any, Dict, List, Optional, Tuple, Union @@ -38,24 +37,19 @@ def __init__(self, api_client=None) -> None: api_client = ApiClient.get_default() self.api_client = api_client + @validate_call def verify_docker_image( self, - image: Annotated[ - Optional[StrictStr], Field(description="The full image uri to be verified") - ] = None, - secret_id: Annotated[ - Optional[StrictStr], - Field( - description="(Optional) the id of the secret to use to authenticate to the registry" - ), - ] = None, + image: Annotated[Optional[StrictStr], Field(description="The full image uri to be verified")] = None, + secret_id: Annotated[Optional[StrictStr], Field(description="(Optional) the id of the secret to use to authenticate to the registry")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -90,7 +84,7 @@ def verify_docker_image( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._verify_docker_image_serialize( image=image, @@ -98,20 +92,21 @@ def verify_docker_image( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "VerifyDockerImageReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "VerifyDockerImageReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -119,24 +114,19 @@ def verify_docker_image( response_types_map=_response_types_map, ).data + @validate_call def verify_docker_image_with_http_info( self, - image: Annotated[ - Optional[StrictStr], Field(description="The full image uri to be verified") - ] = None, - secret_id: Annotated[ - Optional[StrictStr], - Field( - description="(Optional) the id of the secret to use to authenticate to the registry" - ), - ] = None, + image: Annotated[Optional[StrictStr], Field(description="The full image uri to be verified")] = None, + secret_id: Annotated[Optional[StrictStr], Field(description="(Optional) the id of the secret to use to authenticate to the registry")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -171,7 +161,7 @@ def verify_docker_image_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._verify_docker_image_serialize( image=image, @@ -179,20 +169,21 @@ def verify_docker_image_with_http_info( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "VerifyDockerImageReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "VerifyDockerImageReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -200,24 +191,19 @@ def verify_docker_image_with_http_info( response_types_map=_response_types_map, ) + @validate_call def verify_docker_image_without_preload_content( self, - image: Annotated[ - Optional[StrictStr], Field(description="The full image uri to be verified") - ] = None, - secret_id: Annotated[ - Optional[StrictStr], - Field( - description="(Optional) the id of the secret to use to authenticate to the registry" - ), - ] = None, + image: Annotated[Optional[StrictStr], Field(description="The full image uri to be verified")] = None, + secret_id: Annotated[Optional[StrictStr], Field(description="(Optional) the id of the secret to use to authenticate to the registry")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -252,7 +238,7 @@ def verify_docker_image_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._verify_docker_image_serialize( image=image, @@ -260,23 +246,25 @@ def verify_docker_image_without_preload_content( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "VerifyDockerImageReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "VerifyDockerImageReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) return response_data.response + def _verify_docker_image_serialize( self, image, @@ -289,7 +277,8 @@ def _verify_docker_image_serialize( _host = None - _collection_formats: Dict[str, str] = {} + _collection_formats: Dict[str, str] = { + } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -303,27 +292,35 @@ def _verify_docker_image_serialize( # process the path parameters # process the query parameters if image is not None: - - _query_params.append(("image", image)) - + + _query_params.append(('image', image)) + if secret_id is not None: - - _query_params.append(("secret_id", secret_id)) - + + _query_params.append(('secret_id', secret_id)) + # process the header parameters # process the form parameters # process the body parameter + # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept(["*/*"]) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + '*/*' + ] + ) + # authentication setting - _auth_settings: List[str] = ["Bearer"] + _auth_settings: List[str] = [ + 'Bearer' + ] return self.api_client.param_serialize( - method="GET", - resource_path="/v1/docker-helper/verify", + method='GET', + resource_path='/v1/docker-helper/verify', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -333,5 +330,7 @@ def _verify_docker_image_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth, + _request_auth=_request_auth ) + + diff --git a/koyeb/api/api/domains_api.py b/koyeb/api/api/domains_api.py index 1b95a444..50dfda64 100644 --- a/koyeb/api/api/domains_api.py +++ b/koyeb/api/api/domains_api.py @@ -1,16 +1,15 @@ -# coding: utf-8 - """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 + import warnings from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt from typing import Any, Dict, List, Optional, Tuple, Union @@ -43,6 +42,7 @@ def __init__(self, api_client=None) -> None: api_client = ApiClient.get_default() self.api_client = api_client + @validate_call def create_domain( self, @@ -51,8 +51,9 @@ def create_domain( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -84,27 +85,28 @@ def create_domain( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._create_domain_serialize( domain=domain, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "CreateDomainReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "CreateDomainReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -112,6 +114,7 @@ def create_domain( response_types_map=_response_types_map, ).data + @validate_call def create_domain_with_http_info( self, @@ -120,8 +123,9 @@ def create_domain_with_http_info( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -153,27 +157,28 @@ def create_domain_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._create_domain_serialize( domain=domain, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "CreateDomainReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "CreateDomainReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -181,6 +186,7 @@ def create_domain_with_http_info( response_types_map=_response_types_map, ) + @validate_call def create_domain_without_preload_content( self, @@ -189,8 +195,9 @@ def create_domain_without_preload_content( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -222,30 +229,32 @@ def create_domain_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._create_domain_serialize( domain=domain, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "CreateDomainReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "CreateDomainReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) return response_data.response + def _create_domain_serialize( self, domain, @@ -257,7 +266,8 @@ def _create_domain_serialize( _host = None - _collection_formats: Dict[str, str] = {} + _collection_formats: Dict[str, str] = { + } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -276,16 +286,24 @@ def _create_domain_serialize( if domain is not None: _body_params = domain + # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept(["*/*"]) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + '*/*' + ] + ) + # authentication setting - _auth_settings: List[str] = ["Bearer"] + _auth_settings: List[str] = [ + 'Bearer' + ] return self.api_client.param_serialize( - method="POST", - resource_path="/v1/domains", + method='POST', + resource_path='/v1/domains', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -295,9 +313,12 @@ def _create_domain_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth, + _request_auth=_request_auth ) + + + @validate_call def delete_domain( self, @@ -306,8 +327,9 @@ def delete_domain( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -339,27 +361,28 @@ def delete_domain( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._delete_domain_serialize( id=id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "object", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "object", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -367,6 +390,7 @@ def delete_domain( response_types_map=_response_types_map, ).data + @validate_call def delete_domain_with_http_info( self, @@ -375,8 +399,9 @@ def delete_domain_with_http_info( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -408,27 +433,28 @@ def delete_domain_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._delete_domain_serialize( id=id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "object", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "object", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -436,6 +462,7 @@ def delete_domain_with_http_info( response_types_map=_response_types_map, ) + @validate_call def delete_domain_without_preload_content( self, @@ -444,8 +471,9 @@ def delete_domain_without_preload_content( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -477,30 +505,32 @@ def delete_domain_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._delete_domain_serialize( id=id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "object", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "object", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) return response_data.response + def _delete_domain_serialize( self, id, @@ -512,7 +542,8 @@ def _delete_domain_serialize( _host = None - _collection_formats: Dict[str, str] = {} + _collection_formats: Dict[str, str] = { + } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -525,22 +556,30 @@ def _delete_domain_serialize( # process the path parameters if id is not None: - _path_params["id"] = id + _path_params['id'] = id # process the query parameters # process the header parameters # process the form parameters # process the body parameter + # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept(["*/*"]) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + '*/*' + ] + ) + # authentication setting - _auth_settings: List[str] = ["Bearer"] + _auth_settings: List[str] = [ + 'Bearer' + ] return self.api_client.param_serialize( - method="DELETE", - resource_path="/v1/domains/{id}", + method='DELETE', + resource_path='/v1/domains/{id}', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -550,9 +589,12 @@ def _delete_domain_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth, + _request_auth=_request_auth ) + + + @validate_call def get_domain( self, @@ -561,8 +603,9 @@ def get_domain( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -594,27 +637,28 @@ def get_domain( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._get_domain_serialize( id=id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "GetDomainReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "GetDomainReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -622,6 +666,7 @@ def get_domain( response_types_map=_response_types_map, ).data + @validate_call def get_domain_with_http_info( self, @@ -630,8 +675,9 @@ def get_domain_with_http_info( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -663,27 +709,28 @@ def get_domain_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._get_domain_serialize( id=id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "GetDomainReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "GetDomainReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -691,6 +738,7 @@ def get_domain_with_http_info( response_types_map=_response_types_map, ) + @validate_call def get_domain_without_preload_content( self, @@ -699,8 +747,9 @@ def get_domain_without_preload_content( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -732,30 +781,32 @@ def get_domain_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._get_domain_serialize( id=id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "GetDomainReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "GetDomainReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) return response_data.response + def _get_domain_serialize( self, id, @@ -767,7 +818,8 @@ def _get_domain_serialize( _host = None - _collection_formats: Dict[str, str] = {} + _collection_formats: Dict[str, str] = { + } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -780,22 +832,30 @@ def _get_domain_serialize( # process the path parameters if id is not None: - _path_params["id"] = id + _path_params['id'] = id # process the query parameters # process the header parameters # process the form parameters # process the body parameter + # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept(["*/*"]) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + '*/*' + ] + ) + # authentication setting - _auth_settings: List[str] = ["Bearer"] + _auth_settings: List[str] = [ + 'Bearer' + ] return self.api_client.param_serialize( - method="GET", - resource_path="/v1/domains/{id}", + method='GET', + resource_path='/v1/domains/{id}', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -805,42 +865,29 @@ def _get_domain_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth, + _request_auth=_request_auth ) + + + @validate_call def list_domains( self, - limit: Annotated[ - Optional[StrictStr], - Field(description="(Optional) The number of items to return"), - ] = None, - offset: Annotated[ - Optional[StrictStr], - Field(description="(Optional) The offset in the list of item to return"), - ] = None, - types: Annotated[ - Optional[List[StrictStr]], - Field( - description="(Optional) A filter for types - AUTOASSIGNED: Domain like -.koyeb.app" - ), - ] = None, - statuses: Annotated[ - Optional[List[StrictStr]], - Field(description="(Optional) A filter for statuses"), - ] = None, - app_ids: Annotated[ - Optional[List[StrictStr]], Field(description="(Optional) A filter for apps") - ] = None, - name: Annotated[ - Optional[StrictStr], Field(description="(Optional) A filter for name") - ] = None, + limit: Annotated[Optional[StrictStr], Field(description="(Optional) The number of items to return")] = None, + offset: Annotated[Optional[StrictStr], Field(description="(Optional) The offset in the list of item to return")] = None, + types: Annotated[Optional[List[StrictStr]], Field(description="(Optional) A filter for types - AUTOASSIGNED: Domain like -.koyeb.app")] = None, + statuses: Annotated[Optional[List[StrictStr]], Field(description="(Optional) A filter for statuses")] = None, + app_ids: Annotated[Optional[List[StrictStr]], Field(description="(Optional) A filter for apps")] = None, + name: Annotated[Optional[StrictStr], Field(description="(Optional) A filter for name")] = None, + project_id: Annotated[Optional[StrictStr], Field(description="(Optional) A filter for the project ID")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -862,6 +909,8 @@ def list_domains( :type app_ids: List[str] :param name: (Optional) A filter for name :type name: str + :param project_id: (Optional) A filter for the project ID + :type project_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -882,7 +931,7 @@ def list_domains( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._list_domains_serialize( limit=limit, @@ -891,23 +940,25 @@ def list_domains( statuses=statuses, app_ids=app_ids, name=name, + project_id=project_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ListDomainsReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "ListDomainsReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -915,39 +966,24 @@ def list_domains( response_types_map=_response_types_map, ).data + @validate_call def list_domains_with_http_info( self, - limit: Annotated[ - Optional[StrictStr], - Field(description="(Optional) The number of items to return"), - ] = None, - offset: Annotated[ - Optional[StrictStr], - Field(description="(Optional) The offset in the list of item to return"), - ] = None, - types: Annotated[ - Optional[List[StrictStr]], - Field( - description="(Optional) A filter for types - AUTOASSIGNED: Domain like -.koyeb.app" - ), - ] = None, - statuses: Annotated[ - Optional[List[StrictStr]], - Field(description="(Optional) A filter for statuses"), - ] = None, - app_ids: Annotated[ - Optional[List[StrictStr]], Field(description="(Optional) A filter for apps") - ] = None, - name: Annotated[ - Optional[StrictStr], Field(description="(Optional) A filter for name") - ] = None, + limit: Annotated[Optional[StrictStr], Field(description="(Optional) The number of items to return")] = None, + offset: Annotated[Optional[StrictStr], Field(description="(Optional) The offset in the list of item to return")] = None, + types: Annotated[Optional[List[StrictStr]], Field(description="(Optional) A filter for types - AUTOASSIGNED: Domain like -.koyeb.app")] = None, + statuses: Annotated[Optional[List[StrictStr]], Field(description="(Optional) A filter for statuses")] = None, + app_ids: Annotated[Optional[List[StrictStr]], Field(description="(Optional) A filter for apps")] = None, + name: Annotated[Optional[StrictStr], Field(description="(Optional) A filter for name")] = None, + project_id: Annotated[Optional[StrictStr], Field(description="(Optional) A filter for the project ID")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -969,6 +1005,8 @@ def list_domains_with_http_info( :type app_ids: List[str] :param name: (Optional) A filter for name :type name: str + :param project_id: (Optional) A filter for the project ID + :type project_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -989,7 +1027,7 @@ def list_domains_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._list_domains_serialize( limit=limit, @@ -998,23 +1036,25 @@ def list_domains_with_http_info( statuses=statuses, app_ids=app_ids, name=name, + project_id=project_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ListDomainsReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "ListDomainsReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -1022,39 +1062,24 @@ def list_domains_with_http_info( response_types_map=_response_types_map, ) + @validate_call def list_domains_without_preload_content( self, - limit: Annotated[ - Optional[StrictStr], - Field(description="(Optional) The number of items to return"), - ] = None, - offset: Annotated[ - Optional[StrictStr], - Field(description="(Optional) The offset in the list of item to return"), - ] = None, - types: Annotated[ - Optional[List[StrictStr]], - Field( - description="(Optional) A filter for types - AUTOASSIGNED: Domain like -.koyeb.app" - ), - ] = None, - statuses: Annotated[ - Optional[List[StrictStr]], - Field(description="(Optional) A filter for statuses"), - ] = None, - app_ids: Annotated[ - Optional[List[StrictStr]], Field(description="(Optional) A filter for apps") - ] = None, - name: Annotated[ - Optional[StrictStr], Field(description="(Optional) A filter for name") - ] = None, + limit: Annotated[Optional[StrictStr], Field(description="(Optional) The number of items to return")] = None, + offset: Annotated[Optional[StrictStr], Field(description="(Optional) The offset in the list of item to return")] = None, + types: Annotated[Optional[List[StrictStr]], Field(description="(Optional) A filter for types - AUTOASSIGNED: Domain like -.koyeb.app")] = None, + statuses: Annotated[Optional[List[StrictStr]], Field(description="(Optional) A filter for statuses")] = None, + app_ids: Annotated[Optional[List[StrictStr]], Field(description="(Optional) A filter for apps")] = None, + name: Annotated[Optional[StrictStr], Field(description="(Optional) A filter for name")] = None, + project_id: Annotated[Optional[StrictStr], Field(description="(Optional) A filter for the project ID")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -1076,6 +1101,8 @@ def list_domains_without_preload_content( :type app_ids: List[str] :param name: (Optional) A filter for name :type name: str + :param project_id: (Optional) A filter for the project ID + :type project_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -1096,7 +1123,7 @@ def list_domains_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._list_domains_serialize( limit=limit, @@ -1105,26 +1132,29 @@ def list_domains_without_preload_content( statuses=statuses, app_ids=app_ids, name=name, + project_id=project_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ListDomainsReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "ListDomainsReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) return response_data.response + def _list_domains_serialize( self, limit, @@ -1133,6 +1163,7 @@ def _list_domains_serialize( statuses, app_ids, name, + project_id, _request_auth, _content_type, _headers, @@ -1142,9 +1173,9 @@ def _list_domains_serialize( _host = None _collection_formats: Dict[str, str] = { - "types": "multi", - "statuses": "multi", - "app_ids": "multi", + 'types': 'multi', + 'statuses': 'multi', + 'app_ids': 'multi', } _path_params: Dict[str, str] = {} @@ -1159,43 +1190,55 @@ def _list_domains_serialize( # process the path parameters # process the query parameters if limit is not None: - - _query_params.append(("limit", limit)) - + + _query_params.append(('limit', limit)) + if offset is not None: - - _query_params.append(("offset", offset)) - + + _query_params.append(('offset', offset)) + if types is not None: - - _query_params.append(("types", types)) - + + _query_params.append(('types', types)) + if statuses is not None: - - _query_params.append(("statuses", statuses)) - + + _query_params.append(('statuses', statuses)) + if app_ids is not None: - - _query_params.append(("app_ids", app_ids)) - + + _query_params.append(('app_ids', app_ids)) + if name is not None: - - _query_params.append(("name", name)) - + + _query_params.append(('name', name)) + + if project_id is not None: + + _query_params.append(('project_id', project_id)) + # process the header parameters # process the form parameters # process the body parameter + # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept(["*/*"]) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + '*/*' + ] + ) + # authentication setting - _auth_settings: List[str] = ["Bearer"] + _auth_settings: List[str] = [ + 'Bearer' + ] return self.api_client.param_serialize( - method="GET", - resource_path="/v1/domains", + method='GET', + resource_path='/v1/domains', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -1205,9 +1248,12 @@ def _list_domains_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth, + _request_auth=_request_auth ) + + + @validate_call def refresh_domain_status( self, @@ -1216,8 +1262,9 @@ def refresh_domain_status( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -1249,27 +1296,28 @@ def refresh_domain_status( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._refresh_domain_status_serialize( id=id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "object", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "object", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -1277,6 +1325,7 @@ def refresh_domain_status( response_types_map=_response_types_map, ).data + @validate_call def refresh_domain_status_with_http_info( self, @@ -1285,8 +1334,9 @@ def refresh_domain_status_with_http_info( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -1318,27 +1368,28 @@ def refresh_domain_status_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._refresh_domain_status_serialize( id=id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "object", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "object", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -1346,6 +1397,7 @@ def refresh_domain_status_with_http_info( response_types_map=_response_types_map, ) + @validate_call def refresh_domain_status_without_preload_content( self, @@ -1354,8 +1406,9 @@ def refresh_domain_status_without_preload_content( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -1387,30 +1440,32 @@ def refresh_domain_status_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._refresh_domain_status_serialize( id=id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "object", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "object", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) return response_data.response + def _refresh_domain_status_serialize( self, id, @@ -1422,7 +1477,8 @@ def _refresh_domain_status_serialize( _host = None - _collection_formats: Dict[str, str] = {} + _collection_formats: Dict[str, str] = { + } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -1435,22 +1491,30 @@ def _refresh_domain_status_serialize( # process the path parameters if id is not None: - _path_params["id"] = id + _path_params['id'] = id # process the query parameters # process the header parameters # process the form parameters # process the body parameter + # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept(["*/*"]) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + '*/*' + ] + ) + # authentication setting - _auth_settings: List[str] = ["Bearer"] + _auth_settings: List[str] = [ + 'Bearer' + ] return self.api_client.param_serialize( - method="POST", - resource_path="/v1/domains/{id}/refresh", + method='POST', + resource_path='/v1/domains/{id}/refresh', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -1460,27 +1524,26 @@ def _refresh_domain_status_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth, + _request_auth=_request_auth ) + + + @validate_call def update_domain( self, id: StrictStr, domain: UpdateDomain, update_mask: Optional[StrictStr] = None, - dry_run: Annotated[ - Optional[StrictBool], - Field( - description="If set, run validation and check that the domain is available." - ), - ] = None, + dry_run: Annotated[Optional[StrictBool], Field(description="If set, run validation and check that the domain is available.")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -1518,7 +1581,7 @@ def update_domain( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._update_domain_serialize( id=id, @@ -1528,20 +1591,21 @@ def update_domain( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "UpdateDomainReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "UpdateDomainReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -1549,24 +1613,21 @@ def update_domain( response_types_map=_response_types_map, ).data + @validate_call def update_domain_with_http_info( self, id: StrictStr, domain: UpdateDomain, update_mask: Optional[StrictStr] = None, - dry_run: Annotated[ - Optional[StrictBool], - Field( - description="If set, run validation and check that the domain is available." - ), - ] = None, + dry_run: Annotated[Optional[StrictBool], Field(description="If set, run validation and check that the domain is available.")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -1604,7 +1665,7 @@ def update_domain_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._update_domain_serialize( id=id, @@ -1614,20 +1675,21 @@ def update_domain_with_http_info( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "UpdateDomainReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "UpdateDomainReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -1635,24 +1697,21 @@ def update_domain_with_http_info( response_types_map=_response_types_map, ) + @validate_call def update_domain_without_preload_content( self, id: StrictStr, domain: UpdateDomain, update_mask: Optional[StrictStr] = None, - dry_run: Annotated[ - Optional[StrictBool], - Field( - description="If set, run validation and check that the domain is available." - ), - ] = None, + dry_run: Annotated[Optional[StrictBool], Field(description="If set, run validation and check that the domain is available.")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -1690,7 +1749,7 @@ def update_domain_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._update_domain_serialize( id=id, @@ -1700,23 +1759,25 @@ def update_domain_without_preload_content( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "UpdateDomainReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "UpdateDomainReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) return response_data.response + def _update_domain_serialize( self, id, @@ -1731,7 +1792,8 @@ def _update_domain_serialize( _host = None - _collection_formats: Dict[str, str] = {} + _collection_formats: Dict[str, str] = { + } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -1744,32 +1806,40 @@ def _update_domain_serialize( # process the path parameters if id is not None: - _path_params["id"] = id + _path_params['id'] = id # process the query parameters if update_mask is not None: - - _query_params.append(("update_mask", update_mask)) - + + _query_params.append(('update_mask', update_mask)) + if dry_run is not None: - - _query_params.append(("dry_run", dry_run)) - + + _query_params.append(('dry_run', dry_run)) + # process the header parameters # process the form parameters # process the body parameter if domain is not None: _body_params = domain + # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept(["*/*"]) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + '*/*' + ] + ) + # authentication setting - _auth_settings: List[str] = ["Bearer"] + _auth_settings: List[str] = [ + 'Bearer' + ] return self.api_client.param_serialize( - method="PATCH", - resource_path="/v1/domains/{id}", + method='PATCH', + resource_path='/v1/domains/{id}', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -1779,5 +1849,7 @@ def _update_domain_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth, + _request_auth=_request_auth ) + + diff --git a/koyeb/api/api/instances_api.py b/koyeb/api/api/instances_api.py index 93e93d42..9ade4a63 100644 --- a/koyeb/api/api/instances_api.py +++ b/koyeb/api/api/instances_api.py @@ -1,38 +1,28 @@ -# coding: utf-8 - """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 + import warnings from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt from typing import Any, Dict, List, Optional, Tuple, Union from typing_extensions import Annotated from datetime import datetime -from pydantic import ( - Field, - StrictBool, - StrictBytes, - StrictInt, - StrictStr, - field_validator, -) +from pydantic import Field, StrictBool, StrictBytes, StrictInt, StrictStr, field_validator from typing import List, Optional, Union from typing_extensions import Annotated from koyeb.api.models.get_instance_reply import GetInstanceReply from koyeb.api.models.list_instance_events_reply import ListInstanceEventsReply from koyeb.api.models.list_instances_reply import ListInstancesReply -from koyeb.api.models.stream_result_of_exec_command_reply import ( - StreamResultOfExecCommandReply, -) +from koyeb.api.models.stream_result_of_exec_command_reply import StreamResultOfExecCommandReply from koyeb.api.api_client import ApiClient, RequestSerialized from koyeb.api.api_response import ApiResponse @@ -51,43 +41,25 @@ def __init__(self, api_client=None) -> None: api_client = ApiClient.get_default() self.api_client = api_client + @validate_call def exec_command( self, - id: Annotated[ - Optional[StrictStr], Field(description="ID of the resource to exec on.") - ] = None, - body_command: Annotated[ - Optional[List[StrictStr]], - Field(description="Command to exec. Mandatory in the first frame sent"), - ] = None, + id: Annotated[Optional[StrictStr], Field(description="ID of the resource to exec on.")] = None, + body_command: Annotated[Optional[List[StrictStr]], Field(description="Command to exec. Mandatory in the first frame sent")] = None, body_tty_size_height: Optional[StrictInt] = None, body_tty_size_width: Optional[StrictInt] = None, - body_stdin_data: Annotated[ - Optional[Union[StrictBytes, StrictStr]], - Field(description="Data is base64 encoded"), - ] = None, - body_stdin_close: Annotated[ - Optional[StrictBool], Field(description="Indicate last data frame") - ] = None, - body_disable_tty: Annotated[ - Optional[StrictBool], - Field( - description="Disable TTY. It's enough to specify it in the first frame" - ), - ] = None, - id_type: Annotated[ - Optional[StrictStr], - Field( - description="When specified, it is used to determine if the kind of resource the id refers to. If missing, defaults to the instance id." - ), - ] = None, + body_stdin_data: Annotated[Optional[Union[StrictBytes, StrictStr]], Field(description="Data is base64 encoded")] = None, + body_stdin_close: Annotated[Optional[StrictBool], Field(description="Indicate last data frame")] = None, + body_disable_tty: Annotated[Optional[StrictBool], Field(description="Disable TTY. It's enough to specify it in the first frame")] = None, + id_type: Annotated[Optional[StrictStr], Field(description="When specified, it is used to determine if the kind of resource the id refers to. If missing, defaults to the instance id.")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -107,7 +79,7 @@ def exec_command( :param body_tty_size_width: :type body_tty_size_width: int :param body_stdin_data: Data is base64 encoded - :type body_stdin_data: bytearray + :type body_stdin_data: bytes :param body_stdin_close: Indicate last data frame :type body_stdin_close: bool :param body_disable_tty: Disable TTY. It's enough to specify it in the first frame @@ -134,7 +106,7 @@ def exec_command( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._exec_command_serialize( id=id, @@ -148,20 +120,21 @@ def exec_command( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "StreamResultOfExecCommandReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "StreamResultOfExecCommandReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -169,43 +142,25 @@ def exec_command( response_types_map=_response_types_map, ).data + @validate_call def exec_command_with_http_info( self, - id: Annotated[ - Optional[StrictStr], Field(description="ID of the resource to exec on.") - ] = None, - body_command: Annotated[ - Optional[List[StrictStr]], - Field(description="Command to exec. Mandatory in the first frame sent"), - ] = None, + id: Annotated[Optional[StrictStr], Field(description="ID of the resource to exec on.")] = None, + body_command: Annotated[Optional[List[StrictStr]], Field(description="Command to exec. Mandatory in the first frame sent")] = None, body_tty_size_height: Optional[StrictInt] = None, body_tty_size_width: Optional[StrictInt] = None, - body_stdin_data: Annotated[ - Optional[Union[StrictBytes, StrictStr]], - Field(description="Data is base64 encoded"), - ] = None, - body_stdin_close: Annotated[ - Optional[StrictBool], Field(description="Indicate last data frame") - ] = None, - body_disable_tty: Annotated[ - Optional[StrictBool], - Field( - description="Disable TTY. It's enough to specify it in the first frame" - ), - ] = None, - id_type: Annotated[ - Optional[StrictStr], - Field( - description="When specified, it is used to determine if the kind of resource the id refers to. If missing, defaults to the instance id." - ), - ] = None, + body_stdin_data: Annotated[Optional[Union[StrictBytes, StrictStr]], Field(description="Data is base64 encoded")] = None, + body_stdin_close: Annotated[Optional[StrictBool], Field(description="Indicate last data frame")] = None, + body_disable_tty: Annotated[Optional[StrictBool], Field(description="Disable TTY. It's enough to specify it in the first frame")] = None, + id_type: Annotated[Optional[StrictStr], Field(description="When specified, it is used to determine if the kind of resource the id refers to. If missing, defaults to the instance id.")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -225,7 +180,7 @@ def exec_command_with_http_info( :param body_tty_size_width: :type body_tty_size_width: int :param body_stdin_data: Data is base64 encoded - :type body_stdin_data: bytearray + :type body_stdin_data: bytes :param body_stdin_close: Indicate last data frame :type body_stdin_close: bool :param body_disable_tty: Disable TTY. It's enough to specify it in the first frame @@ -252,7 +207,7 @@ def exec_command_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._exec_command_serialize( id=id, @@ -266,20 +221,21 @@ def exec_command_with_http_info( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "StreamResultOfExecCommandReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "StreamResultOfExecCommandReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -287,43 +243,25 @@ def exec_command_with_http_info( response_types_map=_response_types_map, ) + @validate_call def exec_command_without_preload_content( self, - id: Annotated[ - Optional[StrictStr], Field(description="ID of the resource to exec on.") - ] = None, - body_command: Annotated[ - Optional[List[StrictStr]], - Field(description="Command to exec. Mandatory in the first frame sent"), - ] = None, + id: Annotated[Optional[StrictStr], Field(description="ID of the resource to exec on.")] = None, + body_command: Annotated[Optional[List[StrictStr]], Field(description="Command to exec. Mandatory in the first frame sent")] = None, body_tty_size_height: Optional[StrictInt] = None, body_tty_size_width: Optional[StrictInt] = None, - body_stdin_data: Annotated[ - Optional[Union[StrictBytes, StrictStr]], - Field(description="Data is base64 encoded"), - ] = None, - body_stdin_close: Annotated[ - Optional[StrictBool], Field(description="Indicate last data frame") - ] = None, - body_disable_tty: Annotated[ - Optional[StrictBool], - Field( - description="Disable TTY. It's enough to specify it in the first frame" - ), - ] = None, - id_type: Annotated[ - Optional[StrictStr], - Field( - description="When specified, it is used to determine if the kind of resource the id refers to. If missing, defaults to the instance id." - ), - ] = None, + body_stdin_data: Annotated[Optional[Union[StrictBytes, StrictStr]], Field(description="Data is base64 encoded")] = None, + body_stdin_close: Annotated[Optional[StrictBool], Field(description="Indicate last data frame")] = None, + body_disable_tty: Annotated[Optional[StrictBool], Field(description="Disable TTY. It's enough to specify it in the first frame")] = None, + id_type: Annotated[Optional[StrictStr], Field(description="When specified, it is used to determine if the kind of resource the id refers to. If missing, defaults to the instance id.")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -343,7 +281,7 @@ def exec_command_without_preload_content( :param body_tty_size_width: :type body_tty_size_width: int :param body_stdin_data: Data is base64 encoded - :type body_stdin_data: bytearray + :type body_stdin_data: bytes :param body_stdin_close: Indicate last data frame :type body_stdin_close: bool :param body_disable_tty: Disable TTY. It's enough to specify it in the first frame @@ -370,7 +308,7 @@ def exec_command_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._exec_command_serialize( id=id, @@ -384,23 +322,25 @@ def exec_command_without_preload_content( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "StreamResultOfExecCommandReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "StreamResultOfExecCommandReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) return response_data.response + def _exec_command_serialize( self, id, @@ -420,7 +360,7 @@ def _exec_command_serialize( _host = None _collection_formats: Dict[str, str] = { - "body.command": "multi", + 'body.command': 'multi', } _path_params: Dict[str, str] = {} @@ -435,51 +375,59 @@ def _exec_command_serialize( # process the path parameters # process the query parameters if id is not None: - - _query_params.append(("id", id)) - + + _query_params.append(('id', id)) + if body_command is not None: - - _query_params.append(("body.command", body_command)) - + + _query_params.append(('body.command', body_command)) + if body_tty_size_height is not None: - - _query_params.append(("body.tty_size.height", body_tty_size_height)) - + + _query_params.append(('body.tty_size.height', body_tty_size_height)) + if body_tty_size_width is not None: - - _query_params.append(("body.tty_size.width", body_tty_size_width)) - + + _query_params.append(('body.tty_size.width', body_tty_size_width)) + if body_stdin_data is not None: - - _query_params.append(("body.stdin.data", body_stdin_data)) - + + _query_params.append(('body.stdin.data', body_stdin_data)) + if body_stdin_close is not None: - - _query_params.append(("body.stdin.close", body_stdin_close)) - + + _query_params.append(('body.stdin.close', body_stdin_close)) + if body_disable_tty is not None: - - _query_params.append(("body.disableTty", body_disable_tty)) - + + _query_params.append(('body.disableTty', body_disable_tty)) + if id_type is not None: - - _query_params.append(("id_type", id_type)) - + + _query_params.append(('id_type', id_type)) + # process the header parameters # process the form parameters # process the body parameter + # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept(["*/*"]) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + '*/*' + ] + ) + # authentication setting - _auth_settings: List[str] = ["Bearer"] + _auth_settings: List[str] = [ + 'Bearer' + ] return self.api_client.param_serialize( - method="GET", - resource_path="/v1/streams/instances/exec", + method='GET', + resource_path='/v1/streams/instances/exec', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -489,9 +437,12 @@ def _exec_command_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth, + _request_auth=_request_auth ) + + + @validate_call def get_instance( self, @@ -500,8 +451,9 @@ def get_instance( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -533,27 +485,28 @@ def get_instance( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._get_instance_serialize( id=id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "GetInstanceReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "GetInstanceReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -561,6 +514,7 @@ def get_instance( response_types_map=_response_types_map, ).data + @validate_call def get_instance_with_http_info( self, @@ -569,8 +523,9 @@ def get_instance_with_http_info( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -602,27 +557,28 @@ def get_instance_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._get_instance_serialize( id=id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "GetInstanceReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "GetInstanceReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -630,6 +586,7 @@ def get_instance_with_http_info( response_types_map=_response_types_map, ) + @validate_call def get_instance_without_preload_content( self, @@ -638,8 +595,9 @@ def get_instance_without_preload_content( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -671,30 +629,32 @@ def get_instance_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._get_instance_serialize( id=id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "GetInstanceReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "GetInstanceReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) return response_data.response + def _get_instance_serialize( self, id, @@ -706,7 +666,8 @@ def _get_instance_serialize( _host = None - _collection_formats: Dict[str, str] = {} + _collection_formats: Dict[str, str] = { + } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -719,22 +680,30 @@ def _get_instance_serialize( # process the path parameters if id is not None: - _path_params["id"] = id + _path_params['id'] = id # process the query parameters # process the header parameters # process the form parameters # process the body parameter + # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept(["*/*"]) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + '*/*' + ] + ) + # authentication setting - _auth_settings: List[str] = ["Bearer"] + _auth_settings: List[str] = [ + 'Bearer' + ] return self.api_client.param_serialize( - method="GET", - resource_path="/v1/instances/{id}", + method='GET', + resource_path='/v1/instances/{id}', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -744,40 +713,27 @@ def _get_instance_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth, + _request_auth=_request_auth ) + + + @validate_call def list_instance_events( self, - instance_ids: Annotated[ - Optional[List[StrictStr]], - Field(description="(Optional) Filter on list of instance id"), - ] = None, - types: Annotated[ - Optional[List[StrictStr]], - Field(description="(Optional) Filter on instance event types"), - ] = None, - limit: Annotated[ - Optional[StrictStr], - Field(description="(Optional) The number of items to return"), - ] = None, - offset: Annotated[ - Optional[StrictStr], - Field(description="(Optional) The offset in the list of item to return"), - ] = None, - order: Annotated[ - Optional[StrictStr], - Field( - description="(Optional) Sorts the list in the ascending or the descending order" - ), - ] = None, + instance_ids: Annotated[Optional[List[StrictStr]], Field(description="(Optional) Filter on list of instance id")] = None, + types: Annotated[Optional[List[StrictStr]], Field(description="(Optional) Filter on instance event types")] = None, + limit: Annotated[Optional[StrictStr], Field(description="(Optional) The number of items to return")] = None, + offset: Annotated[Optional[StrictStr], Field(description="(Optional) The offset in the list of item to return")] = None, + order: Annotated[Optional[StrictStr], Field(description="(Optional) Sorts the list in the ascending or the descending order")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -817,7 +773,7 @@ def list_instance_events( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._list_instance_events_serialize( instance_ids=instance_ids, @@ -828,20 +784,21 @@ def list_instance_events( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ListInstanceEventsReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "ListInstanceEventsReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -849,37 +806,22 @@ def list_instance_events( response_types_map=_response_types_map, ).data + @validate_call def list_instance_events_with_http_info( self, - instance_ids: Annotated[ - Optional[List[StrictStr]], - Field(description="(Optional) Filter on list of instance id"), - ] = None, - types: Annotated[ - Optional[List[StrictStr]], - Field(description="(Optional) Filter on instance event types"), - ] = None, - limit: Annotated[ - Optional[StrictStr], - Field(description="(Optional) The number of items to return"), - ] = None, - offset: Annotated[ - Optional[StrictStr], - Field(description="(Optional) The offset in the list of item to return"), - ] = None, - order: Annotated[ - Optional[StrictStr], - Field( - description="(Optional) Sorts the list in the ascending or the descending order" - ), - ] = None, + instance_ids: Annotated[Optional[List[StrictStr]], Field(description="(Optional) Filter on list of instance id")] = None, + types: Annotated[Optional[List[StrictStr]], Field(description="(Optional) Filter on instance event types")] = None, + limit: Annotated[Optional[StrictStr], Field(description="(Optional) The number of items to return")] = None, + offset: Annotated[Optional[StrictStr], Field(description="(Optional) The offset in the list of item to return")] = None, + order: Annotated[Optional[StrictStr], Field(description="(Optional) Sorts the list in the ascending or the descending order")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -919,7 +861,7 @@ def list_instance_events_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._list_instance_events_serialize( instance_ids=instance_ids, @@ -930,20 +872,21 @@ def list_instance_events_with_http_info( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ListInstanceEventsReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "ListInstanceEventsReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -951,37 +894,22 @@ def list_instance_events_with_http_info( response_types_map=_response_types_map, ) + @validate_call def list_instance_events_without_preload_content( self, - instance_ids: Annotated[ - Optional[List[StrictStr]], - Field(description="(Optional) Filter on list of instance id"), - ] = None, - types: Annotated[ - Optional[List[StrictStr]], - Field(description="(Optional) Filter on instance event types"), - ] = None, - limit: Annotated[ - Optional[StrictStr], - Field(description="(Optional) The number of items to return"), - ] = None, - offset: Annotated[ - Optional[StrictStr], - Field(description="(Optional) The offset in the list of item to return"), - ] = None, - order: Annotated[ - Optional[StrictStr], - Field( - description="(Optional) Sorts the list in the ascending or the descending order" - ), - ] = None, + instance_ids: Annotated[Optional[List[StrictStr]], Field(description="(Optional) Filter on list of instance id")] = None, + types: Annotated[Optional[List[StrictStr]], Field(description="(Optional) Filter on instance event types")] = None, + limit: Annotated[Optional[StrictStr], Field(description="(Optional) The number of items to return")] = None, + offset: Annotated[Optional[StrictStr], Field(description="(Optional) The offset in the list of item to return")] = None, + order: Annotated[Optional[StrictStr], Field(description="(Optional) Sorts the list in the ascending or the descending order")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -1021,7 +949,7 @@ def list_instance_events_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._list_instance_events_serialize( instance_ids=instance_ids, @@ -1032,23 +960,25 @@ def list_instance_events_without_preload_content( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ListInstanceEventsReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "ListInstanceEventsReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) return response_data.response + def _list_instance_events_serialize( self, instance_ids, @@ -1065,8 +995,8 @@ def _list_instance_events_serialize( _host = None _collection_formats: Dict[str, str] = { - "instance_ids": "multi", - "types": "multi", + 'instance_ids': 'multi', + 'types': 'multi', } _path_params: Dict[str, str] = {} @@ -1081,39 +1011,47 @@ def _list_instance_events_serialize( # process the path parameters # process the query parameters if instance_ids is not None: - - _query_params.append(("instance_ids", instance_ids)) - + + _query_params.append(('instance_ids', instance_ids)) + if types is not None: - - _query_params.append(("types", types)) - + + _query_params.append(('types', types)) + if limit is not None: - - _query_params.append(("limit", limit)) - + + _query_params.append(('limit', limit)) + if offset is not None: - - _query_params.append(("offset", offset)) - + + _query_params.append(('offset', offset)) + if order is not None: - - _query_params.append(("order", order)) - + + _query_params.append(('order', order)) + # process the header parameters # process the form parameters # process the body parameter + # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept(["*/*"]) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + '*/*' + ] + ) + # authentication setting - _auth_settings: List[str] = ["Bearer"] + _auth_settings: List[str] = [ + 'Bearer' + ] return self.api_client.param_serialize( - method="GET", - resource_path="/v1/instance_events", + method='GET', + resource_path='/v1/instance_events', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -1123,68 +1061,34 @@ def _list_instance_events_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth, + _request_auth=_request_auth ) + + + @validate_call def list_instances( self, - app_id: Annotated[ - Optional[StrictStr], - Field(description="(Optional) Filter on application id"), - ] = None, - service_id: Annotated[ - Optional[StrictStr], Field(description="(Optional) Filter on service id") - ] = None, - deployment_id: Annotated[ - Optional[StrictStr], Field(description="(Optional) Filter on deployment id") - ] = None, - regional_deployment_id: Annotated[ - Optional[StrictStr], - Field(description="(Optional) Filter on regional deployment id"), - ] = None, - allocation_id: Annotated[ - Optional[StrictStr], Field(description="(Optional) Filter on allocation id") - ] = None, - replica_index: Annotated[ - Optional[StrictStr], Field(description="(Optional) Filter on replica index") - ] = None, - statuses: Annotated[ - Optional[List[StrictStr]], - Field(description="(Optional) Filter on instance statuses"), - ] = None, - limit: Annotated[ - Optional[StrictStr], - Field(description="(Optional) The number of items to return"), - ] = None, - offset: Annotated[ - Optional[StrictStr], - Field(description="(Optional) The offset in the list of item to return"), - ] = None, - order: Annotated[ - Optional[StrictStr], - Field( - description="(Optional) Sorts the list in the ascending or the descending order" - ), - ] = None, - starting_time: Annotated[ - Optional[datetime], - Field( - description="(Optional) The starting time of the period of running instance" - ), - ] = None, - ending_time: Annotated[ - Optional[datetime], - Field( - description="(Optional) The ending time of the period of running instance" - ), - ] = None, + app_id: Annotated[Optional[StrictStr], Field(description="(Optional) Filter on application id")] = None, + service_id: Annotated[Optional[StrictStr], Field(description="(Optional) Filter on service id")] = None, + deployment_id: Annotated[Optional[StrictStr], Field(description="(Optional) Filter on deployment id")] = None, + regional_deployment_id: Annotated[Optional[StrictStr], Field(description="(Optional) Filter on regional deployment id")] = None, + allocation_id: Annotated[Optional[StrictStr], Field(description="(Optional) Filter on allocation id")] = None, + replica_index: Annotated[Optional[StrictStr], Field(description="(Optional) Filter on replica index")] = None, + statuses: Annotated[Optional[List[StrictStr]], Field(description="(Optional) Filter on instance statuses")] = None, + limit: Annotated[Optional[StrictStr], Field(description="(Optional) The number of items to return")] = None, + offset: Annotated[Optional[StrictStr], Field(description="(Optional) The offset in the list of item to return")] = None, + order: Annotated[Optional[StrictStr], Field(description="(Optional) Sorts the list in the ascending or the descending order")] = None, + starting_time: Annotated[Optional[datetime], Field(description="(Optional) The starting time of the period of running instance")] = None, + ending_time: Annotated[Optional[datetime], Field(description="(Optional) The ending time of the period of running instance")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -1238,7 +1142,7 @@ def list_instances( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._list_instances_serialize( app_id=app_id, @@ -1256,20 +1160,21 @@ def list_instances( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ListInstancesReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "ListInstancesReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -1277,65 +1182,29 @@ def list_instances( response_types_map=_response_types_map, ).data + @validate_call def list_instances_with_http_info( self, - app_id: Annotated[ - Optional[StrictStr], - Field(description="(Optional) Filter on application id"), - ] = None, - service_id: Annotated[ - Optional[StrictStr], Field(description="(Optional) Filter on service id") - ] = None, - deployment_id: Annotated[ - Optional[StrictStr], Field(description="(Optional) Filter on deployment id") - ] = None, - regional_deployment_id: Annotated[ - Optional[StrictStr], - Field(description="(Optional) Filter on regional deployment id"), - ] = None, - allocation_id: Annotated[ - Optional[StrictStr], Field(description="(Optional) Filter on allocation id") - ] = None, - replica_index: Annotated[ - Optional[StrictStr], Field(description="(Optional) Filter on replica index") - ] = None, - statuses: Annotated[ - Optional[List[StrictStr]], - Field(description="(Optional) Filter on instance statuses"), - ] = None, - limit: Annotated[ - Optional[StrictStr], - Field(description="(Optional) The number of items to return"), - ] = None, - offset: Annotated[ - Optional[StrictStr], - Field(description="(Optional) The offset in the list of item to return"), - ] = None, - order: Annotated[ - Optional[StrictStr], - Field( - description="(Optional) Sorts the list in the ascending or the descending order" - ), - ] = None, - starting_time: Annotated[ - Optional[datetime], - Field( - description="(Optional) The starting time of the period of running instance" - ), - ] = None, - ending_time: Annotated[ - Optional[datetime], - Field( - description="(Optional) The ending time of the period of running instance" - ), - ] = None, + app_id: Annotated[Optional[StrictStr], Field(description="(Optional) Filter on application id")] = None, + service_id: Annotated[Optional[StrictStr], Field(description="(Optional) Filter on service id")] = None, + deployment_id: Annotated[Optional[StrictStr], Field(description="(Optional) Filter on deployment id")] = None, + regional_deployment_id: Annotated[Optional[StrictStr], Field(description="(Optional) Filter on regional deployment id")] = None, + allocation_id: Annotated[Optional[StrictStr], Field(description="(Optional) Filter on allocation id")] = None, + replica_index: Annotated[Optional[StrictStr], Field(description="(Optional) Filter on replica index")] = None, + statuses: Annotated[Optional[List[StrictStr]], Field(description="(Optional) Filter on instance statuses")] = None, + limit: Annotated[Optional[StrictStr], Field(description="(Optional) The number of items to return")] = None, + offset: Annotated[Optional[StrictStr], Field(description="(Optional) The offset in the list of item to return")] = None, + order: Annotated[Optional[StrictStr], Field(description="(Optional) Sorts the list in the ascending or the descending order")] = None, + starting_time: Annotated[Optional[datetime], Field(description="(Optional) The starting time of the period of running instance")] = None, + ending_time: Annotated[Optional[datetime], Field(description="(Optional) The ending time of the period of running instance")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -1389,7 +1258,7 @@ def list_instances_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._list_instances_serialize( app_id=app_id, @@ -1407,20 +1276,21 @@ def list_instances_with_http_info( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ListInstancesReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "ListInstancesReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -1428,65 +1298,29 @@ def list_instances_with_http_info( response_types_map=_response_types_map, ) + @validate_call def list_instances_without_preload_content( self, - app_id: Annotated[ - Optional[StrictStr], - Field(description="(Optional) Filter on application id"), - ] = None, - service_id: Annotated[ - Optional[StrictStr], Field(description="(Optional) Filter on service id") - ] = None, - deployment_id: Annotated[ - Optional[StrictStr], Field(description="(Optional) Filter on deployment id") - ] = None, - regional_deployment_id: Annotated[ - Optional[StrictStr], - Field(description="(Optional) Filter on regional deployment id"), - ] = None, - allocation_id: Annotated[ - Optional[StrictStr], Field(description="(Optional) Filter on allocation id") - ] = None, - replica_index: Annotated[ - Optional[StrictStr], Field(description="(Optional) Filter on replica index") - ] = None, - statuses: Annotated[ - Optional[List[StrictStr]], - Field(description="(Optional) Filter on instance statuses"), - ] = None, - limit: Annotated[ - Optional[StrictStr], - Field(description="(Optional) The number of items to return"), - ] = None, - offset: Annotated[ - Optional[StrictStr], - Field(description="(Optional) The offset in the list of item to return"), - ] = None, - order: Annotated[ - Optional[StrictStr], - Field( - description="(Optional) Sorts the list in the ascending or the descending order" - ), - ] = None, - starting_time: Annotated[ - Optional[datetime], - Field( - description="(Optional) The starting time of the period of running instance" - ), - ] = None, - ending_time: Annotated[ - Optional[datetime], - Field( - description="(Optional) The ending time of the period of running instance" - ), - ] = None, + app_id: Annotated[Optional[StrictStr], Field(description="(Optional) Filter on application id")] = None, + service_id: Annotated[Optional[StrictStr], Field(description="(Optional) Filter on service id")] = None, + deployment_id: Annotated[Optional[StrictStr], Field(description="(Optional) Filter on deployment id")] = None, + regional_deployment_id: Annotated[Optional[StrictStr], Field(description="(Optional) Filter on regional deployment id")] = None, + allocation_id: Annotated[Optional[StrictStr], Field(description="(Optional) Filter on allocation id")] = None, + replica_index: Annotated[Optional[StrictStr], Field(description="(Optional) Filter on replica index")] = None, + statuses: Annotated[Optional[List[StrictStr]], Field(description="(Optional) Filter on instance statuses")] = None, + limit: Annotated[Optional[StrictStr], Field(description="(Optional) The number of items to return")] = None, + offset: Annotated[Optional[StrictStr], Field(description="(Optional) The offset in the list of item to return")] = None, + order: Annotated[Optional[StrictStr], Field(description="(Optional) Sorts the list in the ascending or the descending order")] = None, + starting_time: Annotated[Optional[datetime], Field(description="(Optional) The starting time of the period of running instance")] = None, + ending_time: Annotated[Optional[datetime], Field(description="(Optional) The ending time of the period of running instance")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -1540,7 +1374,7 @@ def list_instances_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._list_instances_serialize( app_id=app_id, @@ -1558,23 +1392,25 @@ def list_instances_without_preload_content( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ListInstancesReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "ListInstancesReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) return response_data.response + def _list_instances_serialize( self, app_id, @@ -1598,7 +1434,7 @@ def _list_instances_serialize( _host = None _collection_formats: Dict[str, str] = { - "statuses": "multi", + 'statuses': 'multi', } _path_params: Dict[str, str] = {} @@ -1613,85 +1449,93 @@ def _list_instances_serialize( # process the path parameters # process the query parameters if app_id is not None: - - _query_params.append(("app_id", app_id)) - + + _query_params.append(('app_id', app_id)) + if service_id is not None: - - _query_params.append(("service_id", service_id)) - + + _query_params.append(('service_id', service_id)) + if deployment_id is not None: - - _query_params.append(("deployment_id", deployment_id)) - + + _query_params.append(('deployment_id', deployment_id)) + if regional_deployment_id is not None: - - _query_params.append(("regional_deployment_id", regional_deployment_id)) - + + _query_params.append(('regional_deployment_id', regional_deployment_id)) + if allocation_id is not None: - - _query_params.append(("allocation_id", allocation_id)) - + + _query_params.append(('allocation_id', allocation_id)) + if replica_index is not None: - - _query_params.append(("replica_index", replica_index)) - + + _query_params.append(('replica_index', replica_index)) + if statuses is not None: - - _query_params.append(("statuses", statuses)) - + + _query_params.append(('statuses', statuses)) + if limit is not None: - - _query_params.append(("limit", limit)) - + + _query_params.append(('limit', limit)) + if offset is not None: - - _query_params.append(("offset", offset)) - + + _query_params.append(('offset', offset)) + if order is not None: - - _query_params.append(("order", order)) - + + _query_params.append(('order', order)) + if starting_time is not None: if isinstance(starting_time, datetime): _query_params.append( ( - "starting_time", + 'starting_time', starting_time.strftime( self.api_client.configuration.datetime_format - ), + ) ) ) else: - _query_params.append(("starting_time", starting_time)) - + _query_params.append(('starting_time', starting_time)) + if ending_time is not None: if isinstance(ending_time, datetime): _query_params.append( ( - "ending_time", + 'ending_time', ending_time.strftime( self.api_client.configuration.datetime_format - ), + ) ) ) else: - _query_params.append(("ending_time", ending_time)) - + _query_params.append(('ending_time', ending_time)) + # process the header parameters # process the form parameters # process the body parameter + # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept(["*/*"]) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + '*/*' + ] + ) + # authentication setting - _auth_settings: List[str] = ["Bearer"] + _auth_settings: List[str] = [ + 'Bearer' + ] return self.api_client.param_serialize( - method="GET", - resource_path="/v1/instances", + method='GET', + resource_path='/v1/instances', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -1701,5 +1545,7 @@ def _list_instances_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth, + _request_auth=_request_auth ) + + diff --git a/koyeb/api/api/intercom_api.py b/koyeb/api/api/intercom_api.py index dec620ec..1164e2e1 100644 --- a/koyeb/api/api/intercom_api.py +++ b/koyeb/api/api/intercom_api.py @@ -1,16 +1,15 @@ -# coding: utf-8 - """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 + import warnings from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt from typing import Any, Dict, List, Optional, Tuple, Union @@ -35,6 +34,7 @@ def __init__(self, api_client=None) -> None: api_client = ApiClient.get_default() self.api_client = api_client + @validate_call def get_intercom_profile( self, @@ -42,8 +42,9 @@ def get_intercom_profile( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -73,26 +74,27 @@ def get_intercom_profile( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._get_intercom_profile_serialize( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "GetIntercomProfileReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "GetIntercomProfileReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -100,6 +102,7 @@ def get_intercom_profile( response_types_map=_response_types_map, ).data + @validate_call def get_intercom_profile_with_http_info( self, @@ -107,8 +110,9 @@ def get_intercom_profile_with_http_info( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -138,26 +142,27 @@ def get_intercom_profile_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._get_intercom_profile_serialize( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "GetIntercomProfileReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "GetIntercomProfileReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -165,6 +170,7 @@ def get_intercom_profile_with_http_info( response_types_map=_response_types_map, ) + @validate_call def get_intercom_profile_without_preload_content( self, @@ -172,8 +178,9 @@ def get_intercom_profile_without_preload_content( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -203,29 +210,31 @@ def get_intercom_profile_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._get_intercom_profile_serialize( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "GetIntercomProfileReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "GetIntercomProfileReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) return response_data.response + def _get_intercom_profile_serialize( self, _request_auth, @@ -236,7 +245,8 @@ def _get_intercom_profile_serialize( _host = None - _collection_formats: Dict[str, str] = {} + _collection_formats: Dict[str, str] = { + } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -253,16 +263,24 @@ def _get_intercom_profile_serialize( # process the form parameters # process the body parameter + # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept(["*/*"]) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + '*/*' + ] + ) + # authentication setting - _auth_settings: List[str] = ["Bearer"] + _auth_settings: List[str] = [ + 'Bearer' + ] return self.api_client.param_serialize( - method="GET", - resource_path="/v1/intercom/profile", + method='GET', + resource_path='/v1/intercom/profile', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -272,5 +290,7 @@ def _get_intercom_profile_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth, + _request_auth=_request_auth ) + + diff --git a/koyeb/api/api/invite_api.py b/koyeb/api/api/invite_api.py index 8e6a7f5f..63971cd1 100644 --- a/koyeb/api/api/invite_api.py +++ b/koyeb/api/api/invite_api.py @@ -1,16 +1,15 @@ -# coding: utf-8 - """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 + import warnings from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt from typing import Any, Dict, List, Optional, Tuple, Union @@ -36,6 +35,7 @@ def __init__(self, api_client=None) -> None: api_client = ApiClient.get_default() self.api_client = api_client + @validate_call def create_invite( self, @@ -44,8 +44,9 @@ def create_invite( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -77,27 +78,28 @@ def create_invite( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._create_invite_serialize( body=body, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "object", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "object", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -105,6 +107,7 @@ def create_invite( response_types_map=_response_types_map, ).data + @validate_call def create_invite_with_http_info( self, @@ -113,8 +116,9 @@ def create_invite_with_http_info( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -146,27 +150,28 @@ def create_invite_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._create_invite_serialize( body=body, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "object", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "object", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -174,6 +179,7 @@ def create_invite_with_http_info( response_types_map=_response_types_map, ) + @validate_call def create_invite_without_preload_content( self, @@ -182,8 +188,9 @@ def create_invite_without_preload_content( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -215,30 +222,32 @@ def create_invite_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._create_invite_serialize( body=body, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "object", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "object", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) return response_data.response + def _create_invite_serialize( self, body, @@ -250,7 +259,8 @@ def _create_invite_serialize( _host = None - _collection_formats: Dict[str, str] = {} + _collection_formats: Dict[str, str] = { + } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -269,16 +279,24 @@ def _create_invite_serialize( if body is not None: _body_params = body + # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept(["*/*"]) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + '*/*' + ] + ) + # authentication setting - _auth_settings: List[str] = ["Bearer"] + _auth_settings: List[str] = [ + 'Bearer' + ] return self.api_client.param_serialize( - method="POST", - resource_path="/v1/account/invite", + method='POST', + resource_path='/v1/account/invite', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -288,5 +306,7 @@ def _create_invite_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth, + _request_auth=_request_auth ) + + diff --git a/koyeb/api/api/logs_api.py b/koyeb/api/api/logs_api.py index af741a0f..d7c98d0f 100644 --- a/koyeb/api/api/logs_api.py +++ b/koyeb/api/api/logs_api.py @@ -1,16 +1,15 @@ -# coding: utf-8 - """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 + import warnings from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt from typing import Any, Dict, List, Optional, Tuple, Union @@ -40,103 +39,33 @@ def __init__(self, api_client=None) -> None: api_client = ApiClient.get_default() self.api_client = api_client + @validate_call def query_logs( self, - type: Annotated[ - Optional[StrictStr], - Field( - description='Type of logs to retrieve, either "build" or "runtime". Defaults to "runtime".' - ), - ] = None, - app_id: Annotated[ - Optional[StrictStr], - Field( - description="(Optional) Filter on the provided app_id. At least one of app_id, service_id, deployment_id, regional_deployment_id or instance_ids must be set." - ), - ] = None, - service_id: Annotated[ - Optional[StrictStr], - Field( - description="(Optional) Filter on the provided service_id. At least one of app_id, service_id, deployment_id, regional_deployment_id or instance_ids must be set." - ), - ] = None, - deployment_id: Annotated[ - Optional[StrictStr], - Field( - description="(Optional) Filter on the provided deployment_id. At least one of app_id, service_id, deployment_id, regional_deployment_id or instance_ids must be set." - ), - ] = None, - regional_deployment_id: Annotated[ - Optional[StrictStr], - Field( - description="(Optional) Filter on the provided regional_deployment_id. At least one of app_id, service_id, deployment_id, regional_deployment_id or instance_ids must be set." - ), - ] = None, - instance_id: Annotated[ - Optional[StrictStr], - Field(description="Deprecated, prefer using instance_ids instead."), - ] = None, - instance_ids: Annotated[ - Optional[List[StrictStr]], - Field( - description="(Optional) Filter on the provided instance_ids. At least one of app_id, service_id, deployment_id, regional_deployment_id or instance_ids must be set." - ), - ] = None, - stream: Annotated[ - Optional[StrictStr], - Field(description="Deprecated, prefer using streams instead."), - ] = None, - streams: Annotated[ - Optional[List[StrictStr]], - Field( - description='(Optional) Filter on stream: either "stdout", "stderr" or "koyeb" (for system logs).' - ), - ] = None, - start: Annotated[ - Optional[datetime], - Field( - description="(Optional) Must always be before `end`. Defaults to 15 minutes ago." - ), - ] = None, - end: Annotated[ - Optional[datetime], - Field( - description="(Optional) Must always be after `start`. Defaults to now." - ), - ] = None, - order: Annotated[ - Optional[StrictStr], - Field(description="(Optional) `asc` or `desc`. Defaults to `desc`."), - ] = None, - limit: Annotated[ - Optional[StrictStr], - Field(description="(Optional) Defaults to 100. Maximum of 1000."), - ] = None, - regex: Annotated[ - Optional[StrictStr], - Field( - description="(Optional) Apply a regex to filter logs. Can't be used with `text`." - ), - ] = None, - text: Annotated[ - Optional[StrictStr], - Field( - description="(Optional) Looks for this string in logs. Can't be used with `regex`." - ), - ] = None, - regions: Annotated[ - Optional[List[StrictStr]], - Field( - description='(Optional) Filter on the provided regions (e.g. ["fra", "was"]).' - ), - ] = None, + type: Annotated[Optional[StrictStr], Field(description="Type of logs to retrieve, either \"build\" or \"runtime\". Defaults to \"runtime\".")] = None, + app_id: Annotated[Optional[StrictStr], Field(description="(Optional) Filter on the provided app_id. At least one of app_id, service_id, deployment_id, regional_deployment_id or instance_ids must be set.")] = None, + service_id: Annotated[Optional[StrictStr], Field(description="(Optional) Filter on the provided service_id. At least one of app_id, service_id, deployment_id, regional_deployment_id or instance_ids must be set.")] = None, + deployment_id: Annotated[Optional[StrictStr], Field(description="(Optional) Filter on the provided deployment_id. At least one of app_id, service_id, deployment_id, regional_deployment_id or instance_ids must be set.")] = None, + regional_deployment_id: Annotated[Optional[StrictStr], Field(description="(Optional) Filter on the provided regional_deployment_id. At least one of app_id, service_id, deployment_id, regional_deployment_id or instance_ids must be set.")] = None, + instance_id: Annotated[Optional[StrictStr], Field(description="Deprecated, prefer using instance_ids instead.")] = None, + instance_ids: Annotated[Optional[List[StrictStr]], Field(description="(Optional) Filter on the provided instance_ids. At least one of app_id, service_id, deployment_id, regional_deployment_id or instance_ids must be set.")] = None, + stream: Annotated[Optional[StrictStr], Field(description="Deprecated, prefer using streams instead.")] = None, + streams: Annotated[Optional[List[StrictStr]], Field(description="(Optional) Filter on stream: either \"stdout\", \"stderr\" or \"koyeb\" (for system logs).")] = None, + start: Annotated[Optional[datetime], Field(description="(Optional) Must always be before `end`. Defaults to 15 minutes ago.")] = None, + end: Annotated[Optional[datetime], Field(description="(Optional) Must always be after `start`. Defaults to now.")] = None, + order: Annotated[Optional[StrictStr], Field(description="(Optional) `asc` or `desc`. Defaults to `desc`.")] = None, + limit: Annotated[Optional[StrictStr], Field(description="(Optional) Defaults to 100. Maximum of 1000.")] = None, + regex: Annotated[Optional[StrictStr], Field(description="(Optional) Apply a regex to filter logs. Can't be used with `text`.")] = None, + text: Annotated[Optional[StrictStr], Field(description="(Optional) Looks for this string in logs. Can't be used with `regex`.")] = None, + regions: Annotated[Optional[List[StrictStr]], Field(description="(Optional) Filter on the provided regions (e.g. [\"fra\", \"was\"]).")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -198,7 +127,7 @@ def query_logs( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._query_logs_serialize( type=type, @@ -220,20 +149,21 @@ def query_logs( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "QueryLogsReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "QueryLogsReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -241,103 +171,33 @@ def query_logs( response_types_map=_response_types_map, ).data + @validate_call def query_logs_with_http_info( self, - type: Annotated[ - Optional[StrictStr], - Field( - description='Type of logs to retrieve, either "build" or "runtime". Defaults to "runtime".' - ), - ] = None, - app_id: Annotated[ - Optional[StrictStr], - Field( - description="(Optional) Filter on the provided app_id. At least one of app_id, service_id, deployment_id, regional_deployment_id or instance_ids must be set." - ), - ] = None, - service_id: Annotated[ - Optional[StrictStr], - Field( - description="(Optional) Filter on the provided service_id. At least one of app_id, service_id, deployment_id, regional_deployment_id or instance_ids must be set." - ), - ] = None, - deployment_id: Annotated[ - Optional[StrictStr], - Field( - description="(Optional) Filter on the provided deployment_id. At least one of app_id, service_id, deployment_id, regional_deployment_id or instance_ids must be set." - ), - ] = None, - regional_deployment_id: Annotated[ - Optional[StrictStr], - Field( - description="(Optional) Filter on the provided regional_deployment_id. At least one of app_id, service_id, deployment_id, regional_deployment_id or instance_ids must be set." - ), - ] = None, - instance_id: Annotated[ - Optional[StrictStr], - Field(description="Deprecated, prefer using instance_ids instead."), - ] = None, - instance_ids: Annotated[ - Optional[List[StrictStr]], - Field( - description="(Optional) Filter on the provided instance_ids. At least one of app_id, service_id, deployment_id, regional_deployment_id or instance_ids must be set." - ), - ] = None, - stream: Annotated[ - Optional[StrictStr], - Field(description="Deprecated, prefer using streams instead."), - ] = None, - streams: Annotated[ - Optional[List[StrictStr]], - Field( - description='(Optional) Filter on stream: either "stdout", "stderr" or "koyeb" (for system logs).' - ), - ] = None, - start: Annotated[ - Optional[datetime], - Field( - description="(Optional) Must always be before `end`. Defaults to 15 minutes ago." - ), - ] = None, - end: Annotated[ - Optional[datetime], - Field( - description="(Optional) Must always be after `start`. Defaults to now." - ), - ] = None, - order: Annotated[ - Optional[StrictStr], - Field(description="(Optional) `asc` or `desc`. Defaults to `desc`."), - ] = None, - limit: Annotated[ - Optional[StrictStr], - Field(description="(Optional) Defaults to 100. Maximum of 1000."), - ] = None, - regex: Annotated[ - Optional[StrictStr], - Field( - description="(Optional) Apply a regex to filter logs. Can't be used with `text`." - ), - ] = None, - text: Annotated[ - Optional[StrictStr], - Field( - description="(Optional) Looks for this string in logs. Can't be used with `regex`." - ), - ] = None, - regions: Annotated[ - Optional[List[StrictStr]], - Field( - description='(Optional) Filter on the provided regions (e.g. ["fra", "was"]).' - ), - ] = None, + type: Annotated[Optional[StrictStr], Field(description="Type of logs to retrieve, either \"build\" or \"runtime\". Defaults to \"runtime\".")] = None, + app_id: Annotated[Optional[StrictStr], Field(description="(Optional) Filter on the provided app_id. At least one of app_id, service_id, deployment_id, regional_deployment_id or instance_ids must be set.")] = None, + service_id: Annotated[Optional[StrictStr], Field(description="(Optional) Filter on the provided service_id. At least one of app_id, service_id, deployment_id, regional_deployment_id or instance_ids must be set.")] = None, + deployment_id: Annotated[Optional[StrictStr], Field(description="(Optional) Filter on the provided deployment_id. At least one of app_id, service_id, deployment_id, regional_deployment_id or instance_ids must be set.")] = None, + regional_deployment_id: Annotated[Optional[StrictStr], Field(description="(Optional) Filter on the provided regional_deployment_id. At least one of app_id, service_id, deployment_id, regional_deployment_id or instance_ids must be set.")] = None, + instance_id: Annotated[Optional[StrictStr], Field(description="Deprecated, prefer using instance_ids instead.")] = None, + instance_ids: Annotated[Optional[List[StrictStr]], Field(description="(Optional) Filter on the provided instance_ids. At least one of app_id, service_id, deployment_id, regional_deployment_id or instance_ids must be set.")] = None, + stream: Annotated[Optional[StrictStr], Field(description="Deprecated, prefer using streams instead.")] = None, + streams: Annotated[Optional[List[StrictStr]], Field(description="(Optional) Filter on stream: either \"stdout\", \"stderr\" or \"koyeb\" (for system logs).")] = None, + start: Annotated[Optional[datetime], Field(description="(Optional) Must always be before `end`. Defaults to 15 minutes ago.")] = None, + end: Annotated[Optional[datetime], Field(description="(Optional) Must always be after `start`. Defaults to now.")] = None, + order: Annotated[Optional[StrictStr], Field(description="(Optional) `asc` or `desc`. Defaults to `desc`.")] = None, + limit: Annotated[Optional[StrictStr], Field(description="(Optional) Defaults to 100. Maximum of 1000.")] = None, + regex: Annotated[Optional[StrictStr], Field(description="(Optional) Apply a regex to filter logs. Can't be used with `text`.")] = None, + text: Annotated[Optional[StrictStr], Field(description="(Optional) Looks for this string in logs. Can't be used with `regex`.")] = None, + regions: Annotated[Optional[List[StrictStr]], Field(description="(Optional) Filter on the provided regions (e.g. [\"fra\", \"was\"]).")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -399,7 +259,7 @@ def query_logs_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._query_logs_serialize( type=type, @@ -421,20 +281,21 @@ def query_logs_with_http_info( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "QueryLogsReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "QueryLogsReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -442,103 +303,33 @@ def query_logs_with_http_info( response_types_map=_response_types_map, ) + @validate_call def query_logs_without_preload_content( self, - type: Annotated[ - Optional[StrictStr], - Field( - description='Type of logs to retrieve, either "build" or "runtime". Defaults to "runtime".' - ), - ] = None, - app_id: Annotated[ - Optional[StrictStr], - Field( - description="(Optional) Filter on the provided app_id. At least one of app_id, service_id, deployment_id, regional_deployment_id or instance_ids must be set." - ), - ] = None, - service_id: Annotated[ - Optional[StrictStr], - Field( - description="(Optional) Filter on the provided service_id. At least one of app_id, service_id, deployment_id, regional_deployment_id or instance_ids must be set." - ), - ] = None, - deployment_id: Annotated[ - Optional[StrictStr], - Field( - description="(Optional) Filter on the provided deployment_id. At least one of app_id, service_id, deployment_id, regional_deployment_id or instance_ids must be set." - ), - ] = None, - regional_deployment_id: Annotated[ - Optional[StrictStr], - Field( - description="(Optional) Filter on the provided regional_deployment_id. At least one of app_id, service_id, deployment_id, regional_deployment_id or instance_ids must be set." - ), - ] = None, - instance_id: Annotated[ - Optional[StrictStr], - Field(description="Deprecated, prefer using instance_ids instead."), - ] = None, - instance_ids: Annotated[ - Optional[List[StrictStr]], - Field( - description="(Optional) Filter on the provided instance_ids. At least one of app_id, service_id, deployment_id, regional_deployment_id or instance_ids must be set." - ), - ] = None, - stream: Annotated[ - Optional[StrictStr], - Field(description="Deprecated, prefer using streams instead."), - ] = None, - streams: Annotated[ - Optional[List[StrictStr]], - Field( - description='(Optional) Filter on stream: either "stdout", "stderr" or "koyeb" (for system logs).' - ), - ] = None, - start: Annotated[ - Optional[datetime], - Field( - description="(Optional) Must always be before `end`. Defaults to 15 minutes ago." - ), - ] = None, - end: Annotated[ - Optional[datetime], - Field( - description="(Optional) Must always be after `start`. Defaults to now." - ), - ] = None, - order: Annotated[ - Optional[StrictStr], - Field(description="(Optional) `asc` or `desc`. Defaults to `desc`."), - ] = None, - limit: Annotated[ - Optional[StrictStr], - Field(description="(Optional) Defaults to 100. Maximum of 1000."), - ] = None, - regex: Annotated[ - Optional[StrictStr], - Field( - description="(Optional) Apply a regex to filter logs. Can't be used with `text`." - ), - ] = None, - text: Annotated[ - Optional[StrictStr], - Field( - description="(Optional) Looks for this string in logs. Can't be used with `regex`." - ), - ] = None, - regions: Annotated[ - Optional[List[StrictStr]], - Field( - description='(Optional) Filter on the provided regions (e.g. ["fra", "was"]).' - ), - ] = None, + type: Annotated[Optional[StrictStr], Field(description="Type of logs to retrieve, either \"build\" or \"runtime\". Defaults to \"runtime\".")] = None, + app_id: Annotated[Optional[StrictStr], Field(description="(Optional) Filter on the provided app_id. At least one of app_id, service_id, deployment_id, regional_deployment_id or instance_ids must be set.")] = None, + service_id: Annotated[Optional[StrictStr], Field(description="(Optional) Filter on the provided service_id. At least one of app_id, service_id, deployment_id, regional_deployment_id or instance_ids must be set.")] = None, + deployment_id: Annotated[Optional[StrictStr], Field(description="(Optional) Filter on the provided deployment_id. At least one of app_id, service_id, deployment_id, regional_deployment_id or instance_ids must be set.")] = None, + regional_deployment_id: Annotated[Optional[StrictStr], Field(description="(Optional) Filter on the provided regional_deployment_id. At least one of app_id, service_id, deployment_id, regional_deployment_id or instance_ids must be set.")] = None, + instance_id: Annotated[Optional[StrictStr], Field(description="Deprecated, prefer using instance_ids instead.")] = None, + instance_ids: Annotated[Optional[List[StrictStr]], Field(description="(Optional) Filter on the provided instance_ids. At least one of app_id, service_id, deployment_id, regional_deployment_id or instance_ids must be set.")] = None, + stream: Annotated[Optional[StrictStr], Field(description="Deprecated, prefer using streams instead.")] = None, + streams: Annotated[Optional[List[StrictStr]], Field(description="(Optional) Filter on stream: either \"stdout\", \"stderr\" or \"koyeb\" (for system logs).")] = None, + start: Annotated[Optional[datetime], Field(description="(Optional) Must always be before `end`. Defaults to 15 minutes ago.")] = None, + end: Annotated[Optional[datetime], Field(description="(Optional) Must always be after `start`. Defaults to now.")] = None, + order: Annotated[Optional[StrictStr], Field(description="(Optional) `asc` or `desc`. Defaults to `desc`.")] = None, + limit: Annotated[Optional[StrictStr], Field(description="(Optional) Defaults to 100. Maximum of 1000.")] = None, + regex: Annotated[Optional[StrictStr], Field(description="(Optional) Apply a regex to filter logs. Can't be used with `text`.")] = None, + text: Annotated[Optional[StrictStr], Field(description="(Optional) Looks for this string in logs. Can't be used with `regex`.")] = None, + regions: Annotated[Optional[List[StrictStr]], Field(description="(Optional) Filter on the provided regions (e.g. [\"fra\", \"was\"]).")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -600,7 +391,7 @@ def query_logs_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._query_logs_serialize( type=type, @@ -622,23 +413,25 @@ def query_logs_without_preload_content( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "QueryLogsReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "QueryLogsReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) return response_data.response + def _query_logs_serialize( self, type, @@ -666,9 +459,9 @@ def _query_logs_serialize( _host = None _collection_formats: Dict[str, str] = { - "instance_ids": "multi", - "streams": "multi", - "regions": "multi", + 'instance_ids': 'multi', + 'streams': 'multi', + 'regions': 'multi', } _path_params: Dict[str, str] = {} @@ -683,94 +476,109 @@ def _query_logs_serialize( # process the path parameters # process the query parameters if type is not None: - - _query_params.append(("type", type)) - + + _query_params.append(('type', type)) + if app_id is not None: - - _query_params.append(("app_id", app_id)) - + + _query_params.append(('app_id', app_id)) + if service_id is not None: - - _query_params.append(("service_id", service_id)) - + + _query_params.append(('service_id', service_id)) + if deployment_id is not None: - - _query_params.append(("deployment_id", deployment_id)) - + + _query_params.append(('deployment_id', deployment_id)) + if regional_deployment_id is not None: - - _query_params.append(("regional_deployment_id", regional_deployment_id)) - + + _query_params.append(('regional_deployment_id', regional_deployment_id)) + if instance_id is not None: - - _query_params.append(("instance_id", instance_id)) - + + _query_params.append(('instance_id', instance_id)) + if instance_ids is not None: - - _query_params.append(("instance_ids", instance_ids)) - + + _query_params.append(('instance_ids', instance_ids)) + if stream is not None: - - _query_params.append(("stream", stream)) - + + _query_params.append(('stream', stream)) + if streams is not None: - - _query_params.append(("streams", streams)) - + + _query_params.append(('streams', streams)) + if start is not None: if isinstance(start, datetime): _query_params.append( ( - "start", - start.strftime(self.api_client.configuration.datetime_format), + 'start', + start.strftime( + self.api_client.configuration.datetime_format + ) ) ) else: - _query_params.append(("start", start)) - + _query_params.append(('start', start)) + if end is not None: if isinstance(end, datetime): _query_params.append( - ("end", end.strftime(self.api_client.configuration.datetime_format)) + ( + 'end', + end.strftime( + self.api_client.configuration.datetime_format + ) + ) ) else: - _query_params.append(("end", end)) - + _query_params.append(('end', end)) + if order is not None: - - _query_params.append(("order", order)) - + + _query_params.append(('order', order)) + if limit is not None: - - _query_params.append(("limit", limit)) - + + _query_params.append(('limit', limit)) + if regex is not None: - - _query_params.append(("regex", regex)) - + + _query_params.append(('regex', regex)) + if text is not None: - - _query_params.append(("text", text)) - + + _query_params.append(('text', text)) + if regions is not None: - - _query_params.append(("regions", regions)) - + + _query_params.append(('regions', regions)) + # process the header parameters # process the form parameters # process the body parameter + # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept(["*/*"]) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + '*/*' + ] + ) + # authentication setting - _auth_settings: List[str] = ["Bearer"] + _auth_settings: List[str] = [ + 'Bearer' + ] return self.api_client.param_serialize( - method="GET", - resource_path="/v1/streams/logs/query", + method='GET', + resource_path='/v1/streams/logs/query', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -780,94 +588,36 @@ def _query_logs_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth, + _request_auth=_request_auth ) + + + @validate_call def tail_logs( self, - type: Annotated[ - Optional[StrictStr], - Field( - description='Type of logs to retrieve, either "build" or "runtime". Defaults to "runtime".' - ), - ] = None, - app_id: Annotated[ - Optional[StrictStr], - Field( - description="(Optional) Filter on the provided app_id. At least one of app_id, service_id, deployment_id, regional_deployment_id or instance_ids must be set." - ), - ] = None, - service_id: Annotated[ - Optional[StrictStr], - Field( - description="(Optional) Filter on the provided service_id. At least one of app_id, service_id, deployment_id, regional_deployment_id or instance_ids must be set." - ), - ] = None, - deployment_id: Annotated[ - Optional[StrictStr], - Field( - description="(Optional) Filter on the provided deployment_id. At least one of app_id, service_id, deployment_id, regional_deployment_id or instance_ids must be set." - ), - ] = None, - regional_deployment_id: Annotated[ - Optional[StrictStr], - Field( - description="(Optional) Filter on the provided regional_deployment_id. At least one of app_id, service_id, deployment_id, regional_deployment_id or instance_ids must be set." - ), - ] = None, - instance_id: Annotated[ - Optional[StrictStr], - Field(description="Deprecated, prefer using instance_ids instead."), - ] = None, - instance_ids: Annotated[ - Optional[List[StrictStr]], - Field( - description="(Optional) Filter on the provided instance_ids. At least one of app_id, service_id, deployment_id, regional_deployment_id or instance_ids must be set." - ), - ] = None, - stream: Annotated[ - Optional[StrictStr], - Field(description="Deprecated, prefer using streams instead."), - ] = None, - streams: Annotated[ - Optional[List[StrictStr]], - Field( - description='(Optional) Filter on stream: either "stdout", "stderr" or "koyeb" (for system logs).' - ), - ] = None, - start: Annotated[ - Optional[datetime], - Field(description="(Optional) Defaults to 24 hours ago."), - ] = None, - limit: Annotated[ - Optional[StrictStr], - Field(description="(Optional) Defaults to 1000. Maximum of 1000."), - ] = None, - regex: Annotated[ - Optional[StrictStr], - Field( - description="(Optional) Apply a regex to filter logs. Can't be used with `text`." - ), - ] = None, - text: Annotated[ - Optional[StrictStr], - Field( - description="(Optional) Looks for this string in logs. Can't be used with `regex`." - ), - ] = None, - regions: Annotated[ - Optional[List[StrictStr]], - Field( - description='(Optional) Filter on the provided regions (e.g. ["fra", "was"]).' - ), - ] = None, + type: Annotated[Optional[StrictStr], Field(description="Type of logs to retrieve, either \"build\" or \"runtime\". Defaults to \"runtime\".")] = None, + app_id: Annotated[Optional[StrictStr], Field(description="(Optional) Filter on the provided app_id. At least one of app_id, service_id, deployment_id, regional_deployment_id or instance_ids must be set.")] = None, + service_id: Annotated[Optional[StrictStr], Field(description="(Optional) Filter on the provided service_id. At least one of app_id, service_id, deployment_id, regional_deployment_id or instance_ids must be set.")] = None, + deployment_id: Annotated[Optional[StrictStr], Field(description="(Optional) Filter on the provided deployment_id. At least one of app_id, service_id, deployment_id, regional_deployment_id or instance_ids must be set.")] = None, + regional_deployment_id: Annotated[Optional[StrictStr], Field(description="(Optional) Filter on the provided regional_deployment_id. At least one of app_id, service_id, deployment_id, regional_deployment_id or instance_ids must be set.")] = None, + instance_id: Annotated[Optional[StrictStr], Field(description="Deprecated, prefer using instance_ids instead.")] = None, + instance_ids: Annotated[Optional[List[StrictStr]], Field(description="(Optional) Filter on the provided instance_ids. At least one of app_id, service_id, deployment_id, regional_deployment_id or instance_ids must be set.")] = None, + stream: Annotated[Optional[StrictStr], Field(description="Deprecated, prefer using streams instead.")] = None, + streams: Annotated[Optional[List[StrictStr]], Field(description="(Optional) Filter on stream: either \"stdout\", \"stderr\" or \"koyeb\" (for system logs).")] = None, + start: Annotated[Optional[datetime], Field(description="(Optional) Defaults to 24 hours ago.")] = None, + limit: Annotated[Optional[StrictStr], Field(description="(Optional) Defaults to 1000. Maximum of 1000.")] = None, + regex: Annotated[Optional[StrictStr], Field(description="(Optional) Apply a regex to filter logs. Can't be used with `text`.")] = None, + text: Annotated[Optional[StrictStr], Field(description="(Optional) Looks for this string in logs. Can't be used with `regex`.")] = None, + regions: Annotated[Optional[List[StrictStr]], Field(description="(Optional) Filter on the provided regions (e.g. [\"fra\", \"was\"]).")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -925,7 +675,7 @@ def tail_logs( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._tail_logs_serialize( type=type, @@ -945,20 +695,21 @@ def tail_logs( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "StreamResultOfLogEntry", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "StreamResultOfLogEntry", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -966,91 +717,31 @@ def tail_logs( response_types_map=_response_types_map, ).data + @validate_call def tail_logs_with_http_info( self, - type: Annotated[ - Optional[StrictStr], - Field( - description='Type of logs to retrieve, either "build" or "runtime". Defaults to "runtime".' - ), - ] = None, - app_id: Annotated[ - Optional[StrictStr], - Field( - description="(Optional) Filter on the provided app_id. At least one of app_id, service_id, deployment_id, regional_deployment_id or instance_ids must be set." - ), - ] = None, - service_id: Annotated[ - Optional[StrictStr], - Field( - description="(Optional) Filter on the provided service_id. At least one of app_id, service_id, deployment_id, regional_deployment_id or instance_ids must be set." - ), - ] = None, - deployment_id: Annotated[ - Optional[StrictStr], - Field( - description="(Optional) Filter on the provided deployment_id. At least one of app_id, service_id, deployment_id, regional_deployment_id or instance_ids must be set." - ), - ] = None, - regional_deployment_id: Annotated[ - Optional[StrictStr], - Field( - description="(Optional) Filter on the provided regional_deployment_id. At least one of app_id, service_id, deployment_id, regional_deployment_id or instance_ids must be set." - ), - ] = None, - instance_id: Annotated[ - Optional[StrictStr], - Field(description="Deprecated, prefer using instance_ids instead."), - ] = None, - instance_ids: Annotated[ - Optional[List[StrictStr]], - Field( - description="(Optional) Filter on the provided instance_ids. At least one of app_id, service_id, deployment_id, regional_deployment_id or instance_ids must be set." - ), - ] = None, - stream: Annotated[ - Optional[StrictStr], - Field(description="Deprecated, prefer using streams instead."), - ] = None, - streams: Annotated[ - Optional[List[StrictStr]], - Field( - description='(Optional) Filter on stream: either "stdout", "stderr" or "koyeb" (for system logs).' - ), - ] = None, - start: Annotated[ - Optional[datetime], - Field(description="(Optional) Defaults to 24 hours ago."), - ] = None, - limit: Annotated[ - Optional[StrictStr], - Field(description="(Optional) Defaults to 1000. Maximum of 1000."), - ] = None, - regex: Annotated[ - Optional[StrictStr], - Field( - description="(Optional) Apply a regex to filter logs. Can't be used with `text`." - ), - ] = None, - text: Annotated[ - Optional[StrictStr], - Field( - description="(Optional) Looks for this string in logs. Can't be used with `regex`." - ), - ] = None, - regions: Annotated[ - Optional[List[StrictStr]], - Field( - description='(Optional) Filter on the provided regions (e.g. ["fra", "was"]).' - ), - ] = None, + type: Annotated[Optional[StrictStr], Field(description="Type of logs to retrieve, either \"build\" or \"runtime\". Defaults to \"runtime\".")] = None, + app_id: Annotated[Optional[StrictStr], Field(description="(Optional) Filter on the provided app_id. At least one of app_id, service_id, deployment_id, regional_deployment_id or instance_ids must be set.")] = None, + service_id: Annotated[Optional[StrictStr], Field(description="(Optional) Filter on the provided service_id. At least one of app_id, service_id, deployment_id, regional_deployment_id or instance_ids must be set.")] = None, + deployment_id: Annotated[Optional[StrictStr], Field(description="(Optional) Filter on the provided deployment_id. At least one of app_id, service_id, deployment_id, regional_deployment_id or instance_ids must be set.")] = None, + regional_deployment_id: Annotated[Optional[StrictStr], Field(description="(Optional) Filter on the provided regional_deployment_id. At least one of app_id, service_id, deployment_id, regional_deployment_id or instance_ids must be set.")] = None, + instance_id: Annotated[Optional[StrictStr], Field(description="Deprecated, prefer using instance_ids instead.")] = None, + instance_ids: Annotated[Optional[List[StrictStr]], Field(description="(Optional) Filter on the provided instance_ids. At least one of app_id, service_id, deployment_id, regional_deployment_id or instance_ids must be set.")] = None, + stream: Annotated[Optional[StrictStr], Field(description="Deprecated, prefer using streams instead.")] = None, + streams: Annotated[Optional[List[StrictStr]], Field(description="(Optional) Filter on stream: either \"stdout\", \"stderr\" or \"koyeb\" (for system logs).")] = None, + start: Annotated[Optional[datetime], Field(description="(Optional) Defaults to 24 hours ago.")] = None, + limit: Annotated[Optional[StrictStr], Field(description="(Optional) Defaults to 1000. Maximum of 1000.")] = None, + regex: Annotated[Optional[StrictStr], Field(description="(Optional) Apply a regex to filter logs. Can't be used with `text`.")] = None, + text: Annotated[Optional[StrictStr], Field(description="(Optional) Looks for this string in logs. Can't be used with `regex`.")] = None, + regions: Annotated[Optional[List[StrictStr]], Field(description="(Optional) Filter on the provided regions (e.g. [\"fra\", \"was\"]).")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -1108,7 +799,7 @@ def tail_logs_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._tail_logs_serialize( type=type, @@ -1128,20 +819,21 @@ def tail_logs_with_http_info( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "StreamResultOfLogEntry", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "StreamResultOfLogEntry", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -1149,91 +841,31 @@ def tail_logs_with_http_info( response_types_map=_response_types_map, ) + @validate_call def tail_logs_without_preload_content( self, - type: Annotated[ - Optional[StrictStr], - Field( - description='Type of logs to retrieve, either "build" or "runtime". Defaults to "runtime".' - ), - ] = None, - app_id: Annotated[ - Optional[StrictStr], - Field( - description="(Optional) Filter on the provided app_id. At least one of app_id, service_id, deployment_id, regional_deployment_id or instance_ids must be set." - ), - ] = None, - service_id: Annotated[ - Optional[StrictStr], - Field( - description="(Optional) Filter on the provided service_id. At least one of app_id, service_id, deployment_id, regional_deployment_id or instance_ids must be set." - ), - ] = None, - deployment_id: Annotated[ - Optional[StrictStr], - Field( - description="(Optional) Filter on the provided deployment_id. At least one of app_id, service_id, deployment_id, regional_deployment_id or instance_ids must be set." - ), - ] = None, - regional_deployment_id: Annotated[ - Optional[StrictStr], - Field( - description="(Optional) Filter on the provided regional_deployment_id. At least one of app_id, service_id, deployment_id, regional_deployment_id or instance_ids must be set." - ), - ] = None, - instance_id: Annotated[ - Optional[StrictStr], - Field(description="Deprecated, prefer using instance_ids instead."), - ] = None, - instance_ids: Annotated[ - Optional[List[StrictStr]], - Field( - description="(Optional) Filter on the provided instance_ids. At least one of app_id, service_id, deployment_id, regional_deployment_id or instance_ids must be set." - ), - ] = None, - stream: Annotated[ - Optional[StrictStr], - Field(description="Deprecated, prefer using streams instead."), - ] = None, - streams: Annotated[ - Optional[List[StrictStr]], - Field( - description='(Optional) Filter on stream: either "stdout", "stderr" or "koyeb" (for system logs).' - ), - ] = None, - start: Annotated[ - Optional[datetime], - Field(description="(Optional) Defaults to 24 hours ago."), - ] = None, - limit: Annotated[ - Optional[StrictStr], - Field(description="(Optional) Defaults to 1000. Maximum of 1000."), - ] = None, - regex: Annotated[ - Optional[StrictStr], - Field( - description="(Optional) Apply a regex to filter logs. Can't be used with `text`." - ), - ] = None, - text: Annotated[ - Optional[StrictStr], - Field( - description="(Optional) Looks for this string in logs. Can't be used with `regex`." - ), - ] = None, - regions: Annotated[ - Optional[List[StrictStr]], - Field( - description='(Optional) Filter on the provided regions (e.g. ["fra", "was"]).' - ), - ] = None, + type: Annotated[Optional[StrictStr], Field(description="Type of logs to retrieve, either \"build\" or \"runtime\". Defaults to \"runtime\".")] = None, + app_id: Annotated[Optional[StrictStr], Field(description="(Optional) Filter on the provided app_id. At least one of app_id, service_id, deployment_id, regional_deployment_id or instance_ids must be set.")] = None, + service_id: Annotated[Optional[StrictStr], Field(description="(Optional) Filter on the provided service_id. At least one of app_id, service_id, deployment_id, regional_deployment_id or instance_ids must be set.")] = None, + deployment_id: Annotated[Optional[StrictStr], Field(description="(Optional) Filter on the provided deployment_id. At least one of app_id, service_id, deployment_id, regional_deployment_id or instance_ids must be set.")] = None, + regional_deployment_id: Annotated[Optional[StrictStr], Field(description="(Optional) Filter on the provided regional_deployment_id. At least one of app_id, service_id, deployment_id, regional_deployment_id or instance_ids must be set.")] = None, + instance_id: Annotated[Optional[StrictStr], Field(description="Deprecated, prefer using instance_ids instead.")] = None, + instance_ids: Annotated[Optional[List[StrictStr]], Field(description="(Optional) Filter on the provided instance_ids. At least one of app_id, service_id, deployment_id, regional_deployment_id or instance_ids must be set.")] = None, + stream: Annotated[Optional[StrictStr], Field(description="Deprecated, prefer using streams instead.")] = None, + streams: Annotated[Optional[List[StrictStr]], Field(description="(Optional) Filter on stream: either \"stdout\", \"stderr\" or \"koyeb\" (for system logs).")] = None, + start: Annotated[Optional[datetime], Field(description="(Optional) Defaults to 24 hours ago.")] = None, + limit: Annotated[Optional[StrictStr], Field(description="(Optional) Defaults to 1000. Maximum of 1000.")] = None, + regex: Annotated[Optional[StrictStr], Field(description="(Optional) Apply a regex to filter logs. Can't be used with `text`.")] = None, + text: Annotated[Optional[StrictStr], Field(description="(Optional) Looks for this string in logs. Can't be used with `regex`.")] = None, + regions: Annotated[Optional[List[StrictStr]], Field(description="(Optional) Filter on the provided regions (e.g. [\"fra\", \"was\"]).")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -1291,7 +923,7 @@ def tail_logs_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._tail_logs_serialize( type=type, @@ -1311,23 +943,25 @@ def tail_logs_without_preload_content( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "StreamResultOfLogEntry", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "StreamResultOfLogEntry", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) return response_data.response + def _tail_logs_serialize( self, type, @@ -1353,9 +987,9 @@ def _tail_logs_serialize( _host = None _collection_formats: Dict[str, str] = { - "instance_ids": "multi", - "streams": "multi", - "regions": "multi", + 'instance_ids': 'multi', + 'streams': 'multi', + 'regions': 'multi', } _path_params: Dict[str, str] = {} @@ -1370,82 +1004,92 @@ def _tail_logs_serialize( # process the path parameters # process the query parameters if type is not None: - - _query_params.append(("type", type)) - + + _query_params.append(('type', type)) + if app_id is not None: - - _query_params.append(("app_id", app_id)) - + + _query_params.append(('app_id', app_id)) + if service_id is not None: - - _query_params.append(("service_id", service_id)) - + + _query_params.append(('service_id', service_id)) + if deployment_id is not None: - - _query_params.append(("deployment_id", deployment_id)) - + + _query_params.append(('deployment_id', deployment_id)) + if regional_deployment_id is not None: - - _query_params.append(("regional_deployment_id", regional_deployment_id)) - + + _query_params.append(('regional_deployment_id', regional_deployment_id)) + if instance_id is not None: - - _query_params.append(("instance_id", instance_id)) - + + _query_params.append(('instance_id', instance_id)) + if instance_ids is not None: - - _query_params.append(("instance_ids", instance_ids)) - + + _query_params.append(('instance_ids', instance_ids)) + if stream is not None: - - _query_params.append(("stream", stream)) - + + _query_params.append(('stream', stream)) + if streams is not None: - - _query_params.append(("streams", streams)) - + + _query_params.append(('streams', streams)) + if start is not None: if isinstance(start, datetime): _query_params.append( ( - "start", - start.strftime(self.api_client.configuration.datetime_format), + 'start', + start.strftime( + self.api_client.configuration.datetime_format + ) ) ) else: - _query_params.append(("start", start)) - + _query_params.append(('start', start)) + if limit is not None: - - _query_params.append(("limit", limit)) - + + _query_params.append(('limit', limit)) + if regex is not None: - - _query_params.append(("regex", regex)) - + + _query_params.append(('regex', regex)) + if text is not None: - - _query_params.append(("text", text)) - + + _query_params.append(('text', text)) + if regions is not None: - - _query_params.append(("regions", regions)) - + + _query_params.append(('regions', regions)) + # process the header parameters # process the form parameters # process the body parameter + # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept(["*/*"]) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + '*/*' + ] + ) + # authentication setting - _auth_settings: List[str] = ["Bearer"] + _auth_settings: List[str] = [ + 'Bearer' + ] return self.api_client.param_serialize( - method="GET", - resource_path="/v1/streams/logs/tail", + method='GET', + resource_path='/v1/streams/logs/tail', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -1455,5 +1099,7 @@ def _tail_logs_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth, + _request_auth=_request_auth ) + + diff --git a/koyeb/api/api/metrics_api.py b/koyeb/api/api/metrics_api.py index 2ac6cf55..524c6af9 100644 --- a/koyeb/api/api/metrics_api.py +++ b/koyeb/api/api/metrics_api.py @@ -1,16 +1,15 @@ -# coding: utf-8 - """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 + import warnings from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt from typing import Any, Dict, List, Optional, Tuple, Union @@ -39,41 +38,23 @@ def __init__(self, api_client=None) -> None: api_client = ApiClient.get_default() self.api_client = api_client + @validate_call def get_metrics( self, - service_id: Annotated[ - Optional[StrictStr], - Field( - description="ID of the service to query instances metrics for. Ignored if instance_id is set." - ), - ] = None, - instance_id: Annotated[ - Optional[StrictStr], - Field(description="ID of the instance to query metrics for."), - ] = None, - name: Annotated[ - Optional[StrictStr], Field(description="Metric to query.") - ] = None, - start: Annotated[ - Optional[datetime], - Field(description="(Optional) Defaults to an hour prior to end."), - ] = None, - end: Annotated[ - Optional[datetime], Field(description="(Optional) Defaults to now.") - ] = None, - step: Annotated[ - Optional[StrictStr], - Field( - description="(Optional) Must be a valid duration in hours (h) or minutes (m). Defaulst to 5m." - ), - ] = None, + service_id: Annotated[Optional[StrictStr], Field(description="ID of the service to query instances metrics for. Ignored if instance_id is set.")] = None, + instance_id: Annotated[Optional[StrictStr], Field(description="ID of the instance to query metrics for.")] = None, + name: Annotated[Optional[StrictStr], Field(description="Metric to query.")] = None, + start: Annotated[Optional[datetime], Field(description="(Optional) Defaults to an hour prior to end.")] = None, + end: Annotated[Optional[datetime], Field(description="(Optional) Defaults to now.")] = None, + step: Annotated[Optional[StrictStr], Field(description="(Optional) Must be a valid duration in hours (h) or minutes (m). Defaulst to 5m.")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -115,7 +96,7 @@ def get_metrics( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._get_metrics_serialize( service_id=service_id, @@ -127,20 +108,21 @@ def get_metrics( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "GetMetricsReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "GetMetricsReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -148,41 +130,23 @@ def get_metrics( response_types_map=_response_types_map, ).data + @validate_call def get_metrics_with_http_info( self, - service_id: Annotated[ - Optional[StrictStr], - Field( - description="ID of the service to query instances metrics for. Ignored if instance_id is set." - ), - ] = None, - instance_id: Annotated[ - Optional[StrictStr], - Field(description="ID of the instance to query metrics for."), - ] = None, - name: Annotated[ - Optional[StrictStr], Field(description="Metric to query.") - ] = None, - start: Annotated[ - Optional[datetime], - Field(description="(Optional) Defaults to an hour prior to end."), - ] = None, - end: Annotated[ - Optional[datetime], Field(description="(Optional) Defaults to now.") - ] = None, - step: Annotated[ - Optional[StrictStr], - Field( - description="(Optional) Must be a valid duration in hours (h) or minutes (m). Defaulst to 5m." - ), - ] = None, + service_id: Annotated[Optional[StrictStr], Field(description="ID of the service to query instances metrics for. Ignored if instance_id is set.")] = None, + instance_id: Annotated[Optional[StrictStr], Field(description="ID of the instance to query metrics for.")] = None, + name: Annotated[Optional[StrictStr], Field(description="Metric to query.")] = None, + start: Annotated[Optional[datetime], Field(description="(Optional) Defaults to an hour prior to end.")] = None, + end: Annotated[Optional[datetime], Field(description="(Optional) Defaults to now.")] = None, + step: Annotated[Optional[StrictStr], Field(description="(Optional) Must be a valid duration in hours (h) or minutes (m). Defaulst to 5m.")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -224,7 +188,7 @@ def get_metrics_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._get_metrics_serialize( service_id=service_id, @@ -236,20 +200,21 @@ def get_metrics_with_http_info( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "GetMetricsReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "GetMetricsReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -257,41 +222,23 @@ def get_metrics_with_http_info( response_types_map=_response_types_map, ) + @validate_call def get_metrics_without_preload_content( self, - service_id: Annotated[ - Optional[StrictStr], - Field( - description="ID of the service to query instances metrics for. Ignored if instance_id is set." - ), - ] = None, - instance_id: Annotated[ - Optional[StrictStr], - Field(description="ID of the instance to query metrics for."), - ] = None, - name: Annotated[ - Optional[StrictStr], Field(description="Metric to query.") - ] = None, - start: Annotated[ - Optional[datetime], - Field(description="(Optional) Defaults to an hour prior to end."), - ] = None, - end: Annotated[ - Optional[datetime], Field(description="(Optional) Defaults to now.") - ] = None, - step: Annotated[ - Optional[StrictStr], - Field( - description="(Optional) Must be a valid duration in hours (h) or minutes (m). Defaulst to 5m." - ), - ] = None, + service_id: Annotated[Optional[StrictStr], Field(description="ID of the service to query instances metrics for. Ignored if instance_id is set.")] = None, + instance_id: Annotated[Optional[StrictStr], Field(description="ID of the instance to query metrics for.")] = None, + name: Annotated[Optional[StrictStr], Field(description="Metric to query.")] = None, + start: Annotated[Optional[datetime], Field(description="(Optional) Defaults to an hour prior to end.")] = None, + end: Annotated[Optional[datetime], Field(description="(Optional) Defaults to now.")] = None, + step: Annotated[Optional[StrictStr], Field(description="(Optional) Must be a valid duration in hours (h) or minutes (m). Defaulst to 5m.")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -333,7 +280,7 @@ def get_metrics_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._get_metrics_serialize( service_id=service_id, @@ -345,23 +292,25 @@ def get_metrics_without_preload_content( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "GetMetricsReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "GetMetricsReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) return response_data.response + def _get_metrics_serialize( self, service_id, @@ -378,7 +327,8 @@ def _get_metrics_serialize( _host = None - _collection_formats: Dict[str, str] = {} + _collection_formats: Dict[str, str] = { + } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -392,54 +342,69 @@ def _get_metrics_serialize( # process the path parameters # process the query parameters if service_id is not None: - - _query_params.append(("service_id", service_id)) - + + _query_params.append(('service_id', service_id)) + if instance_id is not None: - - _query_params.append(("instance_id", instance_id)) - + + _query_params.append(('instance_id', instance_id)) + if name is not None: - - _query_params.append(("name", name)) - + + _query_params.append(('name', name)) + if start is not None: if isinstance(start, datetime): _query_params.append( ( - "start", - start.strftime(self.api_client.configuration.datetime_format), + 'start', + start.strftime( + self.api_client.configuration.datetime_format + ) ) ) else: - _query_params.append(("start", start)) - + _query_params.append(('start', start)) + if end is not None: if isinstance(end, datetime): _query_params.append( - ("end", end.strftime(self.api_client.configuration.datetime_format)) + ( + 'end', + end.strftime( + self.api_client.configuration.datetime_format + ) + ) ) else: - _query_params.append(("end", end)) - + _query_params.append(('end', end)) + if step is not None: - - _query_params.append(("step", step)) - + + _query_params.append(('step', step)) + # process the header parameters # process the form parameters # process the body parameter + # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept(["*/*"]) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + '*/*' + ] + ) + # authentication setting - _auth_settings: List[str] = ["Bearer"] + _auth_settings: List[str] = [ + 'Bearer' + ] return self.api_client.param_serialize( - method="GET", - resource_path="/v1/streams/metrics", + method='GET', + resource_path='/v1/streams/metrics', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -449,5 +414,7 @@ def _get_metrics_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth, + _request_auth=_request_auth ) + + diff --git a/koyeb/api/api/organization_api.py b/koyeb/api/api/organization_api.py index 5cab6b2f..bba87dd4 100644 --- a/koyeb/api/api/organization_api.py +++ b/koyeb/api/api/organization_api.py @@ -1,16 +1,15 @@ -# coding: utf-8 - """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 + import warnings from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt from typing import Any, Dict, List, Optional, Tuple, Union @@ -25,9 +24,7 @@ from koyeb.api.models.create_organization_reply import CreateOrganizationReply from koyeb.api.models.create_organization_request import CreateOrganizationRequest from koyeb.api.models.deactivate_organization_reply import DeactivateOrganizationReply -from koyeb.api.models.deactivate_organization_request import ( - DeactivateOrganizationRequest, -) +from koyeb.api.models.deactivate_organization_request import DeactivateOrganizationRequest from koyeb.api.models.delete_organization_reply import DeleteOrganizationReply from koyeb.api.models.get_budget_reply import GetBudgetReply from koyeb.api.models.get_github_installation_reply import GetGithubInstallationReply @@ -39,21 +36,15 @@ from koyeb.api.models.reactivate_organization_reply import ReactivateOrganizationReply from koyeb.api.models.update_budget_reply import UpdateBudgetReply from koyeb.api.models.update_budget_request import UpdateBudgetRequest +from koyeb.api.models.update_organization_default_project_reply import UpdateOrganizationDefaultProjectReply +from koyeb.api.models.update_organization_default_project_request import UpdateOrganizationDefaultProjectRequest from koyeb.api.models.update_organization_name_reply import UpdateOrganizationNameReply -from koyeb.api.models.update_organization_name_request import ( - UpdateOrganizationNameRequest, -) +from koyeb.api.models.update_organization_name_request import UpdateOrganizationNameRequest from koyeb.api.models.update_organization_plan_reply import UpdateOrganizationPlanReply -from koyeb.api.models.update_organization_plan_request import ( - UpdateOrganizationPlanRequest, -) +from koyeb.api.models.update_organization_plan_request import UpdateOrganizationPlanRequest from koyeb.api.models.update_organization_reply import UpdateOrganizationReply -from koyeb.api.models.upsert_signup_qualification_reply import ( - UpsertSignupQualificationReply, -) -from koyeb.api.models.upsert_signup_qualification_request import ( - UpsertSignupQualificationRequest, -) +from koyeb.api.models.upsert_signup_qualification_reply import UpsertSignupQualificationReply +from koyeb.api.models.upsert_signup_qualification_request import UpsertSignupQualificationRequest from koyeb.api.api_client import ApiClient, RequestSerialized from koyeb.api.api_response import ApiResponse @@ -72,19 +63,19 @@ def __init__(self, api_client=None) -> None: api_client = ApiClient.get_default() self.api_client = api_client + @validate_call def create_access_token( self, - id: Annotated[ - StrictStr, Field(description="Organization id for ephemeral credential") - ], + id: Annotated[StrictStr, Field(description="Organization id for ephemeral credential")], body: CreateAccessTokenRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -119,7 +110,7 @@ def create_access_token( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._create_access_token_serialize( id=id, @@ -127,20 +118,21 @@ def create_access_token( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "CreateAccessTokenReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "CreateAccessTokenReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -148,19 +140,19 @@ def create_access_token( response_types_map=_response_types_map, ).data + @validate_call def create_access_token_with_http_info( self, - id: Annotated[ - StrictStr, Field(description="Organization id for ephemeral credential") - ], + id: Annotated[StrictStr, Field(description="Organization id for ephemeral credential")], body: CreateAccessTokenRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -195,7 +187,7 @@ def create_access_token_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._create_access_token_serialize( id=id, @@ -203,20 +195,21 @@ def create_access_token_with_http_info( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "CreateAccessTokenReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "CreateAccessTokenReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -224,19 +217,19 @@ def create_access_token_with_http_info( response_types_map=_response_types_map, ) + @validate_call def create_access_token_without_preload_content( self, - id: Annotated[ - StrictStr, Field(description="Organization id for ephemeral credential") - ], + id: Annotated[StrictStr, Field(description="Organization id for ephemeral credential")], body: CreateAccessTokenRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -271,7 +264,7 @@ def create_access_token_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._create_access_token_serialize( id=id, @@ -279,23 +272,25 @@ def create_access_token_without_preload_content( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "CreateAccessTokenReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "CreateAccessTokenReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) return response_data.response + def _create_access_token_serialize( self, id, @@ -308,7 +303,8 @@ def _create_access_token_serialize( _host = None - _collection_formats: Dict[str, str] = {} + _collection_formats: Dict[str, str] = { + } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -321,7 +317,7 @@ def _create_access_token_serialize( # process the path parameters if id is not None: - _path_params["id"] = id + _path_params['id'] = id # process the query parameters # process the header parameters # process the form parameters @@ -329,16 +325,24 @@ def _create_access_token_serialize( if body is not None: _body_params = body + # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept(["*/*"]) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + '*/*' + ] + ) + # authentication setting - _auth_settings: List[str] = ["Bearer"] + _auth_settings: List[str] = [ + 'Bearer' + ] return self.api_client.param_serialize( - method="POST", - resource_path="/v1/organizations/{id}/access_token", + method='POST', + resource_path='/v1/organizations/{id}/access_token', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -348,9 +352,12 @@ def _create_access_token_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth, + _request_auth=_request_auth ) + + + @validate_call def create_budget( self, @@ -360,8 +367,9 @@ def create_budget( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -395,7 +403,7 @@ def create_budget( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._create_budget_serialize( organization_id=organization_id, @@ -403,20 +411,21 @@ def create_budget( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "CreateBudgetReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "CreateBudgetReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -424,6 +433,7 @@ def create_budget( response_types_map=_response_types_map, ).data + @validate_call def create_budget_with_http_info( self, @@ -433,8 +443,9 @@ def create_budget_with_http_info( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -468,7 +479,7 @@ def create_budget_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._create_budget_serialize( organization_id=organization_id, @@ -476,20 +487,21 @@ def create_budget_with_http_info( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "CreateBudgetReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "CreateBudgetReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -497,6 +509,7 @@ def create_budget_with_http_info( response_types_map=_response_types_map, ) + @validate_call def create_budget_without_preload_content( self, @@ -506,8 +519,9 @@ def create_budget_without_preload_content( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -541,7 +555,7 @@ def create_budget_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._create_budget_serialize( organization_id=organization_id, @@ -549,23 +563,25 @@ def create_budget_without_preload_content( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "CreateBudgetReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "CreateBudgetReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) return response_data.response + def _create_budget_serialize( self, organization_id, @@ -578,7 +594,8 @@ def _create_budget_serialize( _host = None - _collection_formats: Dict[str, str] = {} + _collection_formats: Dict[str, str] = { + } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -591,7 +608,7 @@ def _create_budget_serialize( # process the path parameters if organization_id is not None: - _path_params["organization_id"] = organization_id + _path_params['organization_id'] = organization_id # process the query parameters # process the header parameters # process the form parameters @@ -599,16 +616,24 @@ def _create_budget_serialize( if body is not None: _body_params = body + # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept(["*/*"]) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + '*/*' + ] + ) + # authentication setting - _auth_settings: List[str] = ["Bearer"] + _auth_settings: List[str] = [ + 'Bearer' + ] return self.api_client.param_serialize( - method="POST", - resource_path="/v1/organizations/{organization_id}/budget", + method='POST', + resource_path='/v1/organizations/{organization_id}/budget', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -618,9 +643,12 @@ def _create_budget_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth, + _request_auth=_request_auth ) + + + @validate_call def create_organization( self, @@ -629,8 +657,9 @@ def create_organization( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -662,27 +691,28 @@ def create_organization( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._create_organization_serialize( body=body, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "CreateOrganizationReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "CreateOrganizationReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -690,6 +720,7 @@ def create_organization( response_types_map=_response_types_map, ).data + @validate_call def create_organization_with_http_info( self, @@ -698,8 +729,9 @@ def create_organization_with_http_info( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -731,27 +763,28 @@ def create_organization_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._create_organization_serialize( body=body, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "CreateOrganizationReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "CreateOrganizationReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -759,6 +792,7 @@ def create_organization_with_http_info( response_types_map=_response_types_map, ) + @validate_call def create_organization_without_preload_content( self, @@ -767,8 +801,9 @@ def create_organization_without_preload_content( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -800,30 +835,32 @@ def create_organization_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._create_organization_serialize( body=body, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "CreateOrganizationReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "CreateOrganizationReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) return response_data.response + def _create_organization_serialize( self, body, @@ -835,7 +872,8 @@ def _create_organization_serialize( _host = None - _collection_formats: Dict[str, str] = {} + _collection_formats: Dict[str, str] = { + } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -854,16 +892,24 @@ def _create_organization_serialize( if body is not None: _body_params = body + # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept(["*/*"]) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + '*/*' + ] + ) + # authentication setting - _auth_settings: List[str] = ["Bearer"] + _auth_settings: List[str] = [ + 'Bearer' + ] return self.api_client.param_serialize( - method="POST", - resource_path="/v1/organizations", + method='POST', + resource_path='/v1/organizations', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -873,9 +919,12 @@ def _create_organization_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth, + _request_auth=_request_auth ) + + + @validate_call def deactivate_organization( self, @@ -885,8 +934,9 @@ def deactivate_organization( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -920,7 +970,7 @@ def deactivate_organization( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._deactivate_organization_serialize( id=id, @@ -928,20 +978,21 @@ def deactivate_organization( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "DeactivateOrganizationReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "DeactivateOrganizationReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -949,6 +1000,7 @@ def deactivate_organization( response_types_map=_response_types_map, ).data + @validate_call def deactivate_organization_with_http_info( self, @@ -958,8 +1010,9 @@ def deactivate_organization_with_http_info( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -993,7 +1046,7 @@ def deactivate_organization_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._deactivate_organization_serialize( id=id, @@ -1001,20 +1054,21 @@ def deactivate_organization_with_http_info( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "DeactivateOrganizationReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "DeactivateOrganizationReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -1022,6 +1076,7 @@ def deactivate_organization_with_http_info( response_types_map=_response_types_map, ) + @validate_call def deactivate_organization_without_preload_content( self, @@ -1031,8 +1086,9 @@ def deactivate_organization_without_preload_content( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -1066,7 +1122,7 @@ def deactivate_organization_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._deactivate_organization_serialize( id=id, @@ -1074,23 +1130,25 @@ def deactivate_organization_without_preload_content( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "DeactivateOrganizationReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "DeactivateOrganizationReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) return response_data.response + def _deactivate_organization_serialize( self, id, @@ -1103,7 +1161,8 @@ def _deactivate_organization_serialize( _host = None - _collection_formats: Dict[str, str] = {} + _collection_formats: Dict[str, str] = { + } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -1116,7 +1175,7 @@ def _deactivate_organization_serialize( # process the path parameters if id is not None: - _path_params["id"] = id + _path_params['id'] = id # process the query parameters # process the header parameters # process the form parameters @@ -1124,16 +1183,24 @@ def _deactivate_organization_serialize( if body is not None: _body_params = body + # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept(["*/*"]) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + '*/*' + ] + ) + # authentication setting - _auth_settings: List[str] = ["Bearer"] + _auth_settings: List[str] = [ + 'Bearer' + ] return self.api_client.param_serialize( - method="POST", - resource_path="/v1/organizations/{id}/deactivate", + method='POST', + resource_path='/v1/organizations/{id}/deactivate', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -1143,9 +1210,12 @@ def _deactivate_organization_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth, + _request_auth=_request_auth ) + + + @validate_call def delete_budget( self, @@ -1154,8 +1224,9 @@ def delete_budget( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -1187,27 +1258,28 @@ def delete_budget( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._delete_budget_serialize( organization_id=organization_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "object", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "object", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -1215,6 +1287,7 @@ def delete_budget( response_types_map=_response_types_map, ).data + @validate_call def delete_budget_with_http_info( self, @@ -1223,8 +1296,9 @@ def delete_budget_with_http_info( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -1256,27 +1330,28 @@ def delete_budget_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._delete_budget_serialize( organization_id=organization_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "object", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "object", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -1284,6 +1359,7 @@ def delete_budget_with_http_info( response_types_map=_response_types_map, ) + @validate_call def delete_budget_without_preload_content( self, @@ -1292,8 +1368,9 @@ def delete_budget_without_preload_content( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -1325,30 +1402,32 @@ def delete_budget_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._delete_budget_serialize( organization_id=organization_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "object", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "object", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) return response_data.response + def _delete_budget_serialize( self, organization_id, @@ -1360,7 +1439,8 @@ def _delete_budget_serialize( _host = None - _collection_formats: Dict[str, str] = {} + _collection_formats: Dict[str, str] = { + } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -1373,22 +1453,30 @@ def _delete_budget_serialize( # process the path parameters if organization_id is not None: - _path_params["organization_id"] = organization_id + _path_params['organization_id'] = organization_id # process the query parameters # process the header parameters # process the form parameters # process the body parameter + # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept(["*/*"]) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + '*/*' + ] + ) + # authentication setting - _auth_settings: List[str] = ["Bearer"] + _auth_settings: List[str] = [ + 'Bearer' + ] return self.api_client.param_serialize( - method="DELETE", - resource_path="/v1/organizations/{organization_id}/budget", + method='DELETE', + resource_path='/v1/organizations/{organization_id}/budget', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -1398,9 +1486,12 @@ def _delete_budget_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth, + _request_auth=_request_auth ) + + + @validate_call def delete_organization( self, @@ -1409,8 +1500,9 @@ def delete_organization( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -1442,27 +1534,28 @@ def delete_organization( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._delete_organization_serialize( id=id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "DeleteOrganizationReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "DeleteOrganizationReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -1470,6 +1563,7 @@ def delete_organization( response_types_map=_response_types_map, ).data + @validate_call def delete_organization_with_http_info( self, @@ -1478,8 +1572,9 @@ def delete_organization_with_http_info( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -1511,27 +1606,28 @@ def delete_organization_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._delete_organization_serialize( id=id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "DeleteOrganizationReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "DeleteOrganizationReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -1539,6 +1635,7 @@ def delete_organization_with_http_info( response_types_map=_response_types_map, ) + @validate_call def delete_organization_without_preload_content( self, @@ -1547,8 +1644,9 @@ def delete_organization_without_preload_content( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -1580,30 +1678,32 @@ def delete_organization_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._delete_organization_serialize( id=id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "DeleteOrganizationReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "DeleteOrganizationReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) return response_data.response + def _delete_organization_serialize( self, id, @@ -1615,7 +1715,8 @@ def _delete_organization_serialize( _host = None - _collection_formats: Dict[str, str] = {} + _collection_formats: Dict[str, str] = { + } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -1628,22 +1729,30 @@ def _delete_organization_serialize( # process the path parameters if id is not None: - _path_params["id"] = id + _path_params['id'] = id # process the query parameters # process the header parameters # process the form parameters # process the body parameter + # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept(["*/*"]) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + '*/*' + ] + ) + # authentication setting - _auth_settings: List[str] = ["Bearer"] + _auth_settings: List[str] = [ + 'Bearer' + ] return self.api_client.param_serialize( - method="DELETE", - resource_path="/v1/organizations/{id}", + method='DELETE', + resource_path='/v1/organizations/{id}', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -1653,9 +1762,12 @@ def _delete_organization_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth, + _request_auth=_request_auth ) + + + @validate_call def get_budget( self, @@ -1664,8 +1776,9 @@ def get_budget( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -1697,27 +1810,28 @@ def get_budget( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._get_budget_serialize( organization_id=organization_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "GetBudgetReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "GetBudgetReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -1725,6 +1839,7 @@ def get_budget( response_types_map=_response_types_map, ).data + @validate_call def get_budget_with_http_info( self, @@ -1733,8 +1848,9 @@ def get_budget_with_http_info( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -1766,27 +1882,28 @@ def get_budget_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._get_budget_serialize( organization_id=organization_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "GetBudgetReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "GetBudgetReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -1794,6 +1911,7 @@ def get_budget_with_http_info( response_types_map=_response_types_map, ) + @validate_call def get_budget_without_preload_content( self, @@ -1802,8 +1920,9 @@ def get_budget_without_preload_content( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -1835,30 +1954,32 @@ def get_budget_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._get_budget_serialize( organization_id=organization_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "GetBudgetReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "GetBudgetReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) return response_data.response + def _get_budget_serialize( self, organization_id, @@ -1870,7 +1991,8 @@ def _get_budget_serialize( _host = None - _collection_formats: Dict[str, str] = {} + _collection_formats: Dict[str, str] = { + } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -1883,22 +2005,30 @@ def _get_budget_serialize( # process the path parameters if organization_id is not None: - _path_params["organization_id"] = organization_id + _path_params['organization_id'] = organization_id # process the query parameters # process the header parameters # process the form parameters # process the body parameter + # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept(["*/*"]) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + '*/*' + ] + ) + # authentication setting - _auth_settings: List[str] = ["Bearer"] + _auth_settings: List[str] = [ + 'Bearer' + ] return self.api_client.param_serialize( - method="GET", - resource_path="/v1/organizations/{organization_id}/budget", + method='GET', + resource_path='/v1/organizations/{organization_id}/budget', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -1908,9 +2038,12 @@ def _get_budget_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth, + _request_auth=_request_auth ) + + + @validate_call def get_github_installation( self, @@ -1918,8 +2051,9 @@ def get_github_installation( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -1949,26 +2083,27 @@ def get_github_installation( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._get_github_installation_serialize( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "GetGithubInstallationReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "GetGithubInstallationReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -1976,6 +2111,7 @@ def get_github_installation( response_types_map=_response_types_map, ).data + @validate_call def get_github_installation_with_http_info( self, @@ -1983,8 +2119,9 @@ def get_github_installation_with_http_info( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -2014,26 +2151,27 @@ def get_github_installation_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._get_github_installation_serialize( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "GetGithubInstallationReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "GetGithubInstallationReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -2041,6 +2179,7 @@ def get_github_installation_with_http_info( response_types_map=_response_types_map, ) + @validate_call def get_github_installation_without_preload_content( self, @@ -2048,8 +2187,9 @@ def get_github_installation_without_preload_content( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -2079,29 +2219,31 @@ def get_github_installation_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._get_github_installation_serialize( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "GetGithubInstallationReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "GetGithubInstallationReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) return response_data.response + def _get_github_installation_serialize( self, _request_auth, @@ -2112,7 +2254,8 @@ def _get_github_installation_serialize( _host = None - _collection_formats: Dict[str, str] = {} + _collection_formats: Dict[str, str] = { + } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -2129,16 +2272,24 @@ def _get_github_installation_serialize( # process the form parameters # process the body parameter + # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept(["*/*"]) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + '*/*' + ] + ) + # authentication setting - _auth_settings: List[str] = ["Bearer"] + _auth_settings: List[str] = [ + 'Bearer' + ] return self.api_client.param_serialize( - method="GET", - resource_path="/v1/github/installation", + method='GET', + resource_path='/v1/github/installation', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -2148,9 +2299,12 @@ def _get_github_installation_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth, + _request_auth=_request_auth ) + + + @validate_call def get_organization( self, @@ -2159,8 +2313,9 @@ def get_organization( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -2192,27 +2347,28 @@ def get_organization( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._get_organization_serialize( id=id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "GetOrganizationReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "GetOrganizationReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -2220,6 +2376,7 @@ def get_organization( response_types_map=_response_types_map, ).data + @validate_call def get_organization_with_http_info( self, @@ -2228,8 +2385,9 @@ def get_organization_with_http_info( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -2261,27 +2419,28 @@ def get_organization_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._get_organization_serialize( id=id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "GetOrganizationReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "GetOrganizationReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -2289,6 +2448,7 @@ def get_organization_with_http_info( response_types_map=_response_types_map, ) + @validate_call def get_organization_without_preload_content( self, @@ -2297,8 +2457,9 @@ def get_organization_without_preload_content( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -2330,30 +2491,32 @@ def get_organization_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._get_organization_serialize( id=id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "GetOrganizationReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "GetOrganizationReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) return response_data.response + def _get_organization_serialize( self, id, @@ -2365,7 +2528,8 @@ def _get_organization_serialize( _host = None - _collection_formats: Dict[str, str] = {} + _collection_formats: Dict[str, str] = { + } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -2378,22 +2542,30 @@ def _get_organization_serialize( # process the path parameters if id is not None: - _path_params["id"] = id + _path_params['id'] = id # process the query parameters # process the header parameters # process the form parameters # process the body parameter + # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept(["*/*"]) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + '*/*' + ] + ) + # authentication setting - _auth_settings: List[str] = ["Bearer"] + _auth_settings: List[str] = [ + 'Bearer' + ] return self.api_client.param_serialize( - method="GET", - resource_path="/v1/organizations/{id}", + method='GET', + resource_path='/v1/organizations/{id}', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -2403,9 +2575,12 @@ def _get_organization_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth, + _request_auth=_request_auth ) + + + @validate_call def github_installation( self, @@ -2414,8 +2589,9 @@ def github_installation( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -2447,27 +2623,28 @@ def github_installation( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._github_installation_serialize( body=body, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "GithubInstallationReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "GithubInstallationReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -2475,6 +2652,7 @@ def github_installation( response_types_map=_response_types_map, ).data + @validate_call def github_installation_with_http_info( self, @@ -2483,8 +2661,9 @@ def github_installation_with_http_info( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -2516,27 +2695,28 @@ def github_installation_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._github_installation_serialize( body=body, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "GithubInstallationReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "GithubInstallationReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -2544,6 +2724,7 @@ def github_installation_with_http_info( response_types_map=_response_types_map, ) + @validate_call def github_installation_without_preload_content( self, @@ -2552,8 +2733,9 @@ def github_installation_without_preload_content( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -2585,30 +2767,32 @@ def github_installation_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._github_installation_serialize( body=body, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "GithubInstallationReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "GithubInstallationReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) return response_data.response + def _github_installation_serialize( self, body, @@ -2620,7 +2804,8 @@ def _github_installation_serialize( _host = None - _collection_formats: Dict[str, str] = {} + _collection_formats: Dict[str, str] = { + } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -2639,16 +2824,24 @@ def _github_installation_serialize( if body is not None: _body_params = body + # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept(["*/*"]) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + '*/*' + ] + ) + # authentication setting - _auth_settings: List[str] = ["Bearer"] + _auth_settings: List[str] = [ + 'Bearer' + ] return self.api_client.param_serialize( - method="POST", - resource_path="/v1/github/installation", + method='POST', + resource_path='/v1/github/installation', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -2658,9 +2851,12 @@ def _github_installation_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth, + _request_auth=_request_auth ) + + + @validate_call def reactivate_organization( self, @@ -2670,8 +2866,9 @@ def reactivate_organization( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -2705,7 +2902,7 @@ def reactivate_organization( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._reactivate_organization_serialize( id=id, @@ -2713,20 +2910,21 @@ def reactivate_organization( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ReactivateOrganizationReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "ReactivateOrganizationReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -2734,6 +2932,7 @@ def reactivate_organization( response_types_map=_response_types_map, ).data + @validate_call def reactivate_organization_with_http_info( self, @@ -2743,8 +2942,9 @@ def reactivate_organization_with_http_info( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -2778,7 +2978,7 @@ def reactivate_organization_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._reactivate_organization_serialize( id=id, @@ -2786,20 +2986,21 @@ def reactivate_organization_with_http_info( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ReactivateOrganizationReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "ReactivateOrganizationReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -2807,6 +3008,7 @@ def reactivate_organization_with_http_info( response_types_map=_response_types_map, ) + @validate_call def reactivate_organization_without_preload_content( self, @@ -2816,8 +3018,9 @@ def reactivate_organization_without_preload_content( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -2851,7 +3054,7 @@ def reactivate_organization_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._reactivate_organization_serialize( id=id, @@ -2859,23 +3062,25 @@ def reactivate_organization_without_preload_content( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ReactivateOrganizationReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "ReactivateOrganizationReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) return response_data.response + def _reactivate_organization_serialize( self, id, @@ -2888,7 +3093,8 @@ def _reactivate_organization_serialize( _host = None - _collection_formats: Dict[str, str] = {} + _collection_formats: Dict[str, str] = { + } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -2901,7 +3107,7 @@ def _reactivate_organization_serialize( # process the path parameters if id is not None: - _path_params["id"] = id + _path_params['id'] = id # process the query parameters # process the header parameters # process the form parameters @@ -2909,16 +3115,24 @@ def _reactivate_organization_serialize( if body is not None: _body_params = body + # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept(["*/*"]) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + '*/*' + ] + ) + # authentication setting - _auth_settings: List[str] = ["Bearer"] + _auth_settings: List[str] = [ + 'Bearer' + ] return self.api_client.param_serialize( - method="POST", - resource_path="/v1/organizations/{id}/reactivate", + method='POST', + resource_path='/v1/organizations/{id}/reactivate', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -2928,23 +3142,25 @@ def _reactivate_organization_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth, + _request_auth=_request_auth ) + + + @validate_call def switch_organization( self, id: StrictStr, body: Dict[str, Any], - seon_fp: Annotated[ - Optional[StrictStr], Field(description="Seon Fingerprint") - ] = None, + seon_fp: Annotated[Optional[StrictStr], Field(description="Seon Fingerprint")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -2980,7 +3196,7 @@ def switch_organization( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._switch_organization_serialize( id=id, @@ -2989,20 +3205,21 @@ def switch_organization( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "LoginReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "LoginReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -3010,20 +3227,20 @@ def switch_organization( response_types_map=_response_types_map, ).data + @validate_call def switch_organization_with_http_info( self, id: StrictStr, body: Dict[str, Any], - seon_fp: Annotated[ - Optional[StrictStr], Field(description="Seon Fingerprint") - ] = None, + seon_fp: Annotated[Optional[StrictStr], Field(description="Seon Fingerprint")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -3059,7 +3276,7 @@ def switch_organization_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._switch_organization_serialize( id=id, @@ -3068,20 +3285,21 @@ def switch_organization_with_http_info( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "LoginReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "LoginReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -3089,20 +3307,20 @@ def switch_organization_with_http_info( response_types_map=_response_types_map, ) + @validate_call def switch_organization_without_preload_content( self, id: StrictStr, body: Dict[str, Any], - seon_fp: Annotated[ - Optional[StrictStr], Field(description="Seon Fingerprint") - ] = None, + seon_fp: Annotated[Optional[StrictStr], Field(description="Seon Fingerprint")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -3138,7 +3356,7 @@ def switch_organization_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._switch_organization_serialize( id=id, @@ -3147,23 +3365,25 @@ def switch_organization_without_preload_content( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "LoginReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "LoginReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) return response_data.response + def _switch_organization_serialize( self, id, @@ -3177,7 +3397,8 @@ def _switch_organization_serialize( _host = None - _collection_formats: Dict[str, str] = {} + _collection_formats: Dict[str, str] = { + } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -3190,26 +3411,34 @@ def _switch_organization_serialize( # process the path parameters if id is not None: - _path_params["id"] = id + _path_params['id'] = id # process the query parameters # process the header parameters if seon_fp is not None: - _header_params["seon-fp"] = seon_fp + _header_params['seon-fp'] = seon_fp # process the form parameters # process the body parameter if body is not None: _body_params = body + # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept(["*/*"]) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + '*/*' + ] + ) + # authentication setting - _auth_settings: List[str] = ["Bearer"] + _auth_settings: List[str] = [ + 'Bearer' + ] return self.api_client.param_serialize( - method="POST", - resource_path="/v1/organizations/{id}/switch", + method='POST', + resource_path='/v1/organizations/{id}/switch', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -3219,22 +3448,24 @@ def _switch_organization_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth, + _request_auth=_request_auth ) + + + @validate_call def unscope_organization_token( self, body: Dict[str, Any], - seon_fp: Annotated[ - Optional[StrictStr], Field(description="Seon Fingerprint") - ] = None, + seon_fp: Annotated[Optional[StrictStr], Field(description="Seon Fingerprint")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -3269,7 +3500,7 @@ def unscope_organization_token( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._unscope_organization_token_serialize( body=body, @@ -3277,20 +3508,21 @@ def unscope_organization_token( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "LoginReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "LoginReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -3298,19 +3530,19 @@ def unscope_organization_token( response_types_map=_response_types_map, ).data + @validate_call def unscope_organization_token_with_http_info( self, body: Dict[str, Any], - seon_fp: Annotated[ - Optional[StrictStr], Field(description="Seon Fingerprint") - ] = None, + seon_fp: Annotated[Optional[StrictStr], Field(description="Seon Fingerprint")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -3345,7 +3577,7 @@ def unscope_organization_token_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._unscope_organization_token_serialize( body=body, @@ -3353,20 +3585,21 @@ def unscope_organization_token_with_http_info( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "LoginReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "LoginReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -3374,19 +3607,19 @@ def unscope_organization_token_with_http_info( response_types_map=_response_types_map, ) + @validate_call def unscope_organization_token_without_preload_content( self, body: Dict[str, Any], - seon_fp: Annotated[ - Optional[StrictStr], Field(description="Seon Fingerprint") - ] = None, + seon_fp: Annotated[Optional[StrictStr], Field(description="Seon Fingerprint")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -3421,7 +3654,7 @@ def unscope_organization_token_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._unscope_organization_token_serialize( body=body, @@ -3429,23 +3662,25 @@ def unscope_organization_token_without_preload_content( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "LoginReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "LoginReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) return response_data.response + def _unscope_organization_token_serialize( self, body, @@ -3458,7 +3693,8 @@ def _unscope_organization_token_serialize( _host = None - _collection_formats: Dict[str, str] = {} + _collection_formats: Dict[str, str] = { + } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -3473,22 +3709,30 @@ def _unscope_organization_token_serialize( # process the query parameters # process the header parameters if seon_fp is not None: - _header_params["seon-fp"] = seon_fp + _header_params['seon-fp'] = seon_fp # process the form parameters # process the body parameter if body is not None: _body_params = body + # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept(["*/*"]) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + '*/*' + ] + ) + # authentication setting - _auth_settings: List[str] = ["Bearer"] + _auth_settings: List[str] = [ + 'Bearer' + ] return self.api_client.param_serialize( - method="POST", - resource_path="/v1/unscope_organization_token", + method='POST', + resource_path='/v1/unscope_organization_token', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -3498,9 +3742,12 @@ def _unscope_organization_token_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth, + _request_auth=_request_auth ) + + + @validate_call def update_budget( self, @@ -3510,8 +3757,9 @@ def update_budget( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -3545,7 +3793,7 @@ def update_budget( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._update_budget_serialize( organization_id=organization_id, @@ -3553,20 +3801,21 @@ def update_budget( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "UpdateBudgetReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "UpdateBudgetReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -3574,6 +3823,7 @@ def update_budget( response_types_map=_response_types_map, ).data + @validate_call def update_budget_with_http_info( self, @@ -3583,8 +3833,9 @@ def update_budget_with_http_info( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -3618,7 +3869,7 @@ def update_budget_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._update_budget_serialize( organization_id=organization_id, @@ -3626,20 +3877,21 @@ def update_budget_with_http_info( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "UpdateBudgetReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "UpdateBudgetReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -3647,6 +3899,7 @@ def update_budget_with_http_info( response_types_map=_response_types_map, ) + @validate_call def update_budget_without_preload_content( self, @@ -3656,8 +3909,9 @@ def update_budget_without_preload_content( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -3691,7 +3945,7 @@ def update_budget_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._update_budget_serialize( organization_id=organization_id, @@ -3699,23 +3953,25 @@ def update_budget_without_preload_content( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "UpdateBudgetReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "UpdateBudgetReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) return response_data.response + def _update_budget_serialize( self, organization_id, @@ -3728,7 +3984,8 @@ def _update_budget_serialize( _host = None - _collection_formats: Dict[str, str] = {} + _collection_formats: Dict[str, str] = { + } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -3741,7 +3998,7 @@ def _update_budget_serialize( # process the path parameters if organization_id is not None: - _path_params["organization_id"] = organization_id + _path_params['organization_id'] = organization_id # process the query parameters # process the header parameters # process the form parameters @@ -3749,16 +4006,24 @@ def _update_budget_serialize( if body is not None: _body_params = body + # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept(["*/*"]) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + '*/*' + ] + ) + # authentication setting - _auth_settings: List[str] = ["Bearer"] + _auth_settings: List[str] = [ + 'Bearer' + ] return self.api_client.param_serialize( - method="PUT", - resource_path="/v1/organizations/{organization_id}/budget", + method='PUT', + resource_path='/v1/organizations/{organization_id}/budget', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -3768,9 +4033,12 @@ def _update_budget_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth, + _request_auth=_request_auth ) + + + @validate_call def update_organization( self, @@ -3781,8 +4049,9 @@ def update_organization( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -3818,7 +4087,7 @@ def update_organization( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._update_organization_serialize( id=id, @@ -3827,20 +4096,21 @@ def update_organization( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "UpdateOrganizationReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "UpdateOrganizationReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -3848,6 +4118,7 @@ def update_organization( response_types_map=_response_types_map, ).data + @validate_call def update_organization_with_http_info( self, @@ -3858,8 +4129,9 @@ def update_organization_with_http_info( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -3895,7 +4167,7 @@ def update_organization_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._update_organization_serialize( id=id, @@ -3904,20 +4176,21 @@ def update_organization_with_http_info( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "UpdateOrganizationReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "UpdateOrganizationReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -3925,6 +4198,7 @@ def update_organization_with_http_info( response_types_map=_response_types_map, ) + @validate_call def update_organization_without_preload_content( self, @@ -3935,8 +4209,9 @@ def update_organization_without_preload_content( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -3972,7 +4247,7 @@ def update_organization_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._update_organization_serialize( id=id, @@ -3981,23 +4256,25 @@ def update_organization_without_preload_content( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "UpdateOrganizationReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "UpdateOrganizationReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) return response_data.response + def _update_organization_serialize( self, id, @@ -4011,7 +4288,8 @@ def _update_organization_serialize( _host = None - _collection_formats: Dict[str, str] = {} + _collection_formats: Dict[str, str] = { + } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -4024,28 +4302,36 @@ def _update_organization_serialize( # process the path parameters if id is not None: - _path_params["id"] = id + _path_params['id'] = id # process the query parameters if update_mask is not None: - - _query_params.append(("update_mask", update_mask)) - + + _query_params.append(('update_mask', update_mask)) + # process the header parameters # process the form parameters # process the body parameter if organization is not None: _body_params = organization + # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept(["*/*"]) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + '*/*' + ] + ) + # authentication setting - _auth_settings: List[str] = ["Bearer"] + _auth_settings: List[str] = [ + 'Bearer' + ] return self.api_client.param_serialize( - method="PUT", - resource_path="/v1/organizations/{id}", + method='PUT', + resource_path='/v1/organizations/{id}', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -4055,9 +4341,12 @@ def _update_organization_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth, + _request_auth=_request_auth ) + + + @validate_call def update_organization2( self, @@ -4068,8 +4357,9 @@ def update_organization2( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -4105,7 +4395,7 @@ def update_organization2( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._update_organization2_serialize( id=id, @@ -4114,20 +4404,21 @@ def update_organization2( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "UpdateOrganizationReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "UpdateOrganizationReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -4135,6 +4426,7 @@ def update_organization2( response_types_map=_response_types_map, ).data + @validate_call def update_organization2_with_http_info( self, @@ -4145,8 +4437,9 @@ def update_organization2_with_http_info( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -4182,7 +4475,7 @@ def update_organization2_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._update_organization2_serialize( id=id, @@ -4191,20 +4484,21 @@ def update_organization2_with_http_info( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "UpdateOrganizationReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "UpdateOrganizationReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -4212,6 +4506,7 @@ def update_organization2_with_http_info( response_types_map=_response_types_map, ) + @validate_call def update_organization2_without_preload_content( self, @@ -4222,8 +4517,9 @@ def update_organization2_without_preload_content( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -4259,7 +4555,7 @@ def update_organization2_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._update_organization2_serialize( id=id, @@ -4268,23 +4564,25 @@ def update_organization2_without_preload_content( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "UpdateOrganizationReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "UpdateOrganizationReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) return response_data.response + def _update_organization2_serialize( self, id, @@ -4298,7 +4596,8 @@ def _update_organization2_serialize( _host = None - _collection_formats: Dict[str, str] = {} + _collection_formats: Dict[str, str] = { + } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -4311,28 +4610,36 @@ def _update_organization2_serialize( # process the path parameters if id is not None: - _path_params["id"] = id + _path_params['id'] = id # process the query parameters if update_mask is not None: - - _query_params.append(("update_mask", update_mask)) - + + _query_params.append(('update_mask', update_mask)) + # process the header parameters # process the form parameters # process the body parameter if organization is not None: _body_params = organization + # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept(["*/*"]) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + '*/*' + ] + ) + # authentication setting - _auth_settings: List[str] = ["Bearer"] + _auth_settings: List[str] = [ + 'Bearer' + ] return self.api_client.param_serialize( - method="PATCH", - resource_path="/v1/organizations/{id}", + method='PATCH', + resource_path='/v1/organizations/{id}', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -4342,9 +4649,303 @@ def _update_organization2_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def update_organization_default_project( + self, + id: StrictStr, + body: UpdateOrganizationDefaultProjectRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> UpdateOrganizationDefaultProjectReply: + """Update Organization's default project + + + :param id: (required) + :type id: str + :param body: (required) + :type body: UpdateOrganizationDefaultProjectRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_organization_default_project_serialize( + id=id, + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "UpdateOrganizationDefaultProjectReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def update_organization_default_project_with_http_info( + self, + id: StrictStr, + body: UpdateOrganizationDefaultProjectRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[UpdateOrganizationDefaultProjectReply]: + """Update Organization's default project + + + :param id: (required) + :type id: str + :param body: (required) + :type body: UpdateOrganizationDefaultProjectRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_organization_default_project_serialize( + id=id, + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "UpdateOrganizationDefaultProjectReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def update_organization_default_project_without_preload_content( + self, + id: StrictStr, + body: UpdateOrganizationDefaultProjectRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Update Organization's default project + + + :param id: (required) + :type id: str + :param body: (required) + :type body: UpdateOrganizationDefaultProjectRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_organization_default_project_serialize( + id=id, + body=body, _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) + _response_types_map: Dict[str, Optional[str]] = { + '200': "UpdateOrganizationDefaultProjectReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _update_organization_default_project_serialize( + self, + id, + body, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if body is not None: + _body_params = body + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + '*/*' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'Bearer' + ] + + return self.api_client.param_serialize( + method='PUT', + resource_path='/v1/organizations/{id}/default_project', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + @validate_call def update_organization_name( self, @@ -4354,15 +4955,16 @@ def update_organization_name( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> UpdateOrganizationNameReply: - """Update Organization + """Update Organization Name :param id: (required) @@ -4389,7 +4991,7 @@ def update_organization_name( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._update_organization_name_serialize( id=id, @@ -4397,20 +4999,21 @@ def update_organization_name( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "UpdateOrganizationNameReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "UpdateOrganizationNameReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -4418,6 +5021,7 @@ def update_organization_name( response_types_map=_response_types_map, ).data + @validate_call def update_organization_name_with_http_info( self, @@ -4427,15 +5031,16 @@ def update_organization_name_with_http_info( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> ApiResponse[UpdateOrganizationNameReply]: - """Update Organization + """Update Organization Name :param id: (required) @@ -4462,7 +5067,7 @@ def update_organization_name_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._update_organization_name_serialize( id=id, @@ -4470,20 +5075,21 @@ def update_organization_name_with_http_info( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "UpdateOrganizationNameReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "UpdateOrganizationNameReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -4491,6 +5097,7 @@ def update_organization_name_with_http_info( response_types_map=_response_types_map, ) + @validate_call def update_organization_name_without_preload_content( self, @@ -4500,15 +5107,16 @@ def update_organization_name_without_preload_content( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Update Organization + """Update Organization Name :param id: (required) @@ -4535,7 +5143,7 @@ def update_organization_name_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._update_organization_name_serialize( id=id, @@ -4543,23 +5151,25 @@ def update_organization_name_without_preload_content( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "UpdateOrganizationNameReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "UpdateOrganizationNameReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) return response_data.response + def _update_organization_name_serialize( self, id, @@ -4572,7 +5182,8 @@ def _update_organization_name_serialize( _host = None - _collection_formats: Dict[str, str] = {} + _collection_formats: Dict[str, str] = { + } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -4585,7 +5196,7 @@ def _update_organization_name_serialize( # process the path parameters if id is not None: - _path_params["id"] = id + _path_params['id'] = id # process the query parameters # process the header parameters # process the form parameters @@ -4593,16 +5204,24 @@ def _update_organization_name_serialize( if body is not None: _body_params = body + # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept(["*/*"]) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + '*/*' + ] + ) + # authentication setting - _auth_settings: List[str] = ["Bearer"] + _auth_settings: List[str] = [ + 'Bearer' + ] return self.api_client.param_serialize( - method="PUT", - resource_path="/v1/organizations/{id}/name", + method='PUT', + resource_path='/v1/organizations/{id}/name', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -4612,9 +5231,12 @@ def _update_organization_name_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth, + _request_auth=_request_auth ) + + + @validate_call def update_organization_plan( self, @@ -4624,8 +5246,9 @@ def update_organization_plan( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -4659,7 +5282,7 @@ def update_organization_plan( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._update_organization_plan_serialize( id=id, @@ -4667,20 +5290,21 @@ def update_organization_plan( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "UpdateOrganizationPlanReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "UpdateOrganizationPlanReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -4688,6 +5312,7 @@ def update_organization_plan( response_types_map=_response_types_map, ).data + @validate_call def update_organization_plan_with_http_info( self, @@ -4697,8 +5322,9 @@ def update_organization_plan_with_http_info( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -4732,7 +5358,7 @@ def update_organization_plan_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._update_organization_plan_serialize( id=id, @@ -4740,20 +5366,21 @@ def update_organization_plan_with_http_info( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "UpdateOrganizationPlanReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "UpdateOrganizationPlanReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -4761,6 +5388,7 @@ def update_organization_plan_with_http_info( response_types_map=_response_types_map, ) + @validate_call def update_organization_plan_without_preload_content( self, @@ -4770,8 +5398,9 @@ def update_organization_plan_without_preload_content( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -4805,7 +5434,7 @@ def update_organization_plan_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._update_organization_plan_serialize( id=id, @@ -4813,23 +5442,25 @@ def update_organization_plan_without_preload_content( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "UpdateOrganizationPlanReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "UpdateOrganizationPlanReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) return response_data.response + def _update_organization_plan_serialize( self, id, @@ -4842,7 +5473,8 @@ def _update_organization_plan_serialize( _host = None - _collection_formats: Dict[str, str] = {} + _collection_formats: Dict[str, str] = { + } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -4855,7 +5487,7 @@ def _update_organization_plan_serialize( # process the path parameters if id is not None: - _path_params["id"] = id + _path_params['id'] = id # process the query parameters # process the header parameters # process the form parameters @@ -4863,16 +5495,24 @@ def _update_organization_plan_serialize( if body is not None: _body_params = body + # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept(["*/*"]) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + '*/*' + ] + ) + # authentication setting - _auth_settings: List[str] = ["Bearer"] + _auth_settings: List[str] = [ + 'Bearer' + ] return self.api_client.param_serialize( - method="POST", - resource_path="/v1/organizations/{id}/plan", + method='POST', + resource_path='/v1/organizations/{id}/plan', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -4882,9 +5522,12 @@ def _update_organization_plan_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth, + _request_auth=_request_auth ) + + + @validate_call def upsert_signup_qualification( self, @@ -4894,8 +5537,9 @@ def upsert_signup_qualification( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -4929,7 +5573,7 @@ def upsert_signup_qualification( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._upsert_signup_qualification_serialize( id=id, @@ -4937,20 +5581,21 @@ def upsert_signup_qualification( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "UpsertSignupQualificationReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "UpsertSignupQualificationReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -4958,6 +5603,7 @@ def upsert_signup_qualification( response_types_map=_response_types_map, ).data + @validate_call def upsert_signup_qualification_with_http_info( self, @@ -4967,8 +5613,9 @@ def upsert_signup_qualification_with_http_info( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -5002,7 +5649,7 @@ def upsert_signup_qualification_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._upsert_signup_qualification_serialize( id=id, @@ -5010,20 +5657,21 @@ def upsert_signup_qualification_with_http_info( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "UpsertSignupQualificationReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "UpsertSignupQualificationReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -5031,6 +5679,7 @@ def upsert_signup_qualification_with_http_info( response_types_map=_response_types_map, ) + @validate_call def upsert_signup_qualification_without_preload_content( self, @@ -5040,8 +5689,9 @@ def upsert_signup_qualification_without_preload_content( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -5075,7 +5725,7 @@ def upsert_signup_qualification_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._upsert_signup_qualification_serialize( id=id, @@ -5083,23 +5733,25 @@ def upsert_signup_qualification_without_preload_content( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "UpsertSignupQualificationReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "UpsertSignupQualificationReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) return response_data.response + def _upsert_signup_qualification_serialize( self, id, @@ -5112,7 +5764,8 @@ def _upsert_signup_qualification_serialize( _host = None - _collection_formats: Dict[str, str] = {} + _collection_formats: Dict[str, str] = { + } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -5125,7 +5778,7 @@ def _upsert_signup_qualification_serialize( # process the path parameters if id is not None: - _path_params["id"] = id + _path_params['id'] = id # process the query parameters # process the header parameters # process the form parameters @@ -5133,16 +5786,24 @@ def _upsert_signup_qualification_serialize( if body is not None: _body_params = body + # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept(["*/*"]) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + '*/*' + ] + ) + # authentication setting - _auth_settings: List[str] = ["Bearer"] + _auth_settings: List[str] = [ + 'Bearer' + ] return self.api_client.param_serialize( - method="POST", - resource_path="/v1/organizations/{id}/signup_qualification", + method='POST', + resource_path='/v1/organizations/{id}/signup_qualification', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -5152,5 +5813,7 @@ def _upsert_signup_qualification_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth, + _request_auth=_request_auth ) + + diff --git a/koyeb/api/api/organization_confirmations_api.py b/koyeb/api/api/organization_confirmations_api.py index 1a32a605..e8c9b428 100644 --- a/koyeb/api/api/organization_confirmations_api.py +++ b/koyeb/api/api/organization_confirmations_api.py @@ -1,16 +1,15 @@ -# coding: utf-8 - """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 + import warnings from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt from typing import Any, Dict, List, Optional, Tuple, Union @@ -36,6 +35,7 @@ def __init__(self, api_client=None) -> None: api_client = ApiClient.get_default() self.api_client = api_client + @validate_call def confirm_organization_action( self, @@ -44,8 +44,9 @@ def confirm_organization_action( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -77,27 +78,28 @@ def confirm_organization_action( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._confirm_organization_action_serialize( id=id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "object", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "object", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -105,6 +107,7 @@ def confirm_organization_action( response_types_map=_response_types_map, ).data + @validate_call def confirm_organization_action_with_http_info( self, @@ -113,8 +116,9 @@ def confirm_organization_action_with_http_info( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -146,27 +150,28 @@ def confirm_organization_action_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._confirm_organization_action_serialize( id=id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "object", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "object", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -174,6 +179,7 @@ def confirm_organization_action_with_http_info( response_types_map=_response_types_map, ) + @validate_call def confirm_organization_action_without_preload_content( self, @@ -182,8 +188,9 @@ def confirm_organization_action_without_preload_content( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -215,30 +222,32 @@ def confirm_organization_action_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._confirm_organization_action_serialize( id=id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "object", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "object", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) return response_data.response + def _confirm_organization_action_serialize( self, id, @@ -250,7 +259,8 @@ def _confirm_organization_action_serialize( _host = None - _collection_formats: Dict[str, str] = {} + _collection_formats: Dict[str, str] = { + } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -263,22 +273,30 @@ def _confirm_organization_action_serialize( # process the path parameters if id is not None: - _path_params["id"] = id + _path_params['id'] = id # process the query parameters # process the header parameters # process the form parameters # process the body parameter + # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept(["*/*"]) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + '*/*' + ] + ) + # authentication setting - _auth_settings: List[str] = ["Bearer"] + _auth_settings: List[str] = [ + 'Bearer' + ] return self.api_client.param_serialize( - method="POST", - resource_path="/v1/organization_confirmations/{id}", + method='POST', + resource_path='/v1/organization_confirmations/{id}', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -288,5 +306,7 @@ def _confirm_organization_action_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth, + _request_auth=_request_auth ) + + diff --git a/koyeb/api/api/organization_invitations_api.py b/koyeb/api/api/organization_invitations_api.py index 90f4fa7c..164a5fa7 100644 --- a/koyeb/api/api/organization_invitations_api.py +++ b/koyeb/api/api/organization_invitations_api.py @@ -1,16 +1,15 @@ -# coding: utf-8 - """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 + import warnings from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt from typing import Any, Dict, List, Optional, Tuple, Union @@ -19,21 +18,11 @@ from pydantic import Field, StrictStr, field_validator from typing import Any, Dict, List, Optional from typing_extensions import Annotated -from koyeb.api.models.create_organization_invitation_reply import ( - CreateOrganizationInvitationReply, -) -from koyeb.api.models.create_organization_invitation_request import ( - CreateOrganizationInvitationRequest, -) -from koyeb.api.models.get_organization_invitation_reply import ( - GetOrganizationInvitationReply, -) -from koyeb.api.models.list_organization_invitations_reply import ( - ListOrganizationInvitationsReply, -) -from koyeb.api.models.resend_organization_invitation_reply import ( - ResendOrganizationInvitationReply, -) +from koyeb.api.models.create_organization_invitation_reply import CreateOrganizationInvitationReply +from koyeb.api.models.create_organization_invitation_request import CreateOrganizationInvitationRequest +from koyeb.api.models.get_organization_invitation_reply import GetOrganizationInvitationReply +from koyeb.api.models.list_organization_invitations_reply import ListOrganizationInvitationsReply +from koyeb.api.models.resend_organization_invitation_reply import ResendOrganizationInvitationReply from koyeb.api.api_client import ApiClient, RequestSerialized from koyeb.api.api_response import ApiResponse @@ -52,6 +41,7 @@ def __init__(self, api_client=None) -> None: api_client = ApiClient.get_default() self.api_client = api_client + @validate_call def create_organization_invitation( self, @@ -60,8 +50,9 @@ def create_organization_invitation( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -93,27 +84,28 @@ def create_organization_invitation( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._create_organization_invitation_serialize( body=body, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "CreateOrganizationInvitationReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "CreateOrganizationInvitationReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -121,6 +113,7 @@ def create_organization_invitation( response_types_map=_response_types_map, ).data + @validate_call def create_organization_invitation_with_http_info( self, @@ -129,8 +122,9 @@ def create_organization_invitation_with_http_info( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -162,27 +156,28 @@ def create_organization_invitation_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._create_organization_invitation_serialize( body=body, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "CreateOrganizationInvitationReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "CreateOrganizationInvitationReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -190,6 +185,7 @@ def create_organization_invitation_with_http_info( response_types_map=_response_types_map, ) + @validate_call def create_organization_invitation_without_preload_content( self, @@ -198,8 +194,9 @@ def create_organization_invitation_without_preload_content( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -231,30 +228,32 @@ def create_organization_invitation_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._create_organization_invitation_serialize( body=body, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "CreateOrganizationInvitationReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "CreateOrganizationInvitationReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) return response_data.response + def _create_organization_invitation_serialize( self, body, @@ -266,7 +265,8 @@ def _create_organization_invitation_serialize( _host = None - _collection_formats: Dict[str, str] = {} + _collection_formats: Dict[str, str] = { + } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -285,16 +285,24 @@ def _create_organization_invitation_serialize( if body is not None: _body_params = body + # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept(["*/*"]) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + '*/*' + ] + ) + # authentication setting - _auth_settings: List[str] = ["Bearer"] + _auth_settings: List[str] = [ + 'Bearer' + ] return self.api_client.param_serialize( - method="POST", - resource_path="/v1/organization_invitations", + method='POST', + resource_path='/v1/organization_invitations', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -304,22 +312,23 @@ def _create_organization_invitation_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth, + _request_auth=_request_auth ) + + + @validate_call def delete_organization_invitation( self, - id: Annotated[ - StrictStr, - Field(description="The id of the organization invitation to delete"), - ], + id: Annotated[StrictStr, Field(description="The id of the organization invitation to delete")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -351,27 +360,28 @@ def delete_organization_invitation( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._delete_organization_invitation_serialize( id=id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "object", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "object", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -379,19 +389,18 @@ def delete_organization_invitation( response_types_map=_response_types_map, ).data + @validate_call def delete_organization_invitation_with_http_info( self, - id: Annotated[ - StrictStr, - Field(description="The id of the organization invitation to delete"), - ], + id: Annotated[StrictStr, Field(description="The id of the organization invitation to delete")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -423,27 +432,28 @@ def delete_organization_invitation_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._delete_organization_invitation_serialize( id=id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "object", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "object", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -451,19 +461,18 @@ def delete_organization_invitation_with_http_info( response_types_map=_response_types_map, ) + @validate_call def delete_organization_invitation_without_preload_content( self, - id: Annotated[ - StrictStr, - Field(description="The id of the organization invitation to delete"), - ], + id: Annotated[StrictStr, Field(description="The id of the organization invitation to delete")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -495,30 +504,32 @@ def delete_organization_invitation_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._delete_organization_invitation_serialize( id=id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "object", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "object", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) return response_data.response + def _delete_organization_invitation_serialize( self, id, @@ -530,7 +541,8 @@ def _delete_organization_invitation_serialize( _host = None - _collection_formats: Dict[str, str] = {} + _collection_formats: Dict[str, str] = { + } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -543,22 +555,30 @@ def _delete_organization_invitation_serialize( # process the path parameters if id is not None: - _path_params["id"] = id + _path_params['id'] = id # process the query parameters # process the header parameters # process the form parameters # process the body parameter + # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept(["*/*"]) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + '*/*' + ] + ) + # authentication setting - _auth_settings: List[str] = ["Bearer"] + _auth_settings: List[str] = [ + 'Bearer' + ] return self.api_client.param_serialize( - method="DELETE", - resource_path="/v1/organization_invitations/{id}", + method='DELETE', + resource_path='/v1/organization_invitations/{id}', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -568,9 +588,12 @@ def _delete_organization_invitation_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth, + _request_auth=_request_auth ) + + + @validate_call def get_organization_invitation( self, @@ -579,8 +602,9 @@ def get_organization_invitation( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -612,27 +636,28 @@ def get_organization_invitation( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._get_organization_invitation_serialize( id=id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "GetOrganizationInvitationReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "GetOrganizationInvitationReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -640,6 +665,7 @@ def get_organization_invitation( response_types_map=_response_types_map, ).data + @validate_call def get_organization_invitation_with_http_info( self, @@ -648,8 +674,9 @@ def get_organization_invitation_with_http_info( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -681,27 +708,28 @@ def get_organization_invitation_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._get_organization_invitation_serialize( id=id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "GetOrganizationInvitationReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "GetOrganizationInvitationReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -709,6 +737,7 @@ def get_organization_invitation_with_http_info( response_types_map=_response_types_map, ) + @validate_call def get_organization_invitation_without_preload_content( self, @@ -717,8 +746,9 @@ def get_organization_invitation_without_preload_content( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -750,30 +780,32 @@ def get_organization_invitation_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._get_organization_invitation_serialize( id=id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "GetOrganizationInvitationReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "GetOrganizationInvitationReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) return response_data.response + def _get_organization_invitation_serialize( self, id, @@ -785,7 +817,8 @@ def _get_organization_invitation_serialize( _host = None - _collection_formats: Dict[str, str] = {} + _collection_formats: Dict[str, str] = { + } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -798,22 +831,30 @@ def _get_organization_invitation_serialize( # process the path parameters if id is not None: - _path_params["id"] = id + _path_params['id'] = id # process the query parameters # process the header parameters # process the form parameters # process the body parameter + # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept(["*/*"]) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + '*/*' + ] + ) + # authentication setting - _auth_settings: List[str] = ["Bearer"] + _auth_settings: List[str] = [ + 'Bearer' + ] return self.api_client.param_serialize( - method="GET", - resource_path="/v1/organization_invitations/{id}", + method='GET', + resource_path='/v1/organization_invitations/{id}', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -823,36 +864,26 @@ def _get_organization_invitation_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth, + _request_auth=_request_auth ) + + + @validate_call def list_organization_invitations( self, - limit: Annotated[ - Optional[StrictStr], - Field(description="(Optional) The number of items to return"), - ] = None, - offset: Annotated[ - Optional[StrictStr], - Field(description="(Optional) The offset in the list of item to return"), - ] = None, - statuses: Annotated[ - Optional[List[StrictStr]], - Field(description="(Optional) Filter on organization invitation statuses"), - ] = None, - user_id: Annotated[ - Optional[StrictStr], - Field( - description="(Optional) Filter on invitee ID. Will match both invitations sent to that user_id and invitations sent to the email of that user_id. The only valid value is the requester's user_id" - ), - ] = None, + limit: Annotated[Optional[StrictStr], Field(description="(Optional) The number of items to return")] = None, + offset: Annotated[Optional[StrictStr], Field(description="(Optional) The offset in the list of item to return")] = None, + statuses: Annotated[Optional[List[StrictStr]], Field(description="(Optional) Filter on organization invitation statuses")] = None, + user_id: Annotated[Optional[StrictStr], Field(description="(Optional) Filter on invitee ID. Will match both invitations sent to that user_id and invitations sent to the email of that user_id. The only valid value is the requester's user_id")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -890,7 +921,7 @@ def list_organization_invitations( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._list_organization_invitations_serialize( limit=limit, @@ -900,20 +931,21 @@ def list_organization_invitations( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ListOrganizationInvitationsReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "ListOrganizationInvitationsReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -921,33 +953,21 @@ def list_organization_invitations( response_types_map=_response_types_map, ).data + @validate_call def list_organization_invitations_with_http_info( self, - limit: Annotated[ - Optional[StrictStr], - Field(description="(Optional) The number of items to return"), - ] = None, - offset: Annotated[ - Optional[StrictStr], - Field(description="(Optional) The offset in the list of item to return"), - ] = None, - statuses: Annotated[ - Optional[List[StrictStr]], - Field(description="(Optional) Filter on organization invitation statuses"), - ] = None, - user_id: Annotated[ - Optional[StrictStr], - Field( - description="(Optional) Filter on invitee ID. Will match both invitations sent to that user_id and invitations sent to the email of that user_id. The only valid value is the requester's user_id" - ), - ] = None, + limit: Annotated[Optional[StrictStr], Field(description="(Optional) The number of items to return")] = None, + offset: Annotated[Optional[StrictStr], Field(description="(Optional) The offset in the list of item to return")] = None, + statuses: Annotated[Optional[List[StrictStr]], Field(description="(Optional) Filter on organization invitation statuses")] = None, + user_id: Annotated[Optional[StrictStr], Field(description="(Optional) Filter on invitee ID. Will match both invitations sent to that user_id and invitations sent to the email of that user_id. The only valid value is the requester's user_id")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -985,7 +1005,7 @@ def list_organization_invitations_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._list_organization_invitations_serialize( limit=limit, @@ -995,20 +1015,21 @@ def list_organization_invitations_with_http_info( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ListOrganizationInvitationsReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "ListOrganizationInvitationsReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -1016,33 +1037,21 @@ def list_organization_invitations_with_http_info( response_types_map=_response_types_map, ) + @validate_call def list_organization_invitations_without_preload_content( self, - limit: Annotated[ - Optional[StrictStr], - Field(description="(Optional) The number of items to return"), - ] = None, - offset: Annotated[ - Optional[StrictStr], - Field(description="(Optional) The offset in the list of item to return"), - ] = None, - statuses: Annotated[ - Optional[List[StrictStr]], - Field(description="(Optional) Filter on organization invitation statuses"), - ] = None, - user_id: Annotated[ - Optional[StrictStr], - Field( - description="(Optional) Filter on invitee ID. Will match both invitations sent to that user_id and invitations sent to the email of that user_id. The only valid value is the requester's user_id" - ), - ] = None, + limit: Annotated[Optional[StrictStr], Field(description="(Optional) The number of items to return")] = None, + offset: Annotated[Optional[StrictStr], Field(description="(Optional) The offset in the list of item to return")] = None, + statuses: Annotated[Optional[List[StrictStr]], Field(description="(Optional) Filter on organization invitation statuses")] = None, + user_id: Annotated[Optional[StrictStr], Field(description="(Optional) Filter on invitee ID. Will match both invitations sent to that user_id and invitations sent to the email of that user_id. The only valid value is the requester's user_id")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -1080,7 +1089,7 @@ def list_organization_invitations_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._list_organization_invitations_serialize( limit=limit, @@ -1090,23 +1099,25 @@ def list_organization_invitations_without_preload_content( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ListOrganizationInvitationsReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "ListOrganizationInvitationsReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) return response_data.response + def _list_organization_invitations_serialize( self, limit, @@ -1122,7 +1133,7 @@ def _list_organization_invitations_serialize( _host = None _collection_formats: Dict[str, str] = { - "statuses": "multi", + 'statuses': 'multi', } _path_params: Dict[str, str] = {} @@ -1137,35 +1148,43 @@ def _list_organization_invitations_serialize( # process the path parameters # process the query parameters if limit is not None: - - _query_params.append(("limit", limit)) - + + _query_params.append(('limit', limit)) + if offset is not None: - - _query_params.append(("offset", offset)) - + + _query_params.append(('offset', offset)) + if statuses is not None: - - _query_params.append(("statuses", statuses)) - + + _query_params.append(('statuses', statuses)) + if user_id is not None: - - _query_params.append(("user_id", user_id)) - + + _query_params.append(('user_id', user_id)) + # process the header parameters # process the form parameters # process the body parameter + # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept(["*/*"]) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + '*/*' + ] + ) + # authentication setting - _auth_settings: List[str] = ["Bearer"] + _auth_settings: List[str] = [ + 'Bearer' + ] return self.api_client.param_serialize( - method="GET", - resource_path="/v1/organization_invitations", + method='GET', + resource_path='/v1/organization_invitations', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -1175,23 +1194,24 @@ def _list_organization_invitations_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth, + _request_auth=_request_auth ) + + + @validate_call def resend_organization_invitation( self, - id: Annotated[ - StrictStr, - Field(description="The id of the organization invitation to resend"), - ], + id: Annotated[StrictStr, Field(description="The id of the organization invitation to resend")], body: Dict[str, Any], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -1225,7 +1245,7 @@ def resend_organization_invitation( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._resend_organization_invitation_serialize( id=id, @@ -1233,20 +1253,21 @@ def resend_organization_invitation( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ResendOrganizationInvitationReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "ResendOrganizationInvitationReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -1254,20 +1275,19 @@ def resend_organization_invitation( response_types_map=_response_types_map, ).data + @validate_call def resend_organization_invitation_with_http_info( self, - id: Annotated[ - StrictStr, - Field(description="The id of the organization invitation to resend"), - ], + id: Annotated[StrictStr, Field(description="The id of the organization invitation to resend")], body: Dict[str, Any], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -1301,7 +1321,7 @@ def resend_organization_invitation_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._resend_organization_invitation_serialize( id=id, @@ -1309,20 +1329,21 @@ def resend_organization_invitation_with_http_info( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ResendOrganizationInvitationReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "ResendOrganizationInvitationReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -1330,20 +1351,19 @@ def resend_organization_invitation_with_http_info( response_types_map=_response_types_map, ) + @validate_call def resend_organization_invitation_without_preload_content( self, - id: Annotated[ - StrictStr, - Field(description="The id of the organization invitation to resend"), - ], + id: Annotated[StrictStr, Field(description="The id of the organization invitation to resend")], body: Dict[str, Any], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -1377,7 +1397,7 @@ def resend_organization_invitation_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._resend_organization_invitation_serialize( id=id, @@ -1385,23 +1405,25 @@ def resend_organization_invitation_without_preload_content( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ResendOrganizationInvitationReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "ResendOrganizationInvitationReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) return response_data.response + def _resend_organization_invitation_serialize( self, id, @@ -1414,7 +1436,8 @@ def _resend_organization_invitation_serialize( _host = None - _collection_formats: Dict[str, str] = {} + _collection_formats: Dict[str, str] = { + } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -1427,7 +1450,7 @@ def _resend_organization_invitation_serialize( # process the path parameters if id is not None: - _path_params["id"] = id + _path_params['id'] = id # process the query parameters # process the header parameters # process the form parameters @@ -1435,16 +1458,24 @@ def _resend_organization_invitation_serialize( if body is not None: _body_params = body + # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept(["*/*"]) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + '*/*' + ] + ) + # authentication setting - _auth_settings: List[str] = ["Bearer"] + _auth_settings: List[str] = [ + 'Bearer' + ] return self.api_client.param_serialize( - method="POST", - resource_path="/v1/organization_invitations/{id}/resend", + method='POST', + resource_path='/v1/organization_invitations/{id}/resend', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -1454,5 +1485,7 @@ def _resend_organization_invitation_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth, + _request_auth=_request_auth ) + + diff --git a/koyeb/api/api/organization_members_api.py b/koyeb/api/api/organization_members_api.py index 8122f8c9..cd0492f2 100644 --- a/koyeb/api/api/organization_members_api.py +++ b/koyeb/api/api/organization_members_api.py @@ -1,16 +1,15 @@ -# coding: utf-8 - """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 + import warnings from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt from typing import Any, Dict, List, Optional, Tuple, Union @@ -19,12 +18,8 @@ from pydantic import Field, StrictStr, field_validator from typing import List, Optional from typing_extensions import Annotated -from koyeb.api.models.list_organization_members_reply import ( - ListOrganizationMembersReply, -) -from koyeb.api.models.remove_organization_member_reply import ( - RemoveOrganizationMemberReply, -) +from koyeb.api.models.list_organization_members_reply import ListOrganizationMembersReply +from koyeb.api.models.remove_organization_member_reply import RemoveOrganizationMemberReply from koyeb.api.api_client import ApiClient, RequestSerialized from koyeb.api.api_response import ApiResponse @@ -43,34 +38,22 @@ def __init__(self, api_client=None) -> None: api_client = ApiClient.get_default() self.api_client = api_client + @validate_call def list_organization_members( self, - limit: Annotated[ - Optional[StrictStr], - Field(description="(Optional) The number of items to return"), - ] = None, - offset: Annotated[ - Optional[StrictStr], - Field(description="(Optional) The offset in the list of item to return"), - ] = None, - organization_id: Annotated[ - Optional[StrictStr], - Field(description="(Optional) Filter for an organization"), - ] = None, - user_id: Annotated[ - Optional[StrictStr], Field(description="(Optional) Filter for an user") - ] = None, - organization_statuses: Annotated[ - Optional[List[StrictStr]], - Field(description="(Optional) Filter for organization statuses"), - ] = None, + limit: Annotated[Optional[StrictStr], Field(description="(Optional) The number of items to return")] = None, + offset: Annotated[Optional[StrictStr], Field(description="(Optional) The offset in the list of item to return")] = None, + organization_id: Annotated[Optional[StrictStr], Field(description="(Optional) Filter for an organization")] = None, + user_id: Annotated[Optional[StrictStr], Field(description="(Optional) Filter for an user")] = None, + organization_statuses: Annotated[Optional[List[StrictStr]], Field(description="(Optional) Filter for organization statuses")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -110,7 +93,7 @@ def list_organization_members( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._list_organization_members_serialize( limit=limit, @@ -121,20 +104,21 @@ def list_organization_members( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ListOrganizationMembersReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "ListOrganizationMembersReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -142,34 +126,22 @@ def list_organization_members( response_types_map=_response_types_map, ).data + @validate_call def list_organization_members_with_http_info( self, - limit: Annotated[ - Optional[StrictStr], - Field(description="(Optional) The number of items to return"), - ] = None, - offset: Annotated[ - Optional[StrictStr], - Field(description="(Optional) The offset in the list of item to return"), - ] = None, - organization_id: Annotated[ - Optional[StrictStr], - Field(description="(Optional) Filter for an organization"), - ] = None, - user_id: Annotated[ - Optional[StrictStr], Field(description="(Optional) Filter for an user") - ] = None, - organization_statuses: Annotated[ - Optional[List[StrictStr]], - Field(description="(Optional) Filter for organization statuses"), - ] = None, + limit: Annotated[Optional[StrictStr], Field(description="(Optional) The number of items to return")] = None, + offset: Annotated[Optional[StrictStr], Field(description="(Optional) The offset in the list of item to return")] = None, + organization_id: Annotated[Optional[StrictStr], Field(description="(Optional) Filter for an organization")] = None, + user_id: Annotated[Optional[StrictStr], Field(description="(Optional) Filter for an user")] = None, + organization_statuses: Annotated[Optional[List[StrictStr]], Field(description="(Optional) Filter for organization statuses")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -209,7 +181,7 @@ def list_organization_members_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._list_organization_members_serialize( limit=limit, @@ -220,20 +192,21 @@ def list_organization_members_with_http_info( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ListOrganizationMembersReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "ListOrganizationMembersReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -241,34 +214,22 @@ def list_organization_members_with_http_info( response_types_map=_response_types_map, ) + @validate_call def list_organization_members_without_preload_content( self, - limit: Annotated[ - Optional[StrictStr], - Field(description="(Optional) The number of items to return"), - ] = None, - offset: Annotated[ - Optional[StrictStr], - Field(description="(Optional) The offset in the list of item to return"), - ] = None, - organization_id: Annotated[ - Optional[StrictStr], - Field(description="(Optional) Filter for an organization"), - ] = None, - user_id: Annotated[ - Optional[StrictStr], Field(description="(Optional) Filter for an user") - ] = None, - organization_statuses: Annotated[ - Optional[List[StrictStr]], - Field(description="(Optional) Filter for organization statuses"), - ] = None, + limit: Annotated[Optional[StrictStr], Field(description="(Optional) The number of items to return")] = None, + offset: Annotated[Optional[StrictStr], Field(description="(Optional) The offset in the list of item to return")] = None, + organization_id: Annotated[Optional[StrictStr], Field(description="(Optional) Filter for an organization")] = None, + user_id: Annotated[Optional[StrictStr], Field(description="(Optional) Filter for an user")] = None, + organization_statuses: Annotated[Optional[List[StrictStr]], Field(description="(Optional) Filter for organization statuses")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -308,7 +269,7 @@ def list_organization_members_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._list_organization_members_serialize( limit=limit, @@ -319,23 +280,25 @@ def list_organization_members_without_preload_content( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ListOrganizationMembersReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "ListOrganizationMembersReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) return response_data.response + def _list_organization_members_serialize( self, limit, @@ -352,7 +315,7 @@ def _list_organization_members_serialize( _host = None _collection_formats: Dict[str, str] = { - "organization_statuses": "multi", + 'organization_statuses': 'multi', } _path_params: Dict[str, str] = {} @@ -367,39 +330,47 @@ def _list_organization_members_serialize( # process the path parameters # process the query parameters if limit is not None: - - _query_params.append(("limit", limit)) - + + _query_params.append(('limit', limit)) + if offset is not None: - - _query_params.append(("offset", offset)) - + + _query_params.append(('offset', offset)) + if organization_id is not None: - - _query_params.append(("organization_id", organization_id)) - + + _query_params.append(('organization_id', organization_id)) + if user_id is not None: - - _query_params.append(("user_id", user_id)) - + + _query_params.append(('user_id', user_id)) + if organization_statuses is not None: - - _query_params.append(("organization_statuses", organization_statuses)) - + + _query_params.append(('organization_statuses', organization_statuses)) + # process the header parameters # process the form parameters # process the body parameter + # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept(["*/*"]) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + '*/*' + ] + ) + # authentication setting - _auth_settings: List[str] = ["Bearer"] + _auth_settings: List[str] = [ + 'Bearer' + ] return self.api_client.param_serialize( - method="GET", - resource_path="/v1/organization_members", + method='GET', + resource_path='/v1/organization_members', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -409,9 +380,12 @@ def _list_organization_members_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth, + _request_auth=_request_auth ) + + + @validate_call def remove_organization_member( self, @@ -420,8 +394,9 @@ def remove_organization_member( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -453,27 +428,28 @@ def remove_organization_member( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._remove_organization_member_serialize( id=id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "RemoveOrganizationMemberReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "RemoveOrganizationMemberReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -481,6 +457,7 @@ def remove_organization_member( response_types_map=_response_types_map, ).data + @validate_call def remove_organization_member_with_http_info( self, @@ -489,8 +466,9 @@ def remove_organization_member_with_http_info( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -522,27 +500,28 @@ def remove_organization_member_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._remove_organization_member_serialize( id=id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "RemoveOrganizationMemberReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "RemoveOrganizationMemberReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -550,6 +529,7 @@ def remove_organization_member_with_http_info( response_types_map=_response_types_map, ) + @validate_call def remove_organization_member_without_preload_content( self, @@ -558,8 +538,9 @@ def remove_organization_member_without_preload_content( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -591,30 +572,32 @@ def remove_organization_member_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._remove_organization_member_serialize( id=id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "RemoveOrganizationMemberReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "RemoveOrganizationMemberReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) return response_data.response + def _remove_organization_member_serialize( self, id, @@ -626,7 +609,8 @@ def _remove_organization_member_serialize( _host = None - _collection_formats: Dict[str, str] = {} + _collection_formats: Dict[str, str] = { + } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -639,22 +623,30 @@ def _remove_organization_member_serialize( # process the path parameters if id is not None: - _path_params["id"] = id + _path_params['id'] = id # process the query parameters # process the header parameters # process the form parameters # process the body parameter + # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept(["*/*"]) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + '*/*' + ] + ) + # authentication setting - _auth_settings: List[str] = ["Bearer"] + _auth_settings: List[str] = [ + 'Bearer' + ] return self.api_client.param_serialize( - method="DELETE", - resource_path="/v1/organization_members/{id}", + method='DELETE', + resource_path='/v1/organization_members/{id}', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -664,5 +656,7 @@ def _remove_organization_member_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth, + _request_auth=_request_auth ) + + diff --git a/koyeb/api/api/organization_quotas_api.py b/koyeb/api/api/organization_quotas_api.py index 73519f92..e8d4be30 100644 --- a/koyeb/api/api/organization_quotas_api.py +++ b/koyeb/api/api/organization_quotas_api.py @@ -1,16 +1,15 @@ -# coding: utf-8 - """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 + import warnings from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt from typing import Any, Dict, List, Optional, Tuple, Union @@ -36,6 +35,7 @@ def __init__(self, api_client=None) -> None: api_client = ApiClient.get_default() self.api_client = api_client + @validate_call def get_quotas( self, @@ -44,8 +44,9 @@ def get_quotas( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -77,27 +78,28 @@ def get_quotas( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._get_quotas_serialize( organization_id=organization_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "GetQuotasReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "GetQuotasReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -105,6 +107,7 @@ def get_quotas( response_types_map=_response_types_map, ).data + @validate_call def get_quotas_with_http_info( self, @@ -113,8 +116,9 @@ def get_quotas_with_http_info( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -146,27 +150,28 @@ def get_quotas_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._get_quotas_serialize( organization_id=organization_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "GetQuotasReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "GetQuotasReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -174,6 +179,7 @@ def get_quotas_with_http_info( response_types_map=_response_types_map, ) + @validate_call def get_quotas_without_preload_content( self, @@ -182,8 +188,9 @@ def get_quotas_without_preload_content( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -215,30 +222,32 @@ def get_quotas_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._get_quotas_serialize( organization_id=organization_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "GetQuotasReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "GetQuotasReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) return response_data.response + def _get_quotas_serialize( self, organization_id, @@ -250,7 +259,8 @@ def _get_quotas_serialize( _host = None - _collection_formats: Dict[str, str] = {} + _collection_formats: Dict[str, str] = { + } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -263,22 +273,30 @@ def _get_quotas_serialize( # process the path parameters if organization_id is not None: - _path_params["organization_id"] = organization_id + _path_params['organization_id'] = organization_id # process the query parameters # process the header parameters # process the form parameters # process the body parameter + # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept(["*/*"]) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + '*/*' + ] + ) + # authentication setting - _auth_settings: List[str] = ["Bearer"] + _auth_settings: List[str] = [ + 'Bearer' + ] return self.api_client.param_serialize( - method="GET", - resource_path="/v1/organizations/{organization_id}/quotas", + method='GET', + resource_path='/v1/organizations/{organization_id}/quotas', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -288,5 +306,7 @@ def _get_quotas_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth, + _request_auth=_request_auth ) + + diff --git a/koyeb/api/api/payment_methods_api.py b/koyeb/api/api/payment_methods_api.py index f3ab67e9..feff1e65 100644 --- a/koyeb/api/api/payment_methods_api.py +++ b/koyeb/api/api/payment_methods_api.py @@ -1,16 +1,15 @@ -# coding: utf-8 - """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 + import warnings from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt from typing import Any, Dict, List, Optional, Tuple, Union @@ -19,12 +18,8 @@ from pydantic import Field, StrictStr, field_validator from typing import Any, Dict, List, Optional from typing_extensions import Annotated -from koyeb.api.models.confirm_payment_authorization_reply import ( - ConfirmPaymentAuthorizationReply, -) -from koyeb.api.models.create_payment_authorization_reply import ( - CreatePaymentAuthorizationReply, -) +from koyeb.api.models.confirm_payment_authorization_reply import ConfirmPaymentAuthorizationReply +from koyeb.api.models.create_payment_authorization_reply import CreatePaymentAuthorizationReply from koyeb.api.models.get_payment_method_reply import GetPaymentMethodReply from koyeb.api.models.list_payment_methods_reply import ListPaymentMethodsReply @@ -45,6 +40,7 @@ def __init__(self, api_client=None) -> None: api_client = ApiClient.get_default() self.api_client = api_client + @validate_call def confirm_payment_authorization( self, @@ -54,8 +50,9 @@ def confirm_payment_authorization( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -89,7 +86,7 @@ def confirm_payment_authorization( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._confirm_payment_authorization_serialize( id=id, @@ -97,20 +94,21 @@ def confirm_payment_authorization( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ConfirmPaymentAuthorizationReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "ConfirmPaymentAuthorizationReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -118,6 +116,7 @@ def confirm_payment_authorization( response_types_map=_response_types_map, ).data + @validate_call def confirm_payment_authorization_with_http_info( self, @@ -127,8 +126,9 @@ def confirm_payment_authorization_with_http_info( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -162,7 +162,7 @@ def confirm_payment_authorization_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._confirm_payment_authorization_serialize( id=id, @@ -170,20 +170,21 @@ def confirm_payment_authorization_with_http_info( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ConfirmPaymentAuthorizationReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "ConfirmPaymentAuthorizationReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -191,6 +192,7 @@ def confirm_payment_authorization_with_http_info( response_types_map=_response_types_map, ) + @validate_call def confirm_payment_authorization_without_preload_content( self, @@ -200,8 +202,9 @@ def confirm_payment_authorization_without_preload_content( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -235,7 +238,7 @@ def confirm_payment_authorization_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._confirm_payment_authorization_serialize( id=id, @@ -243,23 +246,25 @@ def confirm_payment_authorization_without_preload_content( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ConfirmPaymentAuthorizationReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "ConfirmPaymentAuthorizationReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) return response_data.response + def _confirm_payment_authorization_serialize( self, id, @@ -272,7 +277,8 @@ def _confirm_payment_authorization_serialize( _host = None - _collection_formats: Dict[str, str] = {} + _collection_formats: Dict[str, str] = { + } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -285,7 +291,7 @@ def _confirm_payment_authorization_serialize( # process the path parameters if id is not None: - _path_params["id"] = id + _path_params['id'] = id # process the query parameters # process the header parameters # process the form parameters @@ -293,16 +299,24 @@ def _confirm_payment_authorization_serialize( if body is not None: _body_params = body + # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept(["*/*"]) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + '*/*' + ] + ) + # authentication setting - _auth_settings: List[str] = ["Bearer"] + _auth_settings: List[str] = [ + 'Bearer' + ] return self.api_client.param_serialize( - method="POST", - resource_path="/v1/payment_methods/{id}/confirm", + method='POST', + resource_path='/v1/payment_methods/{id}/confirm', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -312,9 +326,12 @@ def _confirm_payment_authorization_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth, + _request_auth=_request_auth ) + + + @validate_call def create_payment_authorization( self, @@ -323,8 +340,9 @@ def create_payment_authorization( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -356,27 +374,28 @@ def create_payment_authorization( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._create_payment_authorization_serialize( body=body, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "CreatePaymentAuthorizationReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "CreatePaymentAuthorizationReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -384,6 +403,7 @@ def create_payment_authorization( response_types_map=_response_types_map, ).data + @validate_call def create_payment_authorization_with_http_info( self, @@ -392,8 +412,9 @@ def create_payment_authorization_with_http_info( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -425,27 +446,28 @@ def create_payment_authorization_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._create_payment_authorization_serialize( body=body, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "CreatePaymentAuthorizationReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "CreatePaymentAuthorizationReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -453,6 +475,7 @@ def create_payment_authorization_with_http_info( response_types_map=_response_types_map, ) + @validate_call def create_payment_authorization_without_preload_content( self, @@ -461,8 +484,9 @@ def create_payment_authorization_without_preload_content( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -494,30 +518,32 @@ def create_payment_authorization_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._create_payment_authorization_serialize( body=body, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "CreatePaymentAuthorizationReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "CreatePaymentAuthorizationReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) return response_data.response + def _create_payment_authorization_serialize( self, body, @@ -529,7 +555,8 @@ def _create_payment_authorization_serialize( _host = None - _collection_formats: Dict[str, str] = {} + _collection_formats: Dict[str, str] = { + } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -548,16 +575,24 @@ def _create_payment_authorization_serialize( if body is not None: _body_params = body + # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept(["*/*"]) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + '*/*' + ] + ) + # authentication setting - _auth_settings: List[str] = ["Bearer"] + _auth_settings: List[str] = [ + 'Bearer' + ] return self.api_client.param_serialize( - method="POST", - resource_path="/v1/payment_methods", + method='POST', + resource_path='/v1/payment_methods', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -567,9 +602,12 @@ def _create_payment_authorization_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth, + _request_auth=_request_auth ) + + + @validate_call def delete_payment_method( self, @@ -578,8 +616,9 @@ def delete_payment_method( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -611,27 +650,28 @@ def delete_payment_method( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._delete_payment_method_serialize( id=id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "object", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "object", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -639,6 +679,7 @@ def delete_payment_method( response_types_map=_response_types_map, ).data + @validate_call def delete_payment_method_with_http_info( self, @@ -647,8 +688,9 @@ def delete_payment_method_with_http_info( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -680,27 +722,28 @@ def delete_payment_method_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._delete_payment_method_serialize( id=id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "object", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "object", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -708,6 +751,7 @@ def delete_payment_method_with_http_info( response_types_map=_response_types_map, ) + @validate_call def delete_payment_method_without_preload_content( self, @@ -716,8 +760,9 @@ def delete_payment_method_without_preload_content( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -749,30 +794,32 @@ def delete_payment_method_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._delete_payment_method_serialize( id=id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "object", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "object", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) return response_data.response + def _delete_payment_method_serialize( self, id, @@ -784,7 +831,8 @@ def _delete_payment_method_serialize( _host = None - _collection_formats: Dict[str, str] = {} + _collection_formats: Dict[str, str] = { + } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -797,22 +845,30 @@ def _delete_payment_method_serialize( # process the path parameters if id is not None: - _path_params["id"] = id + _path_params['id'] = id # process the query parameters # process the header parameters # process the form parameters # process the body parameter + # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept(["*/*"]) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + '*/*' + ] + ) + # authentication setting - _auth_settings: List[str] = ["Bearer"] + _auth_settings: List[str] = [ + 'Bearer' + ] return self.api_client.param_serialize( - method="DELETE", - resource_path="/v1/payment_methods/{id}", + method='DELETE', + resource_path='/v1/payment_methods/{id}', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -822,9 +878,12 @@ def _delete_payment_method_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth, + _request_auth=_request_auth ) + + + @validate_call def get_payment_method( self, @@ -833,8 +892,9 @@ def get_payment_method( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -866,27 +926,28 @@ def get_payment_method( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._get_payment_method_serialize( id=id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "GetPaymentMethodReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "GetPaymentMethodReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -894,6 +955,7 @@ def get_payment_method( response_types_map=_response_types_map, ).data + @validate_call def get_payment_method_with_http_info( self, @@ -902,8 +964,9 @@ def get_payment_method_with_http_info( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -935,27 +998,28 @@ def get_payment_method_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._get_payment_method_serialize( id=id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "GetPaymentMethodReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "GetPaymentMethodReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -963,6 +1027,7 @@ def get_payment_method_with_http_info( response_types_map=_response_types_map, ) + @validate_call def get_payment_method_without_preload_content( self, @@ -971,8 +1036,9 @@ def get_payment_method_without_preload_content( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -1004,30 +1070,32 @@ def get_payment_method_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._get_payment_method_serialize( id=id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "GetPaymentMethodReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "GetPaymentMethodReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) return response_data.response + def _get_payment_method_serialize( self, id, @@ -1039,7 +1107,8 @@ def _get_payment_method_serialize( _host = None - _collection_formats: Dict[str, str] = {} + _collection_formats: Dict[str, str] = { + } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -1052,22 +1121,30 @@ def _get_payment_method_serialize( # process the path parameters if id is not None: - _path_params["id"] = id + _path_params['id'] = id # process the query parameters # process the header parameters # process the form parameters # process the body parameter + # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept(["*/*"]) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + '*/*' + ] + ) + # authentication setting - _auth_settings: List[str] = ["Bearer"] + _auth_settings: List[str] = [ + 'Bearer' + ] return self.api_client.param_serialize( - method="GET", - resource_path="/v1/payment_methods/{id}", + method='GET', + resource_path='/v1/payment_methods/{id}', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -1077,30 +1154,25 @@ def _get_payment_method_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth, + _request_auth=_request_auth ) + + + @validate_call def list_payment_methods( self, - limit: Annotated[ - Optional[StrictStr], - Field(description="(Optional) The number of items to return"), - ] = None, - offset: Annotated[ - Optional[StrictStr], - Field(description="(Optional) The offset in the list of item to return"), - ] = None, - statuses: Annotated[ - Optional[List[StrictStr]], - Field(description="(Optional) Filter on payment method statuses"), - ] = None, + limit: Annotated[Optional[StrictStr], Field(description="(Optional) The number of items to return")] = None, + offset: Annotated[Optional[StrictStr], Field(description="(Optional) The offset in the list of item to return")] = None, + statuses: Annotated[Optional[List[StrictStr]], Field(description="(Optional) Filter on payment method statuses")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -1136,7 +1208,7 @@ def list_payment_methods( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._list_payment_methods_serialize( limit=limit, @@ -1145,20 +1217,21 @@ def list_payment_methods( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ListPaymentMethodsReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "ListPaymentMethodsReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -1166,27 +1239,20 @@ def list_payment_methods( response_types_map=_response_types_map, ).data + @validate_call def list_payment_methods_with_http_info( self, - limit: Annotated[ - Optional[StrictStr], - Field(description="(Optional) The number of items to return"), - ] = None, - offset: Annotated[ - Optional[StrictStr], - Field(description="(Optional) The offset in the list of item to return"), - ] = None, - statuses: Annotated[ - Optional[List[StrictStr]], - Field(description="(Optional) Filter on payment method statuses"), - ] = None, + limit: Annotated[Optional[StrictStr], Field(description="(Optional) The number of items to return")] = None, + offset: Annotated[Optional[StrictStr], Field(description="(Optional) The offset in the list of item to return")] = None, + statuses: Annotated[Optional[List[StrictStr]], Field(description="(Optional) Filter on payment method statuses")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -1222,7 +1288,7 @@ def list_payment_methods_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._list_payment_methods_serialize( limit=limit, @@ -1231,20 +1297,21 @@ def list_payment_methods_with_http_info( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ListPaymentMethodsReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "ListPaymentMethodsReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -1252,27 +1319,20 @@ def list_payment_methods_with_http_info( response_types_map=_response_types_map, ) + @validate_call def list_payment_methods_without_preload_content( self, - limit: Annotated[ - Optional[StrictStr], - Field(description="(Optional) The number of items to return"), - ] = None, - offset: Annotated[ - Optional[StrictStr], - Field(description="(Optional) The offset in the list of item to return"), - ] = None, - statuses: Annotated[ - Optional[List[StrictStr]], - Field(description="(Optional) Filter on payment method statuses"), - ] = None, + limit: Annotated[Optional[StrictStr], Field(description="(Optional) The number of items to return")] = None, + offset: Annotated[Optional[StrictStr], Field(description="(Optional) The offset in the list of item to return")] = None, + statuses: Annotated[Optional[List[StrictStr]], Field(description="(Optional) Filter on payment method statuses")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -1308,7 +1368,7 @@ def list_payment_methods_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._list_payment_methods_serialize( limit=limit, @@ -1317,23 +1377,25 @@ def list_payment_methods_without_preload_content( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ListPaymentMethodsReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "ListPaymentMethodsReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) return response_data.response + def _list_payment_methods_serialize( self, limit, @@ -1348,7 +1410,7 @@ def _list_payment_methods_serialize( _host = None _collection_formats: Dict[str, str] = { - "statuses": "multi", + 'statuses': 'multi', } _path_params: Dict[str, str] = {} @@ -1363,31 +1425,39 @@ def _list_payment_methods_serialize( # process the path parameters # process the query parameters if limit is not None: - - _query_params.append(("limit", limit)) - + + _query_params.append(('limit', limit)) + if offset is not None: - - _query_params.append(("offset", offset)) - + + _query_params.append(('offset', offset)) + if statuses is not None: - - _query_params.append(("statuses", statuses)) - + + _query_params.append(('statuses', statuses)) + # process the header parameters # process the form parameters # process the body parameter + # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept(["*/*"]) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + '*/*' + ] + ) + # authentication setting - _auth_settings: List[str] = ["Bearer"] + _auth_settings: List[str] = [ + 'Bearer' + ] return self.api_client.param_serialize( - method="GET", - resource_path="/v1/payment_methods", + method='GET', + resource_path='/v1/payment_methods', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -1397,5 +1467,7 @@ def _list_payment_methods_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth, + _request_auth=_request_auth ) + + diff --git a/koyeb/api/api/persistent_volumes_api.py b/koyeb/api/api/persistent_volumes_api.py index 34cc81f0..c178e646 100644 --- a/koyeb/api/api/persistent_volumes_api.py +++ b/koyeb/api/api/persistent_volumes_api.py @@ -1,16 +1,15 @@ -# coding: utf-8 - """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 + import warnings from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt from typing import Any, Dict, List, Optional, Tuple, Union @@ -20,19 +19,13 @@ from typing import List, Optional from typing_extensions import Annotated from koyeb.api.models.create_persistent_volume_reply import CreatePersistentVolumeReply -from koyeb.api.models.create_persistent_volume_request import ( - CreatePersistentVolumeRequest, -) +from koyeb.api.models.create_persistent_volume_request import CreatePersistentVolumeRequest from koyeb.api.models.delete_persistent_volume_reply import DeletePersistentVolumeReply from koyeb.api.models.get_persistent_volume_reply import GetPersistentVolumeReply -from koyeb.api.models.list_persistent_volume_events_reply import ( - ListPersistentVolumeEventsReply, -) +from koyeb.api.models.list_persistent_volume_events_reply import ListPersistentVolumeEventsReply from koyeb.api.models.list_persistent_volumes_reply import ListPersistentVolumesReply from koyeb.api.models.update_persistent_volume_reply import UpdatePersistentVolumeReply -from koyeb.api.models.update_persistent_volume_request import ( - UpdatePersistentVolumeRequest, -) +from koyeb.api.models.update_persistent_volume_request import UpdatePersistentVolumeRequest from koyeb.api.api_client import ApiClient, RequestSerialized from koyeb.api.api_response import ApiResponse @@ -51,6 +44,7 @@ def __init__(self, api_client=None) -> None: api_client = ApiClient.get_default() self.api_client = api_client + @validate_call def create_persistent_volume( self, @@ -59,8 +53,9 @@ def create_persistent_volume( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -92,27 +87,28 @@ def create_persistent_volume( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._create_persistent_volume_serialize( body=body, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "CreatePersistentVolumeReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "CreatePersistentVolumeReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -120,6 +116,7 @@ def create_persistent_volume( response_types_map=_response_types_map, ).data + @validate_call def create_persistent_volume_with_http_info( self, @@ -128,8 +125,9 @@ def create_persistent_volume_with_http_info( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -161,27 +159,28 @@ def create_persistent_volume_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._create_persistent_volume_serialize( body=body, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "CreatePersistentVolumeReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "CreatePersistentVolumeReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -189,6 +188,7 @@ def create_persistent_volume_with_http_info( response_types_map=_response_types_map, ) + @validate_call def create_persistent_volume_without_preload_content( self, @@ -197,8 +197,9 @@ def create_persistent_volume_without_preload_content( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -230,30 +231,32 @@ def create_persistent_volume_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._create_persistent_volume_serialize( body=body, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "CreatePersistentVolumeReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "CreatePersistentVolumeReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) return response_data.response + def _create_persistent_volume_serialize( self, body, @@ -265,7 +268,8 @@ def _create_persistent_volume_serialize( _host = None - _collection_formats: Dict[str, str] = {} + _collection_formats: Dict[str, str] = { + } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -284,16 +288,24 @@ def _create_persistent_volume_serialize( if body is not None: _body_params = body + # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept(["*/*"]) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + '*/*' + ] + ) + # authentication setting - _auth_settings: List[str] = ["Bearer"] + _auth_settings: List[str] = [ + 'Bearer' + ] return self.api_client.param_serialize( - method="POST", - resource_path="/v1/volumes", + method='POST', + resource_path='/v1/volumes', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -303,9 +315,12 @@ def _create_persistent_volume_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth, + _request_auth=_request_auth ) + + + @validate_call def delete_persistent_volume( self, @@ -314,8 +329,9 @@ def delete_persistent_volume( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -347,27 +363,28 @@ def delete_persistent_volume( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._delete_persistent_volume_serialize( id=id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "DeletePersistentVolumeReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "DeletePersistentVolumeReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -375,6 +392,7 @@ def delete_persistent_volume( response_types_map=_response_types_map, ).data + @validate_call def delete_persistent_volume_with_http_info( self, @@ -383,8 +401,9 @@ def delete_persistent_volume_with_http_info( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -416,27 +435,28 @@ def delete_persistent_volume_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._delete_persistent_volume_serialize( id=id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "DeletePersistentVolumeReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "DeletePersistentVolumeReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -444,6 +464,7 @@ def delete_persistent_volume_with_http_info( response_types_map=_response_types_map, ) + @validate_call def delete_persistent_volume_without_preload_content( self, @@ -452,8 +473,9 @@ def delete_persistent_volume_without_preload_content( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -485,30 +507,32 @@ def delete_persistent_volume_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._delete_persistent_volume_serialize( id=id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "DeletePersistentVolumeReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "DeletePersistentVolumeReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) return response_data.response + def _delete_persistent_volume_serialize( self, id, @@ -520,7 +544,8 @@ def _delete_persistent_volume_serialize( _host = None - _collection_formats: Dict[str, str] = {} + _collection_formats: Dict[str, str] = { + } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -533,22 +558,30 @@ def _delete_persistent_volume_serialize( # process the path parameters if id is not None: - _path_params["id"] = id + _path_params['id'] = id # process the query parameters # process the header parameters # process the form parameters # process the body parameter + # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept(["*/*"]) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + '*/*' + ] + ) + # authentication setting - _auth_settings: List[str] = ["Bearer"] + _auth_settings: List[str] = [ + 'Bearer' + ] return self.api_client.param_serialize( - method="DELETE", - resource_path="/v1/volumes/{id}", + method='DELETE', + resource_path='/v1/volumes/{id}', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -558,9 +591,12 @@ def _delete_persistent_volume_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth, + _request_auth=_request_auth ) + + + @validate_call def get_persistent_volume( self, @@ -569,8 +605,9 @@ def get_persistent_volume( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -602,27 +639,28 @@ def get_persistent_volume( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._get_persistent_volume_serialize( id=id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "GetPersistentVolumeReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "GetPersistentVolumeReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -630,6 +668,7 @@ def get_persistent_volume( response_types_map=_response_types_map, ).data + @validate_call def get_persistent_volume_with_http_info( self, @@ -638,8 +677,9 @@ def get_persistent_volume_with_http_info( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -671,27 +711,28 @@ def get_persistent_volume_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._get_persistent_volume_serialize( id=id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "GetPersistentVolumeReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "GetPersistentVolumeReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -699,6 +740,7 @@ def get_persistent_volume_with_http_info( response_types_map=_response_types_map, ) + @validate_call def get_persistent_volume_without_preload_content( self, @@ -707,8 +749,9 @@ def get_persistent_volume_without_preload_content( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -740,30 +783,32 @@ def get_persistent_volume_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._get_persistent_volume_serialize( id=id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "GetPersistentVolumeReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "GetPersistentVolumeReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) return response_data.response + def _get_persistent_volume_serialize( self, id, @@ -775,7 +820,8 @@ def _get_persistent_volume_serialize( _host = None - _collection_formats: Dict[str, str] = {} + _collection_formats: Dict[str, str] = { + } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -788,22 +834,30 @@ def _get_persistent_volume_serialize( # process the path parameters if id is not None: - _path_params["id"] = id + _path_params['id'] = id # process the query parameters # process the header parameters # process the form parameters # process the body parameter + # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept(["*/*"]) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + '*/*' + ] + ) + # authentication setting - _auth_settings: List[str] = ["Bearer"] + _auth_settings: List[str] = [ + 'Bearer' + ] return self.api_client.param_serialize( - method="GET", - resource_path="/v1/volumes/{id}", + method='GET', + resource_path='/v1/volumes/{id}', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -813,40 +867,27 @@ def _get_persistent_volume_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth, + _request_auth=_request_auth ) + + + @validate_call def list_persistent_volume_events( self, - persistent_volume_id: Annotated[ - Optional[StrictStr], - Field(description="(Optional) Filter on persistent volume id"), - ] = None, - types: Annotated[ - Optional[List[StrictStr]], - Field(description="(Optional) Filter on persistent volume event types"), - ] = None, - limit: Annotated[ - Optional[StrictStr], - Field(description="(Optional) The number of items to return"), - ] = None, - offset: Annotated[ - Optional[StrictStr], - Field(description="(Optional) The offset in the list of item to return"), - ] = None, - order: Annotated[ - Optional[StrictStr], - Field( - description="(Optional) Sorts the list in the ascending or the descending order" - ), - ] = None, + persistent_volume_id: Annotated[Optional[StrictStr], Field(description="(Optional) Filter on persistent volume id")] = None, + types: Annotated[Optional[List[StrictStr]], Field(description="(Optional) Filter on persistent volume event types")] = None, + limit: Annotated[Optional[StrictStr], Field(description="(Optional) The number of items to return")] = None, + offset: Annotated[Optional[StrictStr], Field(description="(Optional) The offset in the list of item to return")] = None, + order: Annotated[Optional[StrictStr], Field(description="(Optional) Sorts the list in the ascending or the descending order")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -886,7 +927,7 @@ def list_persistent_volume_events( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._list_persistent_volume_events_serialize( persistent_volume_id=persistent_volume_id, @@ -897,20 +938,21 @@ def list_persistent_volume_events( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ListPersistentVolumeEventsReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "ListPersistentVolumeEventsReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -918,37 +960,22 @@ def list_persistent_volume_events( response_types_map=_response_types_map, ).data + @validate_call def list_persistent_volume_events_with_http_info( self, - persistent_volume_id: Annotated[ - Optional[StrictStr], - Field(description="(Optional) Filter on persistent volume id"), - ] = None, - types: Annotated[ - Optional[List[StrictStr]], - Field(description="(Optional) Filter on persistent volume event types"), - ] = None, - limit: Annotated[ - Optional[StrictStr], - Field(description="(Optional) The number of items to return"), - ] = None, - offset: Annotated[ - Optional[StrictStr], - Field(description="(Optional) The offset in the list of item to return"), - ] = None, - order: Annotated[ - Optional[StrictStr], - Field( - description="(Optional) Sorts the list in the ascending or the descending order" - ), - ] = None, + persistent_volume_id: Annotated[Optional[StrictStr], Field(description="(Optional) Filter on persistent volume id")] = None, + types: Annotated[Optional[List[StrictStr]], Field(description="(Optional) Filter on persistent volume event types")] = None, + limit: Annotated[Optional[StrictStr], Field(description="(Optional) The number of items to return")] = None, + offset: Annotated[Optional[StrictStr], Field(description="(Optional) The offset in the list of item to return")] = None, + order: Annotated[Optional[StrictStr], Field(description="(Optional) Sorts the list in the ascending or the descending order")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -988,7 +1015,7 @@ def list_persistent_volume_events_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._list_persistent_volume_events_serialize( persistent_volume_id=persistent_volume_id, @@ -999,20 +1026,21 @@ def list_persistent_volume_events_with_http_info( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ListPersistentVolumeEventsReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "ListPersistentVolumeEventsReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -1020,37 +1048,22 @@ def list_persistent_volume_events_with_http_info( response_types_map=_response_types_map, ) + @validate_call def list_persistent_volume_events_without_preload_content( self, - persistent_volume_id: Annotated[ - Optional[StrictStr], - Field(description="(Optional) Filter on persistent volume id"), - ] = None, - types: Annotated[ - Optional[List[StrictStr]], - Field(description="(Optional) Filter on persistent volume event types"), - ] = None, - limit: Annotated[ - Optional[StrictStr], - Field(description="(Optional) The number of items to return"), - ] = None, - offset: Annotated[ - Optional[StrictStr], - Field(description="(Optional) The offset in the list of item to return"), - ] = None, - order: Annotated[ - Optional[StrictStr], - Field( - description="(Optional) Sorts the list in the ascending or the descending order" - ), - ] = None, + persistent_volume_id: Annotated[Optional[StrictStr], Field(description="(Optional) Filter on persistent volume id")] = None, + types: Annotated[Optional[List[StrictStr]], Field(description="(Optional) Filter on persistent volume event types")] = None, + limit: Annotated[Optional[StrictStr], Field(description="(Optional) The number of items to return")] = None, + offset: Annotated[Optional[StrictStr], Field(description="(Optional) The offset in the list of item to return")] = None, + order: Annotated[Optional[StrictStr], Field(description="(Optional) Sorts the list in the ascending or the descending order")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -1090,7 +1103,7 @@ def list_persistent_volume_events_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._list_persistent_volume_events_serialize( persistent_volume_id=persistent_volume_id, @@ -1101,23 +1114,25 @@ def list_persistent_volume_events_without_preload_content( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ListPersistentVolumeEventsReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "ListPersistentVolumeEventsReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) return response_data.response + def _list_persistent_volume_events_serialize( self, persistent_volume_id, @@ -1134,7 +1149,7 @@ def _list_persistent_volume_events_serialize( _host = None _collection_formats: Dict[str, str] = { - "types": "multi", + 'types': 'multi', } _path_params: Dict[str, str] = {} @@ -1149,39 +1164,47 @@ def _list_persistent_volume_events_serialize( # process the path parameters # process the query parameters if persistent_volume_id is not None: - - _query_params.append(("persistent_volume_id", persistent_volume_id)) - + + _query_params.append(('persistent_volume_id', persistent_volume_id)) + if types is not None: - - _query_params.append(("types", types)) - + + _query_params.append(('types', types)) + if limit is not None: - - _query_params.append(("limit", limit)) - + + _query_params.append(('limit', limit)) + if offset is not None: - - _query_params.append(("offset", offset)) - + + _query_params.append(('offset', offset)) + if order is not None: - - _query_params.append(("order", order)) - + + _query_params.append(('order', order)) + # process the header parameters # process the form parameters # process the body parameter + # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept(["*/*"]) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + '*/*' + ] + ) + # authentication setting - _auth_settings: List[str] = ["Bearer"] + _auth_settings: List[str] = [ + 'Bearer' + ] return self.api_client.param_serialize( - method="GET", - resource_path="/v1/volume_events", + method='GET', + resource_path='/v1/volume_events', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -1191,36 +1214,28 @@ def _list_persistent_volume_events_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth, + _request_auth=_request_auth ) + + + @validate_call def list_persistent_volumes( self, - limit: Annotated[ - Optional[StrictStr], - Field(description="(Optional) The number of items to return"), - ] = None, - offset: Annotated[ - Optional[StrictStr], - Field(description="(Optional) The offset in the list of item to return"), - ] = None, - service_id: Annotated[ - Optional[StrictStr], - Field(description="(Optional) A filter for the service id"), - ] = None, - region: Annotated[ - Optional[StrictStr], Field(description="(Optional) A filter for the region") - ] = None, - name: Annotated[ - Optional[StrictStr], Field(description="(Optional) A filter for the name") - ] = None, + limit: Annotated[Optional[StrictStr], Field(description="(Optional) The number of items to return")] = None, + offset: Annotated[Optional[StrictStr], Field(description="(Optional) The offset in the list of item to return")] = None, + service_id: Annotated[Optional[StrictStr], Field(description="(Optional) A filter for the service id")] = None, + region: Annotated[Optional[StrictStr], Field(description="(Optional) A filter for the region")] = None, + name: Annotated[Optional[StrictStr], Field(description="(Optional) A filter for the name")] = None, + project_id: Annotated[Optional[StrictStr], Field(description="(Optional) A filter for the project ID")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -1240,6 +1255,8 @@ def list_persistent_volumes( :type region: str :param name: (Optional) A filter for the name :type name: str + :param project_id: (Optional) A filter for the project ID + :type project_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -1260,7 +1277,7 @@ def list_persistent_volumes( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._list_persistent_volumes_serialize( limit=limit, @@ -1268,23 +1285,25 @@ def list_persistent_volumes( service_id=service_id, region=region, name=name, + project_id=project_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ListPersistentVolumesReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "ListPersistentVolumesReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -1292,33 +1311,23 @@ def list_persistent_volumes( response_types_map=_response_types_map, ).data + @validate_call def list_persistent_volumes_with_http_info( self, - limit: Annotated[ - Optional[StrictStr], - Field(description="(Optional) The number of items to return"), - ] = None, - offset: Annotated[ - Optional[StrictStr], - Field(description="(Optional) The offset in the list of item to return"), - ] = None, - service_id: Annotated[ - Optional[StrictStr], - Field(description="(Optional) A filter for the service id"), - ] = None, - region: Annotated[ - Optional[StrictStr], Field(description="(Optional) A filter for the region") - ] = None, - name: Annotated[ - Optional[StrictStr], Field(description="(Optional) A filter for the name") - ] = None, + limit: Annotated[Optional[StrictStr], Field(description="(Optional) The number of items to return")] = None, + offset: Annotated[Optional[StrictStr], Field(description="(Optional) The offset in the list of item to return")] = None, + service_id: Annotated[Optional[StrictStr], Field(description="(Optional) A filter for the service id")] = None, + region: Annotated[Optional[StrictStr], Field(description="(Optional) A filter for the region")] = None, + name: Annotated[Optional[StrictStr], Field(description="(Optional) A filter for the name")] = None, + project_id: Annotated[Optional[StrictStr], Field(description="(Optional) A filter for the project ID")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -1338,6 +1347,8 @@ def list_persistent_volumes_with_http_info( :type region: str :param name: (Optional) A filter for the name :type name: str + :param project_id: (Optional) A filter for the project ID + :type project_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -1358,7 +1369,7 @@ def list_persistent_volumes_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._list_persistent_volumes_serialize( limit=limit, @@ -1366,23 +1377,25 @@ def list_persistent_volumes_with_http_info( service_id=service_id, region=region, name=name, + project_id=project_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ListPersistentVolumesReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "ListPersistentVolumesReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -1390,33 +1403,23 @@ def list_persistent_volumes_with_http_info( response_types_map=_response_types_map, ) + @validate_call def list_persistent_volumes_without_preload_content( self, - limit: Annotated[ - Optional[StrictStr], - Field(description="(Optional) The number of items to return"), - ] = None, - offset: Annotated[ - Optional[StrictStr], - Field(description="(Optional) The offset in the list of item to return"), - ] = None, - service_id: Annotated[ - Optional[StrictStr], - Field(description="(Optional) A filter for the service id"), - ] = None, - region: Annotated[ - Optional[StrictStr], Field(description="(Optional) A filter for the region") - ] = None, - name: Annotated[ - Optional[StrictStr], Field(description="(Optional) A filter for the name") - ] = None, + limit: Annotated[Optional[StrictStr], Field(description="(Optional) The number of items to return")] = None, + offset: Annotated[Optional[StrictStr], Field(description="(Optional) The offset in the list of item to return")] = None, + service_id: Annotated[Optional[StrictStr], Field(description="(Optional) A filter for the service id")] = None, + region: Annotated[Optional[StrictStr], Field(description="(Optional) A filter for the region")] = None, + name: Annotated[Optional[StrictStr], Field(description="(Optional) A filter for the name")] = None, + project_id: Annotated[Optional[StrictStr], Field(description="(Optional) A filter for the project ID")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -1436,6 +1439,8 @@ def list_persistent_volumes_without_preload_content( :type region: str :param name: (Optional) A filter for the name :type name: str + :param project_id: (Optional) A filter for the project ID + :type project_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -1456,7 +1461,7 @@ def list_persistent_volumes_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._list_persistent_volumes_serialize( limit=limit, @@ -1464,26 +1469,29 @@ def list_persistent_volumes_without_preload_content( service_id=service_id, region=region, name=name, + project_id=project_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ListPersistentVolumesReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "ListPersistentVolumesReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) return response_data.response + def _list_persistent_volumes_serialize( self, limit, @@ -1491,6 +1499,7 @@ def _list_persistent_volumes_serialize( service_id, region, name, + project_id, _request_auth, _content_type, _headers, @@ -1499,7 +1508,8 @@ def _list_persistent_volumes_serialize( _host = None - _collection_formats: Dict[str, str] = {} + _collection_formats: Dict[str, str] = { + } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -1513,39 +1523,51 @@ def _list_persistent_volumes_serialize( # process the path parameters # process the query parameters if limit is not None: - - _query_params.append(("limit", limit)) - + + _query_params.append(('limit', limit)) + if offset is not None: - - _query_params.append(("offset", offset)) - + + _query_params.append(('offset', offset)) + if service_id is not None: - - _query_params.append(("service_id", service_id)) - + + _query_params.append(('service_id', service_id)) + if region is not None: - - _query_params.append(("region", region)) - + + _query_params.append(('region', region)) + if name is not None: - - _query_params.append(("name", name)) - + + _query_params.append(('name', name)) + + if project_id is not None: + + _query_params.append(('project_id', project_id)) + # process the header parameters # process the form parameters # process the body parameter + # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept(["*/*"]) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + '*/*' + ] + ) + # authentication setting - _auth_settings: List[str] = ["Bearer"] + _auth_settings: List[str] = [ + 'Bearer' + ] return self.api_client.param_serialize( - method="GET", - resource_path="/v1/volumes", + method='GET', + resource_path='/v1/volumes', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -1555,9 +1577,12 @@ def _list_persistent_volumes_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth, + _request_auth=_request_auth ) + + + @validate_call def update_persistent_volume( self, @@ -1567,8 +1592,9 @@ def update_persistent_volume( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -1602,7 +1628,7 @@ def update_persistent_volume( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._update_persistent_volume_serialize( id=id, @@ -1610,20 +1636,21 @@ def update_persistent_volume( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "UpdatePersistentVolumeReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "UpdatePersistentVolumeReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -1631,6 +1658,7 @@ def update_persistent_volume( response_types_map=_response_types_map, ).data + @validate_call def update_persistent_volume_with_http_info( self, @@ -1640,8 +1668,9 @@ def update_persistent_volume_with_http_info( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -1675,7 +1704,7 @@ def update_persistent_volume_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._update_persistent_volume_serialize( id=id, @@ -1683,20 +1712,21 @@ def update_persistent_volume_with_http_info( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "UpdatePersistentVolumeReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "UpdatePersistentVolumeReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -1704,6 +1734,7 @@ def update_persistent_volume_with_http_info( response_types_map=_response_types_map, ) + @validate_call def update_persistent_volume_without_preload_content( self, @@ -1713,8 +1744,9 @@ def update_persistent_volume_without_preload_content( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -1748,7 +1780,7 @@ def update_persistent_volume_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._update_persistent_volume_serialize( id=id, @@ -1756,23 +1788,25 @@ def update_persistent_volume_without_preload_content( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "UpdatePersistentVolumeReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "UpdatePersistentVolumeReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) return response_data.response + def _update_persistent_volume_serialize( self, id, @@ -1785,7 +1819,8 @@ def _update_persistent_volume_serialize( _host = None - _collection_formats: Dict[str, str] = {} + _collection_formats: Dict[str, str] = { + } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -1798,7 +1833,7 @@ def _update_persistent_volume_serialize( # process the path parameters if id is not None: - _path_params["id"] = id + _path_params['id'] = id # process the query parameters # process the header parameters # process the form parameters @@ -1806,16 +1841,24 @@ def _update_persistent_volume_serialize( if body is not None: _body_params = body + # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept(["*/*"]) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + '*/*' + ] + ) + # authentication setting - _auth_settings: List[str] = ["Bearer"] + _auth_settings: List[str] = [ + 'Bearer' + ] return self.api_client.param_serialize( - method="POST", - resource_path="/v1/volumes/{id}", + method='POST', + resource_path='/v1/volumes/{id}', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -1825,5 +1868,7 @@ def _update_persistent_volume_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth, + _request_auth=_request_auth ) + + diff --git a/koyeb/api/api/profile_api.py b/koyeb/api/api/profile_api.py index 023f1df0..73903c0e 100644 --- a/koyeb/api/api/profile_api.py +++ b/koyeb/api/api/profile_api.py @@ -1,16 +1,15 @@ -# coding: utf-8 - """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 + import warnings from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt from typing import Any, Dict, List, Optional, Tuple, Union @@ -19,26 +18,16 @@ from pydantic import Field, StrictStr, field_validator from typing import Any, Dict, List, Optional from typing_extensions import Annotated -from koyeb.api.models.accept_organization_invitation_reply import ( - AcceptOrganizationInvitationReply, -) -from koyeb.api.models.clear_idenfy_verification_result_request import ( - ClearIdenfyVerificationResultRequest, -) +from koyeb.api.models.accept_organization_invitation_reply import AcceptOrganizationInvitationReply +from koyeb.api.models.clear_idenfy_verification_result_request import ClearIdenfyVerificationResultRequest from koyeb.api.models.create_account_request import CreateAccountRequest -from koyeb.api.models.decline_organization_invitation_reply import ( - DeclineOrganizationInvitationReply, -) +from koyeb.api.models.decline_organization_invitation_reply import DeclineOrganizationInvitationReply from koyeb.api.models.get_idenfy_token_reply import GetIdenfyTokenReply from koyeb.api.models.get_o_auth_options_reply import GetOAuthOptionsReply from koyeb.api.models.get_organization_reply import GetOrganizationReply -from koyeb.api.models.get_user_organization_invitation_reply import ( - GetUserOrganizationInvitationReply, -) +from koyeb.api.models.get_user_organization_invitation_reply import GetUserOrganizationInvitationReply from koyeb.api.models.get_user_settings_reply import GetUserSettingsReply -from koyeb.api.models.list_user_organization_invitations_reply import ( - ListUserOrganizationInvitationsReply, -) +from koyeb.api.models.list_user_organization_invitations_reply import ListUserOrganizationInvitationsReply from koyeb.api.models.list_user_organizations_reply import ListUserOrganizationsReply from koyeb.api.models.login_method_reply import LoginMethodReply from koyeb.api.models.login_reply import LoginReply @@ -46,9 +35,7 @@ from koyeb.api.models.o_auth_callback_request import OAuthCallbackRequest from koyeb.api.models.reset_password_request import ResetPasswordRequest from koyeb.api.models.update_password_request import UpdatePasswordRequest -from koyeb.api.models.update_user_request_user_update_body import ( - UpdateUserRequestUserUpdateBody, -) +from koyeb.api.models.update_user_request_user_update_body import UpdateUserRequestUserUpdateBody from koyeb.api.models.update_user_settings_reply import UpdateUserSettingsReply from koyeb.api.models.update_user_settings_request import UpdateUserSettingsRequest from koyeb.api.models.user_reply import UserReply @@ -70,20 +57,19 @@ def __init__(self, api_client=None) -> None: api_client = ApiClient.get_default() self.api_client = api_client + @validate_call def accept_organization_invitation( self, - id: Annotated[ - StrictStr, - Field(description="The id of the organization invitation to accept"), - ], + id: Annotated[StrictStr, Field(description="The id of the organization invitation to accept")], body: Dict[str, Any], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -117,7 +103,7 @@ def accept_organization_invitation( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._accept_organization_invitation_serialize( id=id, @@ -125,20 +111,21 @@ def accept_organization_invitation( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "AcceptOrganizationInvitationReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "AcceptOrganizationInvitationReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -146,20 +133,19 @@ def accept_organization_invitation( response_types_map=_response_types_map, ).data + @validate_call def accept_organization_invitation_with_http_info( self, - id: Annotated[ - StrictStr, - Field(description="The id of the organization invitation to accept"), - ], + id: Annotated[StrictStr, Field(description="The id of the organization invitation to accept")], body: Dict[str, Any], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -193,7 +179,7 @@ def accept_organization_invitation_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._accept_organization_invitation_serialize( id=id, @@ -201,20 +187,21 @@ def accept_organization_invitation_with_http_info( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "AcceptOrganizationInvitationReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "AcceptOrganizationInvitationReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -222,20 +209,19 @@ def accept_organization_invitation_with_http_info( response_types_map=_response_types_map, ) + @validate_call def accept_organization_invitation_without_preload_content( self, - id: Annotated[ - StrictStr, - Field(description="The id of the organization invitation to accept"), - ], + id: Annotated[StrictStr, Field(description="The id of the organization invitation to accept")], body: Dict[str, Any], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -269,7 +255,7 @@ def accept_organization_invitation_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._accept_organization_invitation_serialize( id=id, @@ -277,23 +263,25 @@ def accept_organization_invitation_without_preload_content( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "AcceptOrganizationInvitationReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "AcceptOrganizationInvitationReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) return response_data.response + def _accept_organization_invitation_serialize( self, id, @@ -306,7 +294,8 @@ def _accept_organization_invitation_serialize( _host = None - _collection_formats: Dict[str, str] = {} + _collection_formats: Dict[str, str] = { + } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -319,7 +308,7 @@ def _accept_organization_invitation_serialize( # process the path parameters if id is not None: - _path_params["id"] = id + _path_params['id'] = id # process the query parameters # process the header parameters # process the form parameters @@ -327,16 +316,24 @@ def _accept_organization_invitation_serialize( if body is not None: _body_params = body + # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept(["*/*"]) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + '*/*' + ] + ) + # authentication setting - _auth_settings: List[str] = ["Bearer"] + _auth_settings: List[str] = [ + 'Bearer' + ] return self.api_client.param_serialize( - method="POST", - resource_path="/v1/account/organization_invitations/{id}/accept", + method='POST', + resource_path='/v1/account/organization_invitations/{id}/accept', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -346,9 +343,12 @@ def _accept_organization_invitation_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth, + _request_auth=_request_auth ) + + + @validate_call def clear_idenfy_verification_result( self, @@ -357,8 +357,9 @@ def clear_idenfy_verification_result( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -390,27 +391,28 @@ def clear_idenfy_verification_result( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._clear_idenfy_verification_result_serialize( body=body, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "object", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "object", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -418,6 +420,7 @@ def clear_idenfy_verification_result( response_types_map=_response_types_map, ).data + @validate_call def clear_idenfy_verification_result_with_http_info( self, @@ -426,8 +429,9 @@ def clear_idenfy_verification_result_with_http_info( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -459,27 +463,28 @@ def clear_idenfy_verification_result_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._clear_idenfy_verification_result_serialize( body=body, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "object", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "object", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -487,6 +492,7 @@ def clear_idenfy_verification_result_with_http_info( response_types_map=_response_types_map, ) + @validate_call def clear_idenfy_verification_result_without_preload_content( self, @@ -495,8 +501,9 @@ def clear_idenfy_verification_result_without_preload_content( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -528,30 +535,32 @@ def clear_idenfy_verification_result_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._clear_idenfy_verification_result_serialize( body=body, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "object", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "object", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) return response_data.response + def _clear_idenfy_verification_result_serialize( self, body, @@ -563,7 +572,8 @@ def _clear_idenfy_verification_result_serialize( _host = None - _collection_formats: Dict[str, str] = {} + _collection_formats: Dict[str, str] = { + } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -582,16 +592,24 @@ def _clear_idenfy_verification_result_serialize( if body is not None: _body_params = body + # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept(["*/*"]) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + '*/*' + ] + ) + # authentication setting - _auth_settings: List[str] = ["Bearer"] + _auth_settings: List[str] = [ + 'Bearer' + ] return self.api_client.param_serialize( - method="POST", - resource_path="/v1/account/idenfy", + method='POST', + resource_path='/v1/account/idenfy', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -601,23 +619,24 @@ def _clear_idenfy_verification_result_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth, + _request_auth=_request_auth ) + + + @validate_call def decline_organization_invitation( self, - id: Annotated[ - StrictStr, - Field(description="The id of the organization invitation to decline"), - ], + id: Annotated[StrictStr, Field(description="The id of the organization invitation to decline")], body: Dict[str, Any], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -651,7 +670,7 @@ def decline_organization_invitation( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._decline_organization_invitation_serialize( id=id, @@ -659,20 +678,21 @@ def decline_organization_invitation( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "DeclineOrganizationInvitationReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "DeclineOrganizationInvitationReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -680,20 +700,19 @@ def decline_organization_invitation( response_types_map=_response_types_map, ).data + @validate_call def decline_organization_invitation_with_http_info( self, - id: Annotated[ - StrictStr, - Field(description="The id of the organization invitation to decline"), - ], + id: Annotated[StrictStr, Field(description="The id of the organization invitation to decline")], body: Dict[str, Any], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -727,7 +746,7 @@ def decline_organization_invitation_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._decline_organization_invitation_serialize( id=id, @@ -735,20 +754,21 @@ def decline_organization_invitation_with_http_info( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "DeclineOrganizationInvitationReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "DeclineOrganizationInvitationReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -756,20 +776,19 @@ def decline_organization_invitation_with_http_info( response_types_map=_response_types_map, ) + @validate_call def decline_organization_invitation_without_preload_content( self, - id: Annotated[ - StrictStr, - Field(description="The id of the organization invitation to decline"), - ], + id: Annotated[StrictStr, Field(description="The id of the organization invitation to decline")], body: Dict[str, Any], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -803,7 +822,7 @@ def decline_organization_invitation_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._decline_organization_invitation_serialize( id=id, @@ -811,23 +830,25 @@ def decline_organization_invitation_without_preload_content( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "DeclineOrganizationInvitationReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "DeclineOrganizationInvitationReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) return response_data.response + def _decline_organization_invitation_serialize( self, id, @@ -840,7 +861,8 @@ def _decline_organization_invitation_serialize( _host = None - _collection_formats: Dict[str, str] = {} + _collection_formats: Dict[str, str] = { + } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -853,7 +875,7 @@ def _decline_organization_invitation_serialize( # process the path parameters if id is not None: - _path_params["id"] = id + _path_params['id'] = id # process the query parameters # process the header parameters # process the form parameters @@ -861,16 +883,24 @@ def _decline_organization_invitation_serialize( if body is not None: _body_params = body + # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept(["*/*"]) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + '*/*' + ] + ) + # authentication setting - _auth_settings: List[str] = ["Bearer"] + _auth_settings: List[str] = [ + 'Bearer' + ] return self.api_client.param_serialize( - method="POST", - resource_path="/v1/account/organization_invitations/{id}/decline", + method='POST', + resource_path='/v1/account/organization_invitations/{id}/decline', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -880,9 +910,12 @@ def _decline_organization_invitation_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth, + _request_auth=_request_auth ) + + + @validate_call def get_current_organization( self, @@ -890,8 +923,9 @@ def get_current_organization( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -921,26 +955,27 @@ def get_current_organization( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._get_current_organization_serialize( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "GetOrganizationReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "GetOrganizationReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -948,6 +983,7 @@ def get_current_organization( response_types_map=_response_types_map, ).data + @validate_call def get_current_organization_with_http_info( self, @@ -955,8 +991,9 @@ def get_current_organization_with_http_info( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -986,26 +1023,27 @@ def get_current_organization_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._get_current_organization_serialize( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "GetOrganizationReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "GetOrganizationReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -1013,6 +1051,7 @@ def get_current_organization_with_http_info( response_types_map=_response_types_map, ) + @validate_call def get_current_organization_without_preload_content( self, @@ -1020,8 +1059,9 @@ def get_current_organization_without_preload_content( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -1051,29 +1091,31 @@ def get_current_organization_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._get_current_organization_serialize( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "GetOrganizationReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "GetOrganizationReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) return response_data.response + def _get_current_organization_serialize( self, _request_auth, @@ -1084,7 +1126,8 @@ def _get_current_organization_serialize( _host = None - _collection_formats: Dict[str, str] = {} + _collection_formats: Dict[str, str] = { + } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -1101,16 +1144,24 @@ def _get_current_organization_serialize( # process the form parameters # process the body parameter + # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept(["*/*"]) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + '*/*' + ] + ) + # authentication setting - _auth_settings: List[str] = ["Bearer"] + _auth_settings: List[str] = [ + 'Bearer' + ] return self.api_client.param_serialize( - method="GET", - resource_path="/v1/account/organization", + method='GET', + resource_path='/v1/account/organization', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -1120,21 +1171,23 @@ def _get_current_organization_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth, + _request_auth=_request_auth ) + + + @validate_call def get_current_user( self, - seon_fp: Annotated[ - Optional[StrictStr], Field(description="Seon Fingerprint") - ] = None, + seon_fp: Annotated[Optional[StrictStr], Field(description="Seon Fingerprint")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -1166,27 +1219,28 @@ def get_current_user( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._get_current_user_serialize( seon_fp=seon_fp, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "UserReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "UserReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -1194,18 +1248,18 @@ def get_current_user( response_types_map=_response_types_map, ).data + @validate_call def get_current_user_with_http_info( self, - seon_fp: Annotated[ - Optional[StrictStr], Field(description="Seon Fingerprint") - ] = None, + seon_fp: Annotated[Optional[StrictStr], Field(description="Seon Fingerprint")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -1237,27 +1291,28 @@ def get_current_user_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._get_current_user_serialize( seon_fp=seon_fp, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "UserReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "UserReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -1265,18 +1320,18 @@ def get_current_user_with_http_info( response_types_map=_response_types_map, ) + @validate_call def get_current_user_without_preload_content( self, - seon_fp: Annotated[ - Optional[StrictStr], Field(description="Seon Fingerprint") - ] = None, + seon_fp: Annotated[Optional[StrictStr], Field(description="Seon Fingerprint")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -1308,30 +1363,32 @@ def get_current_user_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._get_current_user_serialize( seon_fp=seon_fp, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "UserReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "UserReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) return response_data.response + def _get_current_user_serialize( self, seon_fp, @@ -1343,7 +1400,8 @@ def _get_current_user_serialize( _host = None - _collection_formats: Dict[str, str] = {} + _collection_formats: Dict[str, str] = { + } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -1358,20 +1416,28 @@ def _get_current_user_serialize( # process the query parameters # process the header parameters if seon_fp is not None: - _header_params["seon-fp"] = seon_fp + _header_params['seon-fp'] = seon_fp # process the form parameters # process the body parameter + # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept(["*/*"]) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + '*/*' + ] + ) + # authentication setting - _auth_settings: List[str] = ["Bearer"] + _auth_settings: List[str] = [ + 'Bearer' + ] return self.api_client.param_serialize( - method="GET", - resource_path="/v1/account/profile", + method='GET', + resource_path='/v1/account/profile', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -1381,9 +1447,12 @@ def _get_current_user_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth, + _request_auth=_request_auth ) + + + @validate_call def get_idenfy_token( self, @@ -1391,8 +1460,9 @@ def get_idenfy_token( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -1422,26 +1492,27 @@ def get_idenfy_token( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._get_idenfy_token_serialize( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "GetIdenfyTokenReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "GetIdenfyTokenReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -1449,6 +1520,7 @@ def get_idenfy_token( response_types_map=_response_types_map, ).data + @validate_call def get_idenfy_token_with_http_info( self, @@ -1456,8 +1528,9 @@ def get_idenfy_token_with_http_info( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -1487,26 +1560,27 @@ def get_idenfy_token_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._get_idenfy_token_serialize( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "GetIdenfyTokenReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "GetIdenfyTokenReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -1514,6 +1588,7 @@ def get_idenfy_token_with_http_info( response_types_map=_response_types_map, ) + @validate_call def get_idenfy_token_without_preload_content( self, @@ -1521,8 +1596,9 @@ def get_idenfy_token_without_preload_content( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -1552,29 +1628,31 @@ def get_idenfy_token_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._get_idenfy_token_serialize( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "GetIdenfyTokenReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "GetIdenfyTokenReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) return response_data.response + def _get_idenfy_token_serialize( self, _request_auth, @@ -1585,7 +1663,8 @@ def _get_idenfy_token_serialize( _host = None - _collection_formats: Dict[str, str] = {} + _collection_formats: Dict[str, str] = { + } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -1602,16 +1681,24 @@ def _get_idenfy_token_serialize( # process the form parameters # process the body parameter + # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept(["*/*"]) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + '*/*' + ] + ) + # authentication setting - _auth_settings: List[str] = ["Bearer"] + _auth_settings: List[str] = [ + 'Bearer' + ] return self.api_client.param_serialize( - method="GET", - resource_path="/v1/account/idenfy", + method='GET', + resource_path='/v1/account/idenfy', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -1621,28 +1708,24 @@ def _get_idenfy_token_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth, + _request_auth=_request_auth ) + + + @validate_call def get_o_auth_options( self, - action: Annotated[ - Optional[StrictStr], - Field(description="Which authentication flow is being initiated"), - ] = None, - metadata: Annotated[ - Optional[StrictStr], - Field( - description="A small (limited to 400 characters) string of arbitrary metadata which will be encoded in the state" - ), - ] = None, + action: Annotated[Optional[StrictStr], Field(description="Which authentication flow is being initiated")] = None, + metadata: Annotated[Optional[StrictStr], Field(description="A small (limited to 400 characters) string of arbitrary metadata which will be encoded in the state")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -1676,7 +1759,7 @@ def get_o_auth_options( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._get_o_auth_options_serialize( action=action, @@ -1684,20 +1767,21 @@ def get_o_auth_options( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "GetOAuthOptionsReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "GetOAuthOptionsReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -1705,25 +1789,19 @@ def get_o_auth_options( response_types_map=_response_types_map, ).data + @validate_call def get_o_auth_options_with_http_info( self, - action: Annotated[ - Optional[StrictStr], - Field(description="Which authentication flow is being initiated"), - ] = None, - metadata: Annotated[ - Optional[StrictStr], - Field( - description="A small (limited to 400 characters) string of arbitrary metadata which will be encoded in the state" - ), - ] = None, + action: Annotated[Optional[StrictStr], Field(description="Which authentication flow is being initiated")] = None, + metadata: Annotated[Optional[StrictStr], Field(description="A small (limited to 400 characters) string of arbitrary metadata which will be encoded in the state")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -1757,7 +1835,7 @@ def get_o_auth_options_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._get_o_auth_options_serialize( action=action, @@ -1765,20 +1843,21 @@ def get_o_auth_options_with_http_info( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "GetOAuthOptionsReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "GetOAuthOptionsReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -1786,25 +1865,19 @@ def get_o_auth_options_with_http_info( response_types_map=_response_types_map, ) + @validate_call def get_o_auth_options_without_preload_content( self, - action: Annotated[ - Optional[StrictStr], - Field(description="Which authentication flow is being initiated"), - ] = None, - metadata: Annotated[ - Optional[StrictStr], - Field( - description="A small (limited to 400 characters) string of arbitrary metadata which will be encoded in the state" - ), - ] = None, + action: Annotated[Optional[StrictStr], Field(description="Which authentication flow is being initiated")] = None, + metadata: Annotated[Optional[StrictStr], Field(description="A small (limited to 400 characters) string of arbitrary metadata which will be encoded in the state")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -1838,7 +1911,7 @@ def get_o_auth_options_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._get_o_auth_options_serialize( action=action, @@ -1846,23 +1919,25 @@ def get_o_auth_options_without_preload_content( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "GetOAuthOptionsReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "GetOAuthOptionsReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) return response_data.response + def _get_o_auth_options_serialize( self, action, @@ -1875,7 +1950,8 @@ def _get_o_auth_options_serialize( _host = None - _collection_formats: Dict[str, str] = {} + _collection_formats: Dict[str, str] = { + } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -1889,27 +1965,35 @@ def _get_o_auth_options_serialize( # process the path parameters # process the query parameters if action is not None: - - _query_params.append(("action", action)) - + + _query_params.append(('action', action)) + if metadata is not None: - - _query_params.append(("metadata", metadata)) - + + _query_params.append(('metadata', metadata)) + # process the header parameters # process the form parameters # process the body parameter + # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept(["*/*"]) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + '*/*' + ] + ) + # authentication setting - _auth_settings: List[str] = ["Bearer"] + _auth_settings: List[str] = [ + 'Bearer' + ] return self.api_client.param_serialize( - method="GET", - resource_path="/v1/account/oauth", + method='GET', + resource_path='/v1/account/oauth', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -1919,21 +2003,23 @@ def _get_o_auth_options_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth, + _request_auth=_request_auth ) + + + @validate_call def get_user_organization_invitation( self, - id: Annotated[ - StrictStr, Field(description="The id of the organization invitation to get") - ], + id: Annotated[StrictStr, Field(description="The id of the organization invitation to get")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -1965,27 +2051,28 @@ def get_user_organization_invitation( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._get_user_organization_invitation_serialize( id=id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "GetUserOrganizationInvitationReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "GetUserOrganizationInvitationReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -1993,18 +2080,18 @@ def get_user_organization_invitation( response_types_map=_response_types_map, ).data + @validate_call def get_user_organization_invitation_with_http_info( self, - id: Annotated[ - StrictStr, Field(description="The id of the organization invitation to get") - ], + id: Annotated[StrictStr, Field(description="The id of the organization invitation to get")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -2036,27 +2123,28 @@ def get_user_organization_invitation_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._get_user_organization_invitation_serialize( id=id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "GetUserOrganizationInvitationReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "GetUserOrganizationInvitationReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -2064,18 +2152,18 @@ def get_user_organization_invitation_with_http_info( response_types_map=_response_types_map, ) + @validate_call def get_user_organization_invitation_without_preload_content( self, - id: Annotated[ - StrictStr, Field(description="The id of the organization invitation to get") - ], + id: Annotated[StrictStr, Field(description="The id of the organization invitation to get")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -2107,30 +2195,32 @@ def get_user_organization_invitation_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._get_user_organization_invitation_serialize( id=id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "GetUserOrganizationInvitationReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "GetUserOrganizationInvitationReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) return response_data.response + def _get_user_organization_invitation_serialize( self, id, @@ -2142,7 +2232,8 @@ def _get_user_organization_invitation_serialize( _host = None - _collection_formats: Dict[str, str] = {} + _collection_formats: Dict[str, str] = { + } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -2155,22 +2246,30 @@ def _get_user_organization_invitation_serialize( # process the path parameters if id is not None: - _path_params["id"] = id + _path_params['id'] = id # process the query parameters # process the header parameters # process the form parameters # process the body parameter + # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept(["*/*"]) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + '*/*' + ] + ) + # authentication setting - _auth_settings: List[str] = ["Bearer"] + _auth_settings: List[str] = [ + 'Bearer' + ] return self.api_client.param_serialize( - method="GET", - resource_path="/v1/account/organization_invitations/{id}", + method='GET', + resource_path='/v1/account/organization_invitations/{id}', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -2180,9 +2279,12 @@ def _get_user_organization_invitation_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth, + _request_auth=_request_auth ) + + + @validate_call def get_user_settings( self, @@ -2190,8 +2292,9 @@ def get_user_settings( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -2221,26 +2324,27 @@ def get_user_settings( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._get_user_settings_serialize( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "GetUserSettingsReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "GetUserSettingsReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -2248,6 +2352,7 @@ def get_user_settings( response_types_map=_response_types_map, ).data + @validate_call def get_user_settings_with_http_info( self, @@ -2255,8 +2360,9 @@ def get_user_settings_with_http_info( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -2286,26 +2392,27 @@ def get_user_settings_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._get_user_settings_serialize( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "GetUserSettingsReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "GetUserSettingsReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -2313,6 +2420,7 @@ def get_user_settings_with_http_info( response_types_map=_response_types_map, ) + @validate_call def get_user_settings_without_preload_content( self, @@ -2320,8 +2428,9 @@ def get_user_settings_without_preload_content( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -2351,29 +2460,31 @@ def get_user_settings_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._get_user_settings_serialize( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "GetUserSettingsReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "GetUserSettingsReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) return response_data.response + def _get_user_settings_serialize( self, _request_auth, @@ -2384,7 +2495,8 @@ def _get_user_settings_serialize( _host = None - _collection_formats: Dict[str, str] = {} + _collection_formats: Dict[str, str] = { + } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -2401,16 +2513,24 @@ def _get_user_settings_serialize( # process the form parameters # process the body parameter + # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept(["*/*"]) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + '*/*' + ] + ) + # authentication setting - _auth_settings: List[str] = ["Bearer"] + _auth_settings: List[str] = [ + 'Bearer' + ] return self.api_client.param_serialize( - method="GET", - resource_path="/v1/account/settings", + method='GET', + resource_path='/v1/account/settings', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -2420,30 +2540,25 @@ def _get_user_settings_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth, + _request_auth=_request_auth ) + + + @validate_call def list_user_organization_invitations( self, - limit: Annotated[ - Optional[StrictStr], - Field(description="(Optional) The number of items to return"), - ] = None, - offset: Annotated[ - Optional[StrictStr], - Field(description="(Optional) The offset in the list of item to return"), - ] = None, - statuses: Annotated[ - Optional[List[StrictStr]], - Field(description="(Optional) Filter on organization invitation statuses"), - ] = None, + limit: Annotated[Optional[StrictStr], Field(description="(Optional) The number of items to return")] = None, + offset: Annotated[Optional[StrictStr], Field(description="(Optional) The offset in the list of item to return")] = None, + statuses: Annotated[Optional[List[StrictStr]], Field(description="(Optional) Filter on organization invitation statuses")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -2479,7 +2594,7 @@ def list_user_organization_invitations( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._list_user_organization_invitations_serialize( limit=limit, @@ -2488,20 +2603,21 @@ def list_user_organization_invitations( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ListUserOrganizationInvitationsReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "ListUserOrganizationInvitationsReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -2509,27 +2625,20 @@ def list_user_organization_invitations( response_types_map=_response_types_map, ).data + @validate_call def list_user_organization_invitations_with_http_info( self, - limit: Annotated[ - Optional[StrictStr], - Field(description="(Optional) The number of items to return"), - ] = None, - offset: Annotated[ - Optional[StrictStr], - Field(description="(Optional) The offset in the list of item to return"), - ] = None, - statuses: Annotated[ - Optional[List[StrictStr]], - Field(description="(Optional) Filter on organization invitation statuses"), - ] = None, + limit: Annotated[Optional[StrictStr], Field(description="(Optional) The number of items to return")] = None, + offset: Annotated[Optional[StrictStr], Field(description="(Optional) The offset in the list of item to return")] = None, + statuses: Annotated[Optional[List[StrictStr]], Field(description="(Optional) Filter on organization invitation statuses")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -2565,7 +2674,7 @@ def list_user_organization_invitations_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._list_user_organization_invitations_serialize( limit=limit, @@ -2574,20 +2683,21 @@ def list_user_organization_invitations_with_http_info( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ListUserOrganizationInvitationsReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "ListUserOrganizationInvitationsReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -2595,27 +2705,20 @@ def list_user_organization_invitations_with_http_info( response_types_map=_response_types_map, ) + @validate_call def list_user_organization_invitations_without_preload_content( self, - limit: Annotated[ - Optional[StrictStr], - Field(description="(Optional) The number of items to return"), - ] = None, - offset: Annotated[ - Optional[StrictStr], - Field(description="(Optional) The offset in the list of item to return"), - ] = None, - statuses: Annotated[ - Optional[List[StrictStr]], - Field(description="(Optional) Filter on organization invitation statuses"), - ] = None, + limit: Annotated[Optional[StrictStr], Field(description="(Optional) The number of items to return")] = None, + offset: Annotated[Optional[StrictStr], Field(description="(Optional) The offset in the list of item to return")] = None, + statuses: Annotated[Optional[List[StrictStr]], Field(description="(Optional) Filter on organization invitation statuses")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -2651,7 +2754,7 @@ def list_user_organization_invitations_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._list_user_organization_invitations_serialize( limit=limit, @@ -2660,23 +2763,25 @@ def list_user_organization_invitations_without_preload_content( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ListUserOrganizationInvitationsReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "ListUserOrganizationInvitationsReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) return response_data.response + def _list_user_organization_invitations_serialize( self, limit, @@ -2691,7 +2796,7 @@ def _list_user_organization_invitations_serialize( _host = None _collection_formats: Dict[str, str] = { - "statuses": "multi", + 'statuses': 'multi', } _path_params: Dict[str, str] = {} @@ -2706,31 +2811,39 @@ def _list_user_organization_invitations_serialize( # process the path parameters # process the query parameters if limit is not None: - - _query_params.append(("limit", limit)) - + + _query_params.append(('limit', limit)) + if offset is not None: - - _query_params.append(("offset", offset)) - + + _query_params.append(('offset', offset)) + if statuses is not None: - - _query_params.append(("statuses", statuses)) - + + _query_params.append(('statuses', statuses)) + # process the header parameters # process the form parameters # process the body parameter + # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept(["*/*"]) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + '*/*' + ] + ) + # authentication setting - _auth_settings: List[str] = ["Bearer"] + _auth_settings: List[str] = [ + 'Bearer' + ] return self.api_client.param_serialize( - method="GET", - resource_path="/v1/account/organization_invitations", + method='GET', + resource_path='/v1/account/organization_invitations', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -2740,43 +2853,27 @@ def _list_user_organization_invitations_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth, + _request_auth=_request_auth ) + + + @validate_call def list_user_organizations( self, - limit: Annotated[ - Optional[StrictStr], Field(description="(Optional) Define pagination limit") - ] = None, - offset: Annotated[ - Optional[StrictStr], - Field(description="(Optional) Define pagination offset"), - ] = None, - order: Annotated[ - Optional[StrictStr], - Field( - description="(Optional) Sorts the list in the ascending or the descending order" - ), - ] = None, - search: Annotated[ - Optional[StrictStr], - Field( - description="(Optional) Fuzzy case-insensitive search based on organization name or organization id" - ), - ] = None, - statuses: Annotated[ - Optional[List[StrictStr]], - Field( - description="(Optional) Only return organizations which status match one in the list" - ), - ] = None, + limit: Annotated[Optional[StrictStr], Field(description="(Optional) Define pagination limit")] = None, + offset: Annotated[Optional[StrictStr], Field(description="(Optional) Define pagination offset")] = None, + order: Annotated[Optional[StrictStr], Field(description="(Optional) Sorts the list in the ascending or the descending order")] = None, + search: Annotated[Optional[StrictStr], Field(description="(Optional) Fuzzy case-insensitive search based on organization name or organization id")] = None, + statuses: Annotated[Optional[List[StrictStr]], Field(description="(Optional) Only return organizations which status match one in the list")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -2817,7 +2914,7 @@ def list_user_organizations( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._list_user_organizations_serialize( limit=limit, @@ -2828,20 +2925,21 @@ def list_user_organizations( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ListUserOrganizationsReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "ListUserOrganizationsReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -2849,40 +2947,22 @@ def list_user_organizations( response_types_map=_response_types_map, ).data + @validate_call def list_user_organizations_with_http_info( self, - limit: Annotated[ - Optional[StrictStr], Field(description="(Optional) Define pagination limit") - ] = None, - offset: Annotated[ - Optional[StrictStr], - Field(description="(Optional) Define pagination offset"), - ] = None, - order: Annotated[ - Optional[StrictStr], - Field( - description="(Optional) Sorts the list in the ascending or the descending order" - ), - ] = None, - search: Annotated[ - Optional[StrictStr], - Field( - description="(Optional) Fuzzy case-insensitive search based on organization name or organization id" - ), - ] = None, - statuses: Annotated[ - Optional[List[StrictStr]], - Field( - description="(Optional) Only return organizations which status match one in the list" - ), - ] = None, + limit: Annotated[Optional[StrictStr], Field(description="(Optional) Define pagination limit")] = None, + offset: Annotated[Optional[StrictStr], Field(description="(Optional) Define pagination offset")] = None, + order: Annotated[Optional[StrictStr], Field(description="(Optional) Sorts the list in the ascending or the descending order")] = None, + search: Annotated[Optional[StrictStr], Field(description="(Optional) Fuzzy case-insensitive search based on organization name or organization id")] = None, + statuses: Annotated[Optional[List[StrictStr]], Field(description="(Optional) Only return organizations which status match one in the list")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -2923,7 +3003,7 @@ def list_user_organizations_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._list_user_organizations_serialize( limit=limit, @@ -2934,20 +3014,21 @@ def list_user_organizations_with_http_info( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ListUserOrganizationsReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "ListUserOrganizationsReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -2955,40 +3036,22 @@ def list_user_organizations_with_http_info( response_types_map=_response_types_map, ) + @validate_call def list_user_organizations_without_preload_content( self, - limit: Annotated[ - Optional[StrictStr], Field(description="(Optional) Define pagination limit") - ] = None, - offset: Annotated[ - Optional[StrictStr], - Field(description="(Optional) Define pagination offset"), - ] = None, - order: Annotated[ - Optional[StrictStr], - Field( - description="(Optional) Sorts the list in the ascending or the descending order" - ), - ] = None, - search: Annotated[ - Optional[StrictStr], - Field( - description="(Optional) Fuzzy case-insensitive search based on organization name or organization id" - ), - ] = None, - statuses: Annotated[ - Optional[List[StrictStr]], - Field( - description="(Optional) Only return organizations which status match one in the list" - ), - ] = None, + limit: Annotated[Optional[StrictStr], Field(description="(Optional) Define pagination limit")] = None, + offset: Annotated[Optional[StrictStr], Field(description="(Optional) Define pagination offset")] = None, + order: Annotated[Optional[StrictStr], Field(description="(Optional) Sorts the list in the ascending or the descending order")] = None, + search: Annotated[Optional[StrictStr], Field(description="(Optional) Fuzzy case-insensitive search based on organization name or organization id")] = None, + statuses: Annotated[Optional[List[StrictStr]], Field(description="(Optional) Only return organizations which status match one in the list")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -3029,7 +3092,7 @@ def list_user_organizations_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._list_user_organizations_serialize( limit=limit, @@ -3040,23 +3103,25 @@ def list_user_organizations_without_preload_content( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ListUserOrganizationsReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "ListUserOrganizationsReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) return response_data.response + def _list_user_organizations_serialize( self, limit, @@ -3073,7 +3138,7 @@ def _list_user_organizations_serialize( _host = None _collection_formats: Dict[str, str] = { - "statuses": "multi", + 'statuses': 'multi', } _path_params: Dict[str, str] = {} @@ -3088,39 +3153,47 @@ def _list_user_organizations_serialize( # process the path parameters # process the query parameters if limit is not None: - - _query_params.append(("limit", limit)) - + + _query_params.append(('limit', limit)) + if offset is not None: - - _query_params.append(("offset", offset)) - + + _query_params.append(('offset', offset)) + if order is not None: - - _query_params.append(("order", order)) - + + _query_params.append(('order', order)) + if search is not None: - - _query_params.append(("search", search)) - + + _query_params.append(('search', search)) + if statuses is not None: - - _query_params.append(("statuses", statuses)) - + + _query_params.append(('statuses', statuses)) + # process the header parameters # process the form parameters # process the body parameter + # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept(["*/*"]) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + '*/*' + ] + ) + # authentication setting - _auth_settings: List[str] = ["Bearer"] + _auth_settings: List[str] = [ + 'Bearer' + ] return self.api_client.param_serialize( - method="GET", - resource_path="/v1/account/organizations", + method='GET', + resource_path='/v1/account/organizations', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -3130,9 +3203,12 @@ def _list_user_organizations_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth, + _request_auth=_request_auth ) + + + @validate_call def login_method( self, @@ -3141,8 +3217,9 @@ def login_method( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -3174,27 +3251,28 @@ def login_method( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._login_method_serialize( email=email, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "LoginMethodReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "LoginMethodReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -3202,6 +3280,7 @@ def login_method( response_types_map=_response_types_map, ).data + @validate_call def login_method_with_http_info( self, @@ -3210,8 +3289,9 @@ def login_method_with_http_info( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -3243,27 +3323,28 @@ def login_method_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._login_method_serialize( email=email, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "LoginMethodReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "LoginMethodReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -3271,6 +3352,7 @@ def login_method_with_http_info( response_types_map=_response_types_map, ) + @validate_call def login_method_without_preload_content( self, @@ -3279,8 +3361,9 @@ def login_method_without_preload_content( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -3312,30 +3395,32 @@ def login_method_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._login_method_serialize( email=email, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "LoginMethodReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "LoginMethodReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) return response_data.response + def _login_method_serialize( self, email, @@ -3347,7 +3432,8 @@ def _login_method_serialize( _host = None - _collection_formats: Dict[str, str] = {} + _collection_formats: Dict[str, str] = { + } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -3361,23 +3447,31 @@ def _login_method_serialize( # process the path parameters # process the query parameters if email is not None: - - _query_params.append(("email", email)) - + + _query_params.append(('email', email)) + # process the header parameters # process the form parameters # process the body parameter + # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept(["*/*"]) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + '*/*' + ] + ) + # authentication setting - _auth_settings: List[str] = ["Bearer"] + _auth_settings: List[str] = [ + 'Bearer' + ] return self.api_client.param_serialize( - method="GET", - resource_path="/v1/account/login_method", + method='GET', + resource_path='/v1/account/login_method', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -3387,22 +3481,24 @@ def _login_method_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth, + _request_auth=_request_auth ) + + + @validate_call def o_auth_callback( self, body: OAuthCallbackRequest, - seon_fp: Annotated[ - Optional[StrictStr], Field(description="Seon Fingerprint") - ] = None, + seon_fp: Annotated[Optional[StrictStr], Field(description="Seon Fingerprint")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -3436,7 +3532,7 @@ def o_auth_callback( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._o_auth_callback_serialize( body=body, @@ -3444,20 +3540,21 @@ def o_auth_callback( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "OAuthCallbackReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "OAuthCallbackReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -3465,19 +3562,19 @@ def o_auth_callback( response_types_map=_response_types_map, ).data + @validate_call def o_auth_callback_with_http_info( self, body: OAuthCallbackRequest, - seon_fp: Annotated[ - Optional[StrictStr], Field(description="Seon Fingerprint") - ] = None, + seon_fp: Annotated[Optional[StrictStr], Field(description="Seon Fingerprint")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -3511,7 +3608,7 @@ def o_auth_callback_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._o_auth_callback_serialize( body=body, @@ -3519,20 +3616,21 @@ def o_auth_callback_with_http_info( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "OAuthCallbackReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "OAuthCallbackReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -3540,19 +3638,19 @@ def o_auth_callback_with_http_info( response_types_map=_response_types_map, ) + @validate_call def o_auth_callback_without_preload_content( self, body: OAuthCallbackRequest, - seon_fp: Annotated[ - Optional[StrictStr], Field(description="Seon Fingerprint") - ] = None, + seon_fp: Annotated[Optional[StrictStr], Field(description="Seon Fingerprint")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -3586,7 +3684,7 @@ def o_auth_callback_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._o_auth_callback_serialize( body=body, @@ -3594,23 +3692,25 @@ def o_auth_callback_without_preload_content( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "OAuthCallbackReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "OAuthCallbackReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) return response_data.response + def _o_auth_callback_serialize( self, body, @@ -3623,7 +3723,8 @@ def _o_auth_callback_serialize( _host = None - _collection_formats: Dict[str, str] = {} + _collection_formats: Dict[str, str] = { + } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -3638,22 +3739,30 @@ def _o_auth_callback_serialize( # process the query parameters # process the header parameters if seon_fp is not None: - _header_params["seon-fp"] = seon_fp + _header_params['seon-fp'] = seon_fp # process the form parameters # process the body parameter if body is not None: _body_params = body + # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept(["*/*"]) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + '*/*' + ] + ) + # authentication setting - _auth_settings: List[str] = ["Bearer"] + _auth_settings: List[str] = [ + 'Bearer' + ] return self.api_client.param_serialize( - method="POST", - resource_path="/v1/account/oauth", + method='POST', + resource_path='/v1/account/oauth', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -3663,9 +3772,12 @@ def _o_auth_callback_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth, + _request_auth=_request_auth ) + + + @validate_call def resend_email_validation( self, @@ -3674,8 +3786,9 @@ def resend_email_validation( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -3707,27 +3820,28 @@ def resend_email_validation( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._resend_email_validation_serialize( body=body, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "object", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "object", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -3735,6 +3849,7 @@ def resend_email_validation( response_types_map=_response_types_map, ).data + @validate_call def resend_email_validation_with_http_info( self, @@ -3743,8 +3858,9 @@ def resend_email_validation_with_http_info( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -3776,27 +3892,28 @@ def resend_email_validation_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._resend_email_validation_serialize( body=body, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "object", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "object", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -3804,6 +3921,7 @@ def resend_email_validation_with_http_info( response_types_map=_response_types_map, ) + @validate_call def resend_email_validation_without_preload_content( self, @@ -3812,8 +3930,9 @@ def resend_email_validation_without_preload_content( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -3845,30 +3964,32 @@ def resend_email_validation_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._resend_email_validation_serialize( body=body, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "object", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "object", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) return response_data.response + def _resend_email_validation_serialize( self, body, @@ -3880,7 +4001,8 @@ def _resend_email_validation_serialize( _host = None - _collection_formats: Dict[str, str] = {} + _collection_formats: Dict[str, str] = { + } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -3899,16 +4021,24 @@ def _resend_email_validation_serialize( if body is not None: _body_params = body + # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept(["*/*"]) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + '*/*' + ] + ) + # authentication setting - _auth_settings: List[str] = ["Bearer"] + _auth_settings: List[str] = [ + 'Bearer' + ] return self.api_client.param_serialize( - method="POST", - resource_path="/v1/account/resend_validation", + method='POST', + resource_path='/v1/account/resend_validation', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -3918,9 +4048,12 @@ def _resend_email_validation_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth, + _request_auth=_request_auth ) + + + @validate_call def reset_password( self, @@ -3929,8 +4062,9 @@ def reset_password( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -3962,27 +4096,28 @@ def reset_password( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._reset_password_serialize( body=body, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "object", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "object", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -3990,6 +4125,7 @@ def reset_password( response_types_map=_response_types_map, ).data + @validate_call def reset_password_with_http_info( self, @@ -3998,8 +4134,9 @@ def reset_password_with_http_info( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -4031,27 +4168,28 @@ def reset_password_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._reset_password_serialize( body=body, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "object", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "object", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -4059,6 +4197,7 @@ def reset_password_with_http_info( response_types_map=_response_types_map, ) + @validate_call def reset_password_without_preload_content( self, @@ -4067,8 +4206,9 @@ def reset_password_without_preload_content( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -4100,30 +4240,32 @@ def reset_password_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._reset_password_serialize( body=body, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "object", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "object", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) return response_data.response + def _reset_password_serialize( self, body, @@ -4135,7 +4277,8 @@ def _reset_password_serialize( _host = None - _collection_formats: Dict[str, str] = {} + _collection_formats: Dict[str, str] = { + } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -4154,16 +4297,24 @@ def _reset_password_serialize( if body is not None: _body_params = body + # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept(["*/*"]) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + '*/*' + ] + ) + # authentication setting - _auth_settings: List[str] = ["Bearer"] + _auth_settings: List[str] = [ + 'Bearer' + ] return self.api_client.param_serialize( - method="POST", - resource_path="/v1/account/reset_password", + method='POST', + resource_path='/v1/account/reset_password', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -4173,22 +4324,24 @@ def _reset_password_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth, + _request_auth=_request_auth ) + + + @validate_call def signup( self, body: Annotated[CreateAccountRequest, Field(description="Create new account")], - seon_fp: Annotated[ - Optional[StrictStr], Field(description="Seon Fingerprint") - ] = None, + seon_fp: Annotated[Optional[StrictStr], Field(description="Seon Fingerprint")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -4222,7 +4375,7 @@ def signup( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._signup_serialize( body=body, @@ -4230,20 +4383,21 @@ def signup( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "LoginReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "LoginReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -4251,19 +4405,19 @@ def signup( response_types_map=_response_types_map, ).data + @validate_call def signup_with_http_info( self, body: Annotated[CreateAccountRequest, Field(description="Create new account")], - seon_fp: Annotated[ - Optional[StrictStr], Field(description="Seon Fingerprint") - ] = None, + seon_fp: Annotated[Optional[StrictStr], Field(description="Seon Fingerprint")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -4297,7 +4451,7 @@ def signup_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._signup_serialize( body=body, @@ -4305,20 +4459,21 @@ def signup_with_http_info( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "LoginReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "LoginReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -4326,19 +4481,19 @@ def signup_with_http_info( response_types_map=_response_types_map, ) + @validate_call def signup_without_preload_content( self, body: Annotated[CreateAccountRequest, Field(description="Create new account")], - seon_fp: Annotated[ - Optional[StrictStr], Field(description="Seon Fingerprint") - ] = None, + seon_fp: Annotated[Optional[StrictStr], Field(description="Seon Fingerprint")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -4372,7 +4527,7 @@ def signup_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._signup_serialize( body=body, @@ -4380,23 +4535,25 @@ def signup_without_preload_content( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "LoginReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "LoginReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) return response_data.response + def _signup_serialize( self, body, @@ -4409,7 +4566,8 @@ def _signup_serialize( _host = None - _collection_formats: Dict[str, str] = {} + _collection_formats: Dict[str, str] = { + } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -4424,22 +4582,30 @@ def _signup_serialize( # process the query parameters # process the header parameters if seon_fp is not None: - _header_params["seon-fp"] = seon_fp + _header_params['seon-fp'] = seon_fp # process the form parameters # process the body parameter if body is not None: _body_params = body + # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept(["*/*"]) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + '*/*' + ] + ) + # authentication setting - _auth_settings: List[str] = ["Bearer"] + _auth_settings: List[str] = [ + 'Bearer' + ] return self.api_client.param_serialize( - method="POST", - resource_path="/v1/account/signup", + method='POST', + resource_path='/v1/account/signup', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -4449,22 +4615,24 @@ def _signup_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth, + _request_auth=_request_auth ) + + + @validate_call def update_password( self, body: UpdatePasswordRequest, - seon_fp: Annotated[ - Optional[StrictStr], Field(description="Seon Fingerprint") - ] = None, + seon_fp: Annotated[Optional[StrictStr], Field(description="Seon Fingerprint")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -4498,7 +4666,7 @@ def update_password( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._update_password_serialize( body=body, @@ -4506,20 +4674,21 @@ def update_password( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "LoginReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "LoginReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -4527,19 +4696,19 @@ def update_password( response_types_map=_response_types_map, ).data + @validate_call def update_password_with_http_info( self, body: UpdatePasswordRequest, - seon_fp: Annotated[ - Optional[StrictStr], Field(description="Seon Fingerprint") - ] = None, + seon_fp: Annotated[Optional[StrictStr], Field(description="Seon Fingerprint")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -4573,7 +4742,7 @@ def update_password_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._update_password_serialize( body=body, @@ -4581,20 +4750,21 @@ def update_password_with_http_info( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "LoginReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "LoginReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -4602,19 +4772,19 @@ def update_password_with_http_info( response_types_map=_response_types_map, ) + @validate_call def update_password_without_preload_content( self, body: UpdatePasswordRequest, - seon_fp: Annotated[ - Optional[StrictStr], Field(description="Seon Fingerprint") - ] = None, + seon_fp: Annotated[Optional[StrictStr], Field(description="Seon Fingerprint")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -4648,7 +4818,7 @@ def update_password_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._update_password_serialize( body=body, @@ -4656,23 +4826,25 @@ def update_password_without_preload_content( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "LoginReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "LoginReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) return response_data.response + def _update_password_serialize( self, body, @@ -4685,7 +4857,8 @@ def _update_password_serialize( _host = None - _collection_formats: Dict[str, str] = {} + _collection_formats: Dict[str, str] = { + } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -4700,22 +4873,30 @@ def _update_password_serialize( # process the query parameters # process the header parameters if seon_fp is not None: - _header_params["seon-fp"] = seon_fp + _header_params['seon-fp'] = seon_fp # process the form parameters # process the body parameter if body is not None: _body_params = body + # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept(["*/*"]) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + '*/*' + ] + ) + # authentication setting - _auth_settings: List[str] = ["Bearer"] + _auth_settings: List[str] = [ + 'Bearer' + ] return self.api_client.param_serialize( - method="POST", - resource_path="/v1/account/update_password", + method='POST', + resource_path='/v1/account/update_password', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -4725,9 +4906,12 @@ def _update_password_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth, + _request_auth=_request_auth ) + + + @validate_call def update_user( self, @@ -4737,8 +4921,9 @@ def update_user( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -4772,7 +4957,7 @@ def update_user( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._update_user_serialize( user=user, @@ -4780,20 +4965,21 @@ def update_user( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "UserReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "UserReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -4801,6 +4987,7 @@ def update_user( response_types_map=_response_types_map, ).data + @validate_call def update_user_with_http_info( self, @@ -4810,8 +4997,9 @@ def update_user_with_http_info( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -4845,7 +5033,7 @@ def update_user_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._update_user_serialize( user=user, @@ -4853,20 +5041,21 @@ def update_user_with_http_info( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "UserReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "UserReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -4874,6 +5063,7 @@ def update_user_with_http_info( response_types_map=_response_types_map, ) + @validate_call def update_user_without_preload_content( self, @@ -4883,8 +5073,9 @@ def update_user_without_preload_content( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -4918,7 +5109,7 @@ def update_user_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._update_user_serialize( user=user, @@ -4926,23 +5117,25 @@ def update_user_without_preload_content( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "UserReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "UserReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) return response_data.response + def _update_user_serialize( self, user, @@ -4955,7 +5148,8 @@ def _update_user_serialize( _host = None - _collection_formats: Dict[str, str] = {} + _collection_formats: Dict[str, str] = { + } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -4969,25 +5163,33 @@ def _update_user_serialize( # process the path parameters # process the query parameters if update_mask is not None: - - _query_params.append(("update_mask", update_mask)) - + + _query_params.append(('update_mask', update_mask)) + # process the header parameters # process the form parameters # process the body parameter if user is not None: _body_params = user + # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept(["*/*"]) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + '*/*' + ] + ) + # authentication setting - _auth_settings: List[str] = ["Bearer"] + _auth_settings: List[str] = [ + 'Bearer' + ] return self.api_client.param_serialize( - method="PUT", - resource_path="/v1/account/profile", + method='PUT', + resource_path='/v1/account/profile', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -4997,9 +5199,12 @@ def _update_user_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth, + _request_auth=_request_auth ) + + + @validate_call def update_user2( self, @@ -5009,8 +5214,9 @@ def update_user2( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -5044,7 +5250,7 @@ def update_user2( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._update_user2_serialize( user=user, @@ -5052,20 +5258,21 @@ def update_user2( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "UserReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "UserReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -5073,6 +5280,7 @@ def update_user2( response_types_map=_response_types_map, ).data + @validate_call def update_user2_with_http_info( self, @@ -5082,8 +5290,9 @@ def update_user2_with_http_info( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -5117,7 +5326,7 @@ def update_user2_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._update_user2_serialize( user=user, @@ -5125,20 +5334,21 @@ def update_user2_with_http_info( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "UserReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "UserReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -5146,6 +5356,7 @@ def update_user2_with_http_info( response_types_map=_response_types_map, ) + @validate_call def update_user2_without_preload_content( self, @@ -5155,8 +5366,9 @@ def update_user2_without_preload_content( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -5190,7 +5402,7 @@ def update_user2_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._update_user2_serialize( user=user, @@ -5198,23 +5410,25 @@ def update_user2_without_preload_content( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "UserReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "UserReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) return response_data.response + def _update_user2_serialize( self, user, @@ -5227,7 +5441,8 @@ def _update_user2_serialize( _host = None - _collection_formats: Dict[str, str] = {} + _collection_formats: Dict[str, str] = { + } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -5241,25 +5456,33 @@ def _update_user2_serialize( # process the path parameters # process the query parameters if update_mask is not None: - - _query_params.append(("update_mask", update_mask)) - + + _query_params.append(('update_mask', update_mask)) + # process the header parameters # process the form parameters # process the body parameter if user is not None: _body_params = user + # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept(["*/*"]) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + '*/*' + ] + ) + # authentication setting - _auth_settings: List[str] = ["Bearer"] + _auth_settings: List[str] = [ + 'Bearer' + ] return self.api_client.param_serialize( - method="PATCH", - resource_path="/v1/account/profile", + method='PATCH', + resource_path='/v1/account/profile', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -5269,9 +5492,12 @@ def _update_user2_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth, + _request_auth=_request_auth ) + + + @validate_call def update_user_settings( self, @@ -5280,8 +5506,9 @@ def update_user_settings( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -5313,27 +5540,28 @@ def update_user_settings( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._update_user_settings_serialize( body=body, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "UpdateUserSettingsReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "UpdateUserSettingsReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -5341,6 +5569,7 @@ def update_user_settings( response_types_map=_response_types_map, ).data + @validate_call def update_user_settings_with_http_info( self, @@ -5349,8 +5578,9 @@ def update_user_settings_with_http_info( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -5382,27 +5612,28 @@ def update_user_settings_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._update_user_settings_serialize( body=body, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "UpdateUserSettingsReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "UpdateUserSettingsReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -5410,6 +5641,7 @@ def update_user_settings_with_http_info( response_types_map=_response_types_map, ) + @validate_call def update_user_settings_without_preload_content( self, @@ -5418,8 +5650,9 @@ def update_user_settings_without_preload_content( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -5451,30 +5684,32 @@ def update_user_settings_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._update_user_settings_serialize( body=body, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "UpdateUserSettingsReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "UpdateUserSettingsReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) return response_data.response + def _update_user_settings_serialize( self, body, @@ -5486,7 +5721,8 @@ def _update_user_settings_serialize( _host = None - _collection_formats: Dict[str, str] = {} + _collection_formats: Dict[str, str] = { + } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -5505,16 +5741,24 @@ def _update_user_settings_serialize( if body is not None: _body_params = body + # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept(["*/*"]) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + '*/*' + ] + ) + # authentication setting - _auth_settings: List[str] = ["Bearer"] + _auth_settings: List[str] = [ + 'Bearer' + ] return self.api_client.param_serialize( - method="PATCH", - resource_path="/v1/account/settings", + method='PATCH', + resource_path='/v1/account/settings', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -5524,9 +5768,12 @@ def _update_user_settings_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth, + _request_auth=_request_auth ) + + + @validate_call def update_user_v2( self, @@ -5536,8 +5783,9 @@ def update_user_v2( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -5571,7 +5819,7 @@ def update_user_v2( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._update_user_v2_serialize( user=user, @@ -5579,20 +5827,21 @@ def update_user_v2( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "UserReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "UserReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -5600,6 +5849,7 @@ def update_user_v2( response_types_map=_response_types_map, ).data + @validate_call def update_user_v2_with_http_info( self, @@ -5609,8 +5859,9 @@ def update_user_v2_with_http_info( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -5644,7 +5895,7 @@ def update_user_v2_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._update_user_v2_serialize( user=user, @@ -5652,20 +5903,21 @@ def update_user_v2_with_http_info( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "UserReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "UserReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -5673,6 +5925,7 @@ def update_user_v2_with_http_info( response_types_map=_response_types_map, ) + @validate_call def update_user_v2_without_preload_content( self, @@ -5682,8 +5935,9 @@ def update_user_v2_without_preload_content( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -5717,7 +5971,7 @@ def update_user_v2_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._update_user_v2_serialize( user=user, @@ -5725,23 +5979,25 @@ def update_user_v2_without_preload_content( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "UserReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "UserReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) return response_data.response + def _update_user_v2_serialize( self, user, @@ -5754,7 +6010,8 @@ def _update_user_v2_serialize( _host = None - _collection_formats: Dict[str, str] = {} + _collection_formats: Dict[str, str] = { + } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -5768,25 +6025,33 @@ def _update_user_v2_serialize( # process the path parameters # process the query parameters if update_mask is not None: - - _query_params.append(("update_mask", update_mask)) - + + _query_params.append(('update_mask', update_mask)) + # process the header parameters # process the form parameters # process the body parameter if user is not None: _body_params = user + # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept(["*/*"]) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + '*/*' + ] + ) + # authentication setting - _auth_settings: List[str] = ["Bearer"] + _auth_settings: List[str] = [ + 'Bearer' + ] return self.api_client.param_serialize( - method="PUT", - resource_path="/v2/account/profile", + method='PUT', + resource_path='/v2/account/profile', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -5796,9 +6061,12 @@ def _update_user_v2_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth, + _request_auth=_request_auth ) + + + @validate_call def update_user_v22( self, @@ -5808,8 +6076,9 @@ def update_user_v22( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -5843,7 +6112,7 @@ def update_user_v22( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._update_user_v22_serialize( user=user, @@ -5851,20 +6120,21 @@ def update_user_v22( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "UserReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "UserReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -5872,6 +6142,7 @@ def update_user_v22( response_types_map=_response_types_map, ).data + @validate_call def update_user_v22_with_http_info( self, @@ -5881,8 +6152,9 @@ def update_user_v22_with_http_info( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -5916,7 +6188,7 @@ def update_user_v22_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._update_user_v22_serialize( user=user, @@ -5924,20 +6196,21 @@ def update_user_v22_with_http_info( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "UserReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "UserReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -5945,6 +6218,7 @@ def update_user_v22_with_http_info( response_types_map=_response_types_map, ) + @validate_call def update_user_v22_without_preload_content( self, @@ -5954,8 +6228,9 @@ def update_user_v22_without_preload_content( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -5989,7 +6264,7 @@ def update_user_v22_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._update_user_v22_serialize( user=user, @@ -5997,23 +6272,25 @@ def update_user_v22_without_preload_content( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "UserReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "UserReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) return response_data.response + def _update_user_v22_serialize( self, user, @@ -6026,7 +6303,8 @@ def _update_user_v22_serialize( _host = None - _collection_formats: Dict[str, str] = {} + _collection_formats: Dict[str, str] = { + } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -6040,25 +6318,33 @@ def _update_user_v22_serialize( # process the path parameters # process the query parameters if update_mask is not None: - - _query_params.append(("update_mask", update_mask)) - + + _query_params.append(('update_mask', update_mask)) + # process the header parameters # process the form parameters # process the body parameter if user is not None: _body_params = user + # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept(["*/*"]) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + '*/*' + ] + ) + # authentication setting - _auth_settings: List[str] = ["Bearer"] + _auth_settings: List[str] = [ + 'Bearer' + ] return self.api_client.param_serialize( - method="PATCH", - resource_path="/v2/account/profile", + method='PATCH', + resource_path='/v2/account/profile', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -6068,22 +6354,24 @@ def _update_user_v22_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth, + _request_auth=_request_auth ) + + + @validate_call def validate( self, id: StrictStr, - seon_fp: Annotated[ - Optional[StrictStr], Field(description="Seon Fingerprint") - ] = None, + seon_fp: Annotated[Optional[StrictStr], Field(description="Seon Fingerprint")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -6117,7 +6405,7 @@ def validate( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._validate_serialize( id=id, @@ -6125,20 +6413,21 @@ def validate( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "LoginReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "LoginReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -6146,19 +6435,19 @@ def validate( response_types_map=_response_types_map, ).data + @validate_call def validate_with_http_info( self, id: StrictStr, - seon_fp: Annotated[ - Optional[StrictStr], Field(description="Seon Fingerprint") - ] = None, + seon_fp: Annotated[Optional[StrictStr], Field(description="Seon Fingerprint")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -6192,7 +6481,7 @@ def validate_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._validate_serialize( id=id, @@ -6200,20 +6489,21 @@ def validate_with_http_info( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "LoginReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "LoginReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -6221,19 +6511,19 @@ def validate_with_http_info( response_types_map=_response_types_map, ) + @validate_call def validate_without_preload_content( self, id: StrictStr, - seon_fp: Annotated[ - Optional[StrictStr], Field(description="Seon Fingerprint") - ] = None, + seon_fp: Annotated[Optional[StrictStr], Field(description="Seon Fingerprint")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -6267,7 +6557,7 @@ def validate_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._validate_serialize( id=id, @@ -6275,23 +6565,25 @@ def validate_without_preload_content( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "LoginReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "LoginReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) return response_data.response + def _validate_serialize( self, id, @@ -6304,7 +6596,8 @@ def _validate_serialize( _host = None - _collection_formats: Dict[str, str] = {} + _collection_formats: Dict[str, str] = { + } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -6317,24 +6610,32 @@ def _validate_serialize( # process the path parameters if id is not None: - _path_params["id"] = id + _path_params['id'] = id # process the query parameters # process the header parameters if seon_fp is not None: - _header_params["seon-fp"] = seon_fp + _header_params['seon-fp'] = seon_fp # process the form parameters # process the body parameter + # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept(["*/*"]) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + '*/*' + ] + ) + # authentication setting - _auth_settings: List[str] = ["Bearer"] + _auth_settings: List[str] = [ + 'Bearer' + ] return self.api_client.param_serialize( - method="POST", - resource_path="/v1/account/validate/{id}", + method='POST', + resource_path='/v1/account/validate/{id}', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -6344,5 +6645,7 @@ def _validate_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth, + _request_auth=_request_auth ) + + diff --git a/koyeb/api/api/projects_api.py b/koyeb/api/api/projects_api.py new file mode 100644 index 00000000..dce99b63 --- /dev/null +++ b/koyeb/api/api/projects_api.py @@ -0,0 +1,1799 @@ +""" + Koyeb Rest API + + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated + +from pydantic import Field, StrictStr +from typing import Any, Dict, Optional +from typing_extensions import Annotated +from koyeb.api.models.create_project import CreateProject +from koyeb.api.models.create_project_reply import CreateProjectReply +from koyeb.api.models.get_project_reply import GetProjectReply +from koyeb.api.models.list_projects_reply import ListProjectsReply +from koyeb.api.models.project import Project +from koyeb.api.models.update_project_reply import UpdateProjectReply + +from koyeb.api.api_client import ApiClient, RequestSerialized +from koyeb.api.api_response import ApiResponse +from koyeb.api.rest import RESTResponseType + + +class ProjectsApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + self.api_client = api_client + + + @validate_call + def create_project( + self, + project: CreateProject, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> CreateProjectReply: + """Create project + + + :param project: (required) + :type project: CreateProject + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_project_serialize( + project=project, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CreateProjectReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def create_project_with_http_info( + self, + project: CreateProject, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[CreateProjectReply]: + """Create project + + + :param project: (required) + :type project: CreateProject + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_project_serialize( + project=project, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CreateProjectReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def create_project_without_preload_content( + self, + project: CreateProject, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Create project + + + :param project: (required) + :type project: CreateProject + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_project_serialize( + project=project, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CreateProjectReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _create_project_serialize( + self, + project, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if project is not None: + _body_params = project + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + '*/*' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'Bearer' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/v1/projects', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def delete_project( + self, + id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> object: + """Delete project + + + :param id: (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_project_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "object", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def delete_project_with_http_info( + self, + id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[object]: + """Delete project + + + :param id: (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_project_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "object", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def delete_project_without_preload_content( + self, + id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Delete project + + + :param id: (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_project_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "object", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _delete_project_serialize( + self, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + '*/*' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'Bearer' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/v1/projects/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def get_project( + self, + id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> GetProjectReply: + """Get project + + + :param id: (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_project_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "GetProjectReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_project_with_http_info( + self, + id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[GetProjectReply]: + """Get project + + + :param id: (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_project_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "GetProjectReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def get_project_without_preload_content( + self, + id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get project + + + :param id: (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_project_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "GetProjectReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_project_serialize( + self, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + '*/*' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'Bearer' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/v1/projects/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def list_projects( + self, + limit: Annotated[Optional[StrictStr], Field(description="(Optional) The number of items to return")] = None, + offset: Annotated[Optional[StrictStr], Field(description="(Optional) The offset in the list of item to return")] = None, + name: Annotated[Optional[StrictStr], Field(description="(Optional) Filter by project name")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ListProjectsReply: + """List projects + + + :param limit: (Optional) The number of items to return + :type limit: str + :param offset: (Optional) The offset in the list of item to return + :type offset: str + :param name: (Optional) Filter by project name + :type name: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_projects_serialize( + limit=limit, + offset=offset, + name=name, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ListProjectsReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def list_projects_with_http_info( + self, + limit: Annotated[Optional[StrictStr], Field(description="(Optional) The number of items to return")] = None, + offset: Annotated[Optional[StrictStr], Field(description="(Optional) The offset in the list of item to return")] = None, + name: Annotated[Optional[StrictStr], Field(description="(Optional) Filter by project name")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ListProjectsReply]: + """List projects + + + :param limit: (Optional) The number of items to return + :type limit: str + :param offset: (Optional) The offset in the list of item to return + :type offset: str + :param name: (Optional) Filter by project name + :type name: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_projects_serialize( + limit=limit, + offset=offset, + name=name, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ListProjectsReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def list_projects_without_preload_content( + self, + limit: Annotated[Optional[StrictStr], Field(description="(Optional) The number of items to return")] = None, + offset: Annotated[Optional[StrictStr], Field(description="(Optional) The offset in the list of item to return")] = None, + name: Annotated[Optional[StrictStr], Field(description="(Optional) Filter by project name")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """List projects + + + :param limit: (Optional) The number of items to return + :type limit: str + :param offset: (Optional) The offset in the list of item to return + :type offset: str + :param name: (Optional) Filter by project name + :type name: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_projects_serialize( + limit=limit, + offset=offset, + name=name, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ListProjectsReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _list_projects_serialize( + self, + limit, + offset, + name, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if limit is not None: + + _query_params.append(('limit', limit)) + + if offset is not None: + + _query_params.append(('offset', offset)) + + if name is not None: + + _query_params.append(('name', name)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + '*/*' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'Bearer' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/v1/projects', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def update_project( + self, + id: StrictStr, + project: Project, + update_mask: Optional[StrictStr] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> UpdateProjectReply: + """Update project + + + :param id: (required) + :type id: str + :param project: (required) + :type project: Project + :param update_mask: + :type update_mask: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_project_serialize( + id=id, + project=project, + update_mask=update_mask, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "UpdateProjectReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def update_project_with_http_info( + self, + id: StrictStr, + project: Project, + update_mask: Optional[StrictStr] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[UpdateProjectReply]: + """Update project + + + :param id: (required) + :type id: str + :param project: (required) + :type project: Project + :param update_mask: + :type update_mask: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_project_serialize( + id=id, + project=project, + update_mask=update_mask, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "UpdateProjectReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def update_project_without_preload_content( + self, + id: StrictStr, + project: Project, + update_mask: Optional[StrictStr] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Update project + + + :param id: (required) + :type id: str + :param project: (required) + :type project: Project + :param update_mask: + :type update_mask: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_project_serialize( + id=id, + project=project, + update_mask=update_mask, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "UpdateProjectReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _update_project_serialize( + self, + id, + project, + update_mask, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + if update_mask is not None: + + _query_params.append(('update_mask', update_mask)) + + # process the header parameters + # process the form parameters + # process the body parameter + if project is not None: + _body_params = project + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + '*/*' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'Bearer' + ] + + return self.api_client.param_serialize( + method='PUT', + resource_path='/v1/projects/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def update_project2( + self, + id: StrictStr, + project: Project, + update_mask: Optional[StrictStr] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> UpdateProjectReply: + """Update project + + + :param id: (required) + :type id: str + :param project: (required) + :type project: Project + :param update_mask: + :type update_mask: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_project2_serialize( + id=id, + project=project, + update_mask=update_mask, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "UpdateProjectReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def update_project2_with_http_info( + self, + id: StrictStr, + project: Project, + update_mask: Optional[StrictStr] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[UpdateProjectReply]: + """Update project + + + :param id: (required) + :type id: str + :param project: (required) + :type project: Project + :param update_mask: + :type update_mask: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_project2_serialize( + id=id, + project=project, + update_mask=update_mask, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "UpdateProjectReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def update_project2_without_preload_content( + self, + id: StrictStr, + project: Project, + update_mask: Optional[StrictStr] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Update project + + + :param id: (required) + :type id: str + :param project: (required) + :type project: Project + :param update_mask: + :type update_mask: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_project2_serialize( + id=id, + project=project, + update_mask=update_mask, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "UpdateProjectReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _update_project2_serialize( + self, + id, + project, + update_mask, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + if update_mask is not None: + + _query_params.append(('update_mask', update_mask)) + + # process the header parameters + # process the form parameters + # process the body parameter + if project is not None: + _body_params = project + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + '*/*' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'Bearer' + ] + + return self.api_client.param_serialize( + method='PATCH', + resource_path='/v1/projects/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/koyeb/api/api/provisioning_api.py b/koyeb/api/api/provisioning_api.py index 8d2a3558..47137f20 100644 --- a/koyeb/api/api/provisioning_api.py +++ b/koyeb/api/api/provisioning_api.py @@ -1,16 +1,15 @@ -# coding: utf-8 - """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 + import warnings from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt from typing import Any, Dict, List, Optional, Tuple, Union @@ -39,6 +38,7 @@ def __init__(self, api_client=None) -> None: api_client = ApiClient.get_default() self.api_client = api_client + @validate_call def create_stage_attempt( self, @@ -50,8 +50,9 @@ def create_stage_attempt( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -89,7 +90,7 @@ def create_stage_attempt( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._create_stage_attempt_serialize( deployment_id=deployment_id, @@ -99,20 +100,21 @@ def create_stage_attempt( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "object", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "object", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -120,6 +122,7 @@ def create_stage_attempt( response_types_map=_response_types_map, ).data + @validate_call def create_stage_attempt_with_http_info( self, @@ -131,8 +134,9 @@ def create_stage_attempt_with_http_info( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -170,7 +174,7 @@ def create_stage_attempt_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._create_stage_attempt_serialize( deployment_id=deployment_id, @@ -180,20 +184,21 @@ def create_stage_attempt_with_http_info( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "object", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "object", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -201,6 +206,7 @@ def create_stage_attempt_with_http_info( response_types_map=_response_types_map, ) + @validate_call def create_stage_attempt_without_preload_content( self, @@ -212,8 +218,9 @@ def create_stage_attempt_without_preload_content( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -251,7 +258,7 @@ def create_stage_attempt_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._create_stage_attempt_serialize( deployment_id=deployment_id, @@ -261,23 +268,25 @@ def create_stage_attempt_without_preload_content( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "object", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "object", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) return response_data.response + def _create_stage_attempt_serialize( self, deployment_id, @@ -292,7 +301,8 @@ def _create_stage_attempt_serialize( _host = None - _collection_formats: Dict[str, str] = {} + _collection_formats: Dict[str, str] = { + } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -305,11 +315,11 @@ def _create_stage_attempt_serialize( # process the path parameters if deployment_id is not None: - _path_params["deployment_id"] = deployment_id + _path_params['deployment_id'] = deployment_id if stage is not None: - _path_params["stage"] = stage + _path_params['stage'] = stage if attempt is not None: - _path_params["attempt"] = attempt + _path_params['attempt'] = attempt # process the query parameters # process the header parameters # process the form parameters @@ -317,16 +327,24 @@ def _create_stage_attempt_serialize( if body is not None: _body_params = body + # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept(["*/*"]) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + '*/*' + ] + ) + # authentication setting - _auth_settings: List[str] = ["Bearer"] + _auth_settings: List[str] = [ + 'Bearer' + ] return self.api_client.param_serialize( - method="POST", - resource_path="/v1/provisioning/{deployment_id}/status/{stage}/{attempt}", + method='POST', + resource_path='/v1/provisioning/{deployment_id}/status/{stage}/{attempt}', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -336,9 +354,12 @@ def _create_stage_attempt_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth, + _request_auth=_request_auth ) + + + @validate_call def declare_stage_progress( self, @@ -350,8 +371,9 @@ def declare_stage_progress( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -389,7 +411,7 @@ def declare_stage_progress( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._declare_stage_progress_serialize( deployment_id=deployment_id, @@ -399,20 +421,21 @@ def declare_stage_progress( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "object", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "object", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -420,6 +443,7 @@ def declare_stage_progress( response_types_map=_response_types_map, ).data + @validate_call def declare_stage_progress_with_http_info( self, @@ -431,8 +455,9 @@ def declare_stage_progress_with_http_info( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -470,7 +495,7 @@ def declare_stage_progress_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._declare_stage_progress_serialize( deployment_id=deployment_id, @@ -480,20 +505,21 @@ def declare_stage_progress_with_http_info( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "object", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "object", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -501,6 +527,7 @@ def declare_stage_progress_with_http_info( response_types_map=_response_types_map, ) + @validate_call def declare_stage_progress_without_preload_content( self, @@ -512,8 +539,9 @@ def declare_stage_progress_without_preload_content( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -551,7 +579,7 @@ def declare_stage_progress_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._declare_stage_progress_serialize( deployment_id=deployment_id, @@ -561,23 +589,25 @@ def declare_stage_progress_without_preload_content( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "object", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "object", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) return response_data.response + def _declare_stage_progress_serialize( self, deployment_id, @@ -592,7 +622,8 @@ def _declare_stage_progress_serialize( _host = None - _collection_formats: Dict[str, str] = {} + _collection_formats: Dict[str, str] = { + } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -605,11 +636,11 @@ def _declare_stage_progress_serialize( # process the path parameters if deployment_id is not None: - _path_params["deployment_id"] = deployment_id + _path_params['deployment_id'] = deployment_id if stage is not None: - _path_params["stage"] = stage + _path_params['stage'] = stage if attempt is not None: - _path_params["attempt"] = attempt + _path_params['attempt'] = attempt # process the query parameters # process the header parameters # process the form parameters @@ -617,16 +648,24 @@ def _declare_stage_progress_serialize( if body is not None: _body_params = body + # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept(["*/*"]) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + '*/*' + ] + ) + # authentication setting - _auth_settings: List[str] = ["Bearer"] + _auth_settings: List[str] = [ + 'Bearer' + ] return self.api_client.param_serialize( - method="PATCH", - resource_path="/v1/provisioning/{deployment_id}/status/{stage}/{attempt}", + method='PATCH', + resource_path='/v1/provisioning/{deployment_id}/status/{stage}/{attempt}', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -636,9 +675,12 @@ def _declare_stage_progress_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth, + _request_auth=_request_auth ) + + + @validate_call def declare_step_progress( self, @@ -651,8 +693,9 @@ def declare_step_progress( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -692,7 +735,7 @@ def declare_step_progress( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._declare_step_progress_serialize( deployment_id=deployment_id, @@ -703,20 +746,21 @@ def declare_step_progress( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "object", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "object", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -724,6 +768,7 @@ def declare_step_progress( response_types_map=_response_types_map, ).data + @validate_call def declare_step_progress_with_http_info( self, @@ -736,8 +781,9 @@ def declare_step_progress_with_http_info( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -777,7 +823,7 @@ def declare_step_progress_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._declare_step_progress_serialize( deployment_id=deployment_id, @@ -788,20 +834,21 @@ def declare_step_progress_with_http_info( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "object", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "object", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -809,6 +856,7 @@ def declare_step_progress_with_http_info( response_types_map=_response_types_map, ) + @validate_call def declare_step_progress_without_preload_content( self, @@ -821,8 +869,9 @@ def declare_step_progress_without_preload_content( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -862,7 +911,7 @@ def declare_step_progress_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._declare_step_progress_serialize( deployment_id=deployment_id, @@ -873,23 +922,25 @@ def declare_step_progress_without_preload_content( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "object", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "object", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) return response_data.response + def _declare_step_progress_serialize( self, deployment_id, @@ -905,7 +956,8 @@ def _declare_step_progress_serialize( _host = None - _collection_formats: Dict[str, str] = {} + _collection_formats: Dict[str, str] = { + } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -918,13 +970,13 @@ def _declare_step_progress_serialize( # process the path parameters if deployment_id is not None: - _path_params["deployment_id"] = deployment_id + _path_params['deployment_id'] = deployment_id if stage is not None: - _path_params["stage"] = stage + _path_params['stage'] = stage if attempt is not None: - _path_params["attempt"] = attempt + _path_params['attempt'] = attempt if step is not None: - _path_params["step"] = step + _path_params['step'] = step # process the query parameters # process the header parameters # process the form parameters @@ -932,16 +984,24 @@ def _declare_step_progress_serialize( if body is not None: _body_params = body + # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept(["*/*"]) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + '*/*' + ] + ) + # authentication setting - _auth_settings: List[str] = ["Bearer"] + _auth_settings: List[str] = [ + 'Bearer' + ] return self.api_client.param_serialize( - method="PATCH", - resource_path="/v1/provisioning/{deployment_id}/status/{stage}/{attempt}/{step}", + method='PATCH', + resource_path='/v1/provisioning/{deployment_id}/status/{stage}/{attempt}/{step}', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -951,5 +1011,7 @@ def _declare_step_progress_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth, + _request_auth=_request_auth ) + + diff --git a/koyeb/api/api/quotas_api.py b/koyeb/api/api/quotas_api.py index 5ca227e1..c4b20615 100644 --- a/koyeb/api/api/quotas_api.py +++ b/koyeb/api/api/quotas_api.py @@ -1,27 +1,22 @@ -# coding: utf-8 - """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 + import warnings from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt from typing import Any, Dict, List, Optional, Tuple, Union from typing_extensions import Annotated -from koyeb.api.models.review_organization_capacity_reply import ( - ReviewOrganizationCapacityReply, -) -from koyeb.api.models.review_organization_capacity_request import ( - ReviewOrganizationCapacityRequest, -) +from koyeb.api.models.review_organization_capacity_reply import ReviewOrganizationCapacityReply +from koyeb.api.models.review_organization_capacity_request import ReviewOrganizationCapacityRequest from koyeb.api.api_client import ApiClient, RequestSerialized from koyeb.api.api_response import ApiResponse @@ -40,6 +35,7 @@ def __init__(self, api_client=None) -> None: api_client = ApiClient.get_default() self.api_client = api_client + @validate_call def review_organization_capacity( self, @@ -48,8 +44,9 @@ def review_organization_capacity( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -81,27 +78,28 @@ def review_organization_capacity( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._review_organization_capacity_serialize( body=body, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ReviewOrganizationCapacityReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "ReviewOrganizationCapacityReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -109,6 +107,7 @@ def review_organization_capacity( response_types_map=_response_types_map, ).data + @validate_call def review_organization_capacity_with_http_info( self, @@ -117,8 +116,9 @@ def review_organization_capacity_with_http_info( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -150,27 +150,28 @@ def review_organization_capacity_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._review_organization_capacity_serialize( body=body, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ReviewOrganizationCapacityReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "ReviewOrganizationCapacityReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -178,6 +179,7 @@ def review_organization_capacity_with_http_info( response_types_map=_response_types_map, ) + @validate_call def review_organization_capacity_without_preload_content( self, @@ -186,8 +188,9 @@ def review_organization_capacity_without_preload_content( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -219,30 +222,32 @@ def review_organization_capacity_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._review_organization_capacity_serialize( body=body, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ReviewOrganizationCapacityReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "ReviewOrganizationCapacityReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) return response_data.response + def _review_organization_capacity_serialize( self, body, @@ -254,7 +259,8 @@ def _review_organization_capacity_serialize( _host = None - _collection_formats: Dict[str, str] = {} + _collection_formats: Dict[str, str] = { + } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -273,16 +279,24 @@ def _review_organization_capacity_serialize( if body is not None: _body_params = body + # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept(["*/*"]) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + '*/*' + ] + ) + # authentication setting - _auth_settings: List[str] = ["Bearer"] + _auth_settings: List[str] = [ + 'Bearer' + ] return self.api_client.param_serialize( - method="POST", - resource_path="/v1/quotas/capacity", + method='POST', + resource_path='/v1/quotas/capacity', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -292,5 +306,7 @@ def _review_organization_capacity_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth, + _request_auth=_request_auth ) + + diff --git a/koyeb/api/api/regional_deployments_api.py b/koyeb/api/api/regional_deployments_api.py index 996c1e25..f5c9a535 100644 --- a/koyeb/api/api/regional_deployments_api.py +++ b/koyeb/api/api/regional_deployments_api.py @@ -1,16 +1,15 @@ -# coding: utf-8 - """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 + import warnings from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt from typing import Any, Dict, List, Optional, Tuple, Union @@ -20,12 +19,8 @@ from typing import List, Optional from typing_extensions import Annotated from koyeb.api.models.get_regional_deployment_reply import GetRegionalDeploymentReply -from koyeb.api.models.list_regional_deployment_events_reply import ( - ListRegionalDeploymentEventsReply, -) -from koyeb.api.models.list_regional_deployments_reply import ( - ListRegionalDeploymentsReply, -) +from koyeb.api.models.list_regional_deployment_events_reply import ListRegionalDeploymentEventsReply +from koyeb.api.models.list_regional_deployments_reply import ListRegionalDeploymentsReply from koyeb.api.api_client import ApiClient, RequestSerialized from koyeb.api.api_response import ApiResponse @@ -44,18 +39,18 @@ def __init__(self, api_client=None) -> None: api_client = ApiClient.get_default() self.api_client = api_client + @validate_call def get_regional_deployment( self, - id: Annotated[ - StrictStr, Field(description="The id of the regional deployment") - ], + id: Annotated[StrictStr, Field(description="The id of the regional deployment")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -88,27 +83,28 @@ def get_regional_deployment( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._get_regional_deployment_serialize( id=id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "GetRegionalDeploymentReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "GetRegionalDeploymentReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -116,18 +112,18 @@ def get_regional_deployment( response_types_map=_response_types_map, ).data + @validate_call def get_regional_deployment_with_http_info( self, - id: Annotated[ - StrictStr, Field(description="The id of the regional deployment") - ], + id: Annotated[StrictStr, Field(description="The id of the regional deployment")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -160,27 +156,28 @@ def get_regional_deployment_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._get_regional_deployment_serialize( id=id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "GetRegionalDeploymentReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "GetRegionalDeploymentReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -188,18 +185,18 @@ def get_regional_deployment_with_http_info( response_types_map=_response_types_map, ) + @validate_call def get_regional_deployment_without_preload_content( self, - id: Annotated[ - StrictStr, Field(description="The id of the regional deployment") - ], + id: Annotated[StrictStr, Field(description="The id of the regional deployment")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -232,30 +229,32 @@ def get_regional_deployment_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._get_regional_deployment_serialize( id=id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "GetRegionalDeploymentReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "GetRegionalDeploymentReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) return response_data.response + def _get_regional_deployment_serialize( self, id, @@ -267,7 +266,8 @@ def _get_regional_deployment_serialize( _host = None - _collection_formats: Dict[str, str] = {} + _collection_formats: Dict[str, str] = { + } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -280,22 +280,30 @@ def _get_regional_deployment_serialize( # process the path parameters if id is not None: - _path_params["id"] = id + _path_params['id'] = id # process the query parameters # process the header parameters # process the form parameters # process the body parameter + # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept(["*/*"]) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + '*/*' + ] + ) + # authentication setting - _auth_settings: List[str] = ["Bearer"] + _auth_settings: List[str] = [ + 'Bearer' + ] return self.api_client.param_serialize( - method="GET", - resource_path="/v1/regional_deployments/{id}", + method='GET', + resource_path='/v1/regional_deployments/{id}', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -305,40 +313,27 @@ def _get_regional_deployment_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth, + _request_auth=_request_auth ) + + + @validate_call def list_regional_deployment_events( self, - regional_deployment_id: Annotated[ - Optional[StrictStr], - Field(description="(Optional) Filter on regional deployment id"), - ] = None, - types: Annotated[ - Optional[List[StrictStr]], - Field(description="(Optional) Filter on regional deployment event types"), - ] = None, - limit: Annotated[ - Optional[StrictStr], - Field(description="(Optional) The number of items to return"), - ] = None, - offset: Annotated[ - Optional[StrictStr], - Field(description="(Optional) The offset in the list of item to return"), - ] = None, - order: Annotated[ - Optional[StrictStr], - Field( - description="(Optional) Sorts the list in the ascending or the descending order" - ), - ] = None, + regional_deployment_id: Annotated[Optional[StrictStr], Field(description="(Optional) Filter on regional deployment id")] = None, + types: Annotated[Optional[List[StrictStr]], Field(description="(Optional) Filter on regional deployment event types")] = None, + limit: Annotated[Optional[StrictStr], Field(description="(Optional) The number of items to return")] = None, + offset: Annotated[Optional[StrictStr], Field(description="(Optional) The offset in the list of item to return")] = None, + order: Annotated[Optional[StrictStr], Field(description="(Optional) Sorts the list in the ascending or the descending order")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -378,7 +373,7 @@ def list_regional_deployment_events( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._list_regional_deployment_events_serialize( regional_deployment_id=regional_deployment_id, @@ -389,20 +384,21 @@ def list_regional_deployment_events( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ListRegionalDeploymentEventsReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "ListRegionalDeploymentEventsReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -410,37 +406,22 @@ def list_regional_deployment_events( response_types_map=_response_types_map, ).data + @validate_call def list_regional_deployment_events_with_http_info( self, - regional_deployment_id: Annotated[ - Optional[StrictStr], - Field(description="(Optional) Filter on regional deployment id"), - ] = None, - types: Annotated[ - Optional[List[StrictStr]], - Field(description="(Optional) Filter on regional deployment event types"), - ] = None, - limit: Annotated[ - Optional[StrictStr], - Field(description="(Optional) The number of items to return"), - ] = None, - offset: Annotated[ - Optional[StrictStr], - Field(description="(Optional) The offset in the list of item to return"), - ] = None, - order: Annotated[ - Optional[StrictStr], - Field( - description="(Optional) Sorts the list in the ascending or the descending order" - ), - ] = None, + regional_deployment_id: Annotated[Optional[StrictStr], Field(description="(Optional) Filter on regional deployment id")] = None, + types: Annotated[Optional[List[StrictStr]], Field(description="(Optional) Filter on regional deployment event types")] = None, + limit: Annotated[Optional[StrictStr], Field(description="(Optional) The number of items to return")] = None, + offset: Annotated[Optional[StrictStr], Field(description="(Optional) The offset in the list of item to return")] = None, + order: Annotated[Optional[StrictStr], Field(description="(Optional) Sorts the list in the ascending or the descending order")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -480,7 +461,7 @@ def list_regional_deployment_events_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._list_regional_deployment_events_serialize( regional_deployment_id=regional_deployment_id, @@ -491,20 +472,21 @@ def list_regional_deployment_events_with_http_info( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ListRegionalDeploymentEventsReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "ListRegionalDeploymentEventsReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -512,37 +494,22 @@ def list_regional_deployment_events_with_http_info( response_types_map=_response_types_map, ) + @validate_call def list_regional_deployment_events_without_preload_content( self, - regional_deployment_id: Annotated[ - Optional[StrictStr], - Field(description="(Optional) Filter on regional deployment id"), - ] = None, - types: Annotated[ - Optional[List[StrictStr]], - Field(description="(Optional) Filter on regional deployment event types"), - ] = None, - limit: Annotated[ - Optional[StrictStr], - Field(description="(Optional) The number of items to return"), - ] = None, - offset: Annotated[ - Optional[StrictStr], - Field(description="(Optional) The offset in the list of item to return"), - ] = None, - order: Annotated[ - Optional[StrictStr], - Field( - description="(Optional) Sorts the list in the ascending or the descending order" - ), - ] = None, + regional_deployment_id: Annotated[Optional[StrictStr], Field(description="(Optional) Filter on regional deployment id")] = None, + types: Annotated[Optional[List[StrictStr]], Field(description="(Optional) Filter on regional deployment event types")] = None, + limit: Annotated[Optional[StrictStr], Field(description="(Optional) The number of items to return")] = None, + offset: Annotated[Optional[StrictStr], Field(description="(Optional) The offset in the list of item to return")] = None, + order: Annotated[Optional[StrictStr], Field(description="(Optional) Sorts the list in the ascending or the descending order")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -582,7 +549,7 @@ def list_regional_deployment_events_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._list_regional_deployment_events_serialize( regional_deployment_id=regional_deployment_id, @@ -593,23 +560,25 @@ def list_regional_deployment_events_without_preload_content( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ListRegionalDeploymentEventsReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "ListRegionalDeploymentEventsReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) return response_data.response + def _list_regional_deployment_events_serialize( self, regional_deployment_id, @@ -626,7 +595,7 @@ def _list_regional_deployment_events_serialize( _host = None _collection_formats: Dict[str, str] = { - "types": "multi", + 'types': 'multi', } _path_params: Dict[str, str] = {} @@ -641,39 +610,47 @@ def _list_regional_deployment_events_serialize( # process the path parameters # process the query parameters if regional_deployment_id is not None: - - _query_params.append(("regional_deployment_id", regional_deployment_id)) - + + _query_params.append(('regional_deployment_id', regional_deployment_id)) + if types is not None: - - _query_params.append(("types", types)) - + + _query_params.append(('types', types)) + if limit is not None: - - _query_params.append(("limit", limit)) - + + _query_params.append(('limit', limit)) + if offset is not None: - - _query_params.append(("offset", offset)) - + + _query_params.append(('offset', offset)) + if order is not None: - - _query_params.append(("order", order)) - + + _query_params.append(('order', order)) + # process the header parameters # process the form parameters # process the body parameter + # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept(["*/*"]) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + '*/*' + ] + ) + # authentication setting - _auth_settings: List[str] = ["Bearer"] + _auth_settings: List[str] = [ + 'Bearer' + ] return self.api_client.param_serialize( - method="GET", - resource_path="/v1/regional_deployment_events", + method='GET', + resource_path='/v1/regional_deployment_events', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -683,29 +660,25 @@ def _list_regional_deployment_events_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth, + _request_auth=_request_auth ) + + + @validate_call def list_regional_deployments( self, - deployment_id: Annotated[ - Optional[StrictStr], Field(description="(Optional) Filter on deployment id") - ] = None, - limit: Annotated[ - Optional[StrictStr], - Field(description="(Optional) The number of items to return"), - ] = None, - offset: Annotated[ - Optional[StrictStr], - Field(description="(Optional) The offset in the list of item to return"), - ] = None, + deployment_id: Annotated[Optional[StrictStr], Field(description="(Optional) Filter on deployment id")] = None, + limit: Annotated[Optional[StrictStr], Field(description="(Optional) The number of items to return")] = None, + offset: Annotated[Optional[StrictStr], Field(description="(Optional) The offset in the list of item to return")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -742,7 +715,7 @@ def list_regional_deployments( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._list_regional_deployments_serialize( deployment_id=deployment_id, @@ -751,20 +724,21 @@ def list_regional_deployments( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ListRegionalDeploymentsReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "ListRegionalDeploymentsReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -772,26 +746,20 @@ def list_regional_deployments( response_types_map=_response_types_map, ).data + @validate_call def list_regional_deployments_with_http_info( self, - deployment_id: Annotated[ - Optional[StrictStr], Field(description="(Optional) Filter on deployment id") - ] = None, - limit: Annotated[ - Optional[StrictStr], - Field(description="(Optional) The number of items to return"), - ] = None, - offset: Annotated[ - Optional[StrictStr], - Field(description="(Optional) The offset in the list of item to return"), - ] = None, + deployment_id: Annotated[Optional[StrictStr], Field(description="(Optional) Filter on deployment id")] = None, + limit: Annotated[Optional[StrictStr], Field(description="(Optional) The number of items to return")] = None, + offset: Annotated[Optional[StrictStr], Field(description="(Optional) The offset in the list of item to return")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -828,7 +796,7 @@ def list_regional_deployments_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._list_regional_deployments_serialize( deployment_id=deployment_id, @@ -837,20 +805,21 @@ def list_regional_deployments_with_http_info( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ListRegionalDeploymentsReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "ListRegionalDeploymentsReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -858,26 +827,20 @@ def list_regional_deployments_with_http_info( response_types_map=_response_types_map, ) + @validate_call def list_regional_deployments_without_preload_content( self, - deployment_id: Annotated[ - Optional[StrictStr], Field(description="(Optional) Filter on deployment id") - ] = None, - limit: Annotated[ - Optional[StrictStr], - Field(description="(Optional) The number of items to return"), - ] = None, - offset: Annotated[ - Optional[StrictStr], - Field(description="(Optional) The offset in the list of item to return"), - ] = None, + deployment_id: Annotated[Optional[StrictStr], Field(description="(Optional) Filter on deployment id")] = None, + limit: Annotated[Optional[StrictStr], Field(description="(Optional) The number of items to return")] = None, + offset: Annotated[Optional[StrictStr], Field(description="(Optional) The offset in the list of item to return")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -914,7 +877,7 @@ def list_regional_deployments_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._list_regional_deployments_serialize( deployment_id=deployment_id, @@ -923,23 +886,25 @@ def list_regional_deployments_without_preload_content( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ListRegionalDeploymentsReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "ListRegionalDeploymentsReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) return response_data.response + def _list_regional_deployments_serialize( self, deployment_id, @@ -953,7 +918,8 @@ def _list_regional_deployments_serialize( _host = None - _collection_formats: Dict[str, str] = {} + _collection_formats: Dict[str, str] = { + } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -967,31 +933,39 @@ def _list_regional_deployments_serialize( # process the path parameters # process the query parameters if deployment_id is not None: - - _query_params.append(("deployment_id", deployment_id)) - + + _query_params.append(('deployment_id', deployment_id)) + if limit is not None: - - _query_params.append(("limit", limit)) - + + _query_params.append(('limit', limit)) + if offset is not None: - - _query_params.append(("offset", offset)) - + + _query_params.append(('offset', offset)) + # process the header parameters # process the form parameters # process the body parameter + # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept(["*/*"]) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + '*/*' + ] + ) + # authentication setting - _auth_settings: List[str] = ["Bearer"] + _auth_settings: List[str] = [ + 'Bearer' + ] return self.api_client.param_serialize( - method="GET", - resource_path="/v1/regional_deployments", + method='GET', + resource_path='/v1/regional_deployments', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -1001,5 +975,7 @@ def _list_regional_deployments_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth, + _request_auth=_request_auth ) + + diff --git a/koyeb/api/api/repositories_api.py b/koyeb/api/api/repositories_api.py index b667ef8e..618e40c2 100644 --- a/koyeb/api/api/repositories_api.py +++ b/koyeb/api/api/repositories_api.py @@ -1,16 +1,15 @@ -# coding: utf-8 - """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 + import warnings from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt from typing import Any, Dict, List, Optional, Tuple, Union @@ -20,9 +19,7 @@ from typing import Any, Dict, Optional from typing_extensions import Annotated from koyeb.api.models.kgitproxy_list_branches_reply import KgitproxyListBranchesReply -from koyeb.api.models.kgitproxy_list_repositories_reply import ( - KgitproxyListRepositoriesReply, -) +from koyeb.api.models.kgitproxy_list_repositories_reply import KgitproxyListRepositoriesReply from koyeb.api.api_client import ApiClient, RequestSerialized from koyeb.api.api_response import ApiResponse @@ -41,33 +38,21 @@ def __init__(self, api_client=None) -> None: api_client = ApiClient.get_default() self.api_client = api_client + @validate_call def list_branches( self, - repository_id: Annotated[ - Optional[StrictStr], - Field(description="(Optional) Filter on one repository."), - ] = None, - name: Annotated[ - Optional[StrictStr], - Field( - description="(Optional) Filter on branch name using a fuzzy search. Repository filter is required to enable this filter." - ), - ] = None, - limit: Annotated[ - Optional[StrictStr], - Field(description="(Optional) The number of items to return."), - ] = None, - offset: Annotated[ - Optional[StrictStr], - Field(description="(Optional) The offset in the list of item to return."), - ] = None, + repository_id: Annotated[Optional[StrictStr], Field(description="(Optional) Filter on one repository.")] = None, + name: Annotated[Optional[StrictStr], Field(description="(Optional) Filter on branch name using a fuzzy search. Repository filter is required to enable this filter.")] = None, + limit: Annotated[Optional[StrictStr], Field(description="(Optional) The number of items to return.")] = None, + offset: Annotated[Optional[StrictStr], Field(description="(Optional) The offset in the list of item to return.")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -105,7 +90,7 @@ def list_branches( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._list_branches_serialize( repository_id=repository_id, @@ -115,20 +100,21 @@ def list_branches( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "KgitproxyListBranchesReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "KgitproxyListBranchesReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -136,33 +122,21 @@ def list_branches( response_types_map=_response_types_map, ).data + @validate_call def list_branches_with_http_info( self, - repository_id: Annotated[ - Optional[StrictStr], - Field(description="(Optional) Filter on one repository."), - ] = None, - name: Annotated[ - Optional[StrictStr], - Field( - description="(Optional) Filter on branch name using a fuzzy search. Repository filter is required to enable this filter." - ), - ] = None, - limit: Annotated[ - Optional[StrictStr], - Field(description="(Optional) The number of items to return."), - ] = None, - offset: Annotated[ - Optional[StrictStr], - Field(description="(Optional) The offset in the list of item to return."), - ] = None, + repository_id: Annotated[Optional[StrictStr], Field(description="(Optional) Filter on one repository.")] = None, + name: Annotated[Optional[StrictStr], Field(description="(Optional) Filter on branch name using a fuzzy search. Repository filter is required to enable this filter.")] = None, + limit: Annotated[Optional[StrictStr], Field(description="(Optional) The number of items to return.")] = None, + offset: Annotated[Optional[StrictStr], Field(description="(Optional) The offset in the list of item to return.")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -200,7 +174,7 @@ def list_branches_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._list_branches_serialize( repository_id=repository_id, @@ -210,20 +184,21 @@ def list_branches_with_http_info( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "KgitproxyListBranchesReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "KgitproxyListBranchesReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -231,33 +206,21 @@ def list_branches_with_http_info( response_types_map=_response_types_map, ) + @validate_call def list_branches_without_preload_content( self, - repository_id: Annotated[ - Optional[StrictStr], - Field(description="(Optional) Filter on one repository."), - ] = None, - name: Annotated[ - Optional[StrictStr], - Field( - description="(Optional) Filter on branch name using a fuzzy search. Repository filter is required to enable this filter." - ), - ] = None, - limit: Annotated[ - Optional[StrictStr], - Field(description="(Optional) The number of items to return."), - ] = None, - offset: Annotated[ - Optional[StrictStr], - Field(description="(Optional) The offset in the list of item to return."), - ] = None, + repository_id: Annotated[Optional[StrictStr], Field(description="(Optional) Filter on one repository.")] = None, + name: Annotated[Optional[StrictStr], Field(description="(Optional) Filter on branch name using a fuzzy search. Repository filter is required to enable this filter.")] = None, + limit: Annotated[Optional[StrictStr], Field(description="(Optional) The number of items to return.")] = None, + offset: Annotated[Optional[StrictStr], Field(description="(Optional) The offset in the list of item to return.")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -295,7 +258,7 @@ def list_branches_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._list_branches_serialize( repository_id=repository_id, @@ -305,23 +268,25 @@ def list_branches_without_preload_content( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "KgitproxyListBranchesReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "KgitproxyListBranchesReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) return response_data.response + def _list_branches_serialize( self, repository_id, @@ -336,7 +301,8 @@ def _list_branches_serialize( _host = None - _collection_formats: Dict[str, str] = {} + _collection_formats: Dict[str, str] = { + } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -350,35 +316,43 @@ def _list_branches_serialize( # process the path parameters # process the query parameters if repository_id is not None: - - _query_params.append(("repository_id", repository_id)) - + + _query_params.append(('repository_id', repository_id)) + if name is not None: - - _query_params.append(("name", name)) - + + _query_params.append(('name', name)) + if limit is not None: - - _query_params.append(("limit", limit)) - + + _query_params.append(('limit', limit)) + if offset is not None: - - _query_params.append(("offset", offset)) - + + _query_params.append(('offset', offset)) + # process the header parameters # process the form parameters # process the body parameter + # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept(["*/*"]) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + '*/*' + ] + ) + # authentication setting - _auth_settings: List[str] = ["Bearer"] + _auth_settings: List[str] = [ + 'Bearer' + ] return self.api_client.param_serialize( - method="GET", - resource_path="/v1/git/branches", + method='GET', + resource_path='/v1/git/branches', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -388,38 +362,26 @@ def _list_branches_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth, + _request_auth=_request_auth ) + + + @validate_call def list_repositories( self, - name: Annotated[ - Optional[StrictStr], - Field( - description="(Optional) Filter on repository name using a fuzzy search." - ), - ] = None, - name_search_op: Annotated[ - Optional[StrictStr], - Field( - description='(Optional) Define search operation for repository name. Accept either "fuzzy" or "equality", use "fuzzy" by default.' - ), - ] = None, - limit: Annotated[ - Optional[StrictStr], - Field(description="(Optional) The number of items to return."), - ] = None, - offset: Annotated[ - Optional[StrictStr], - Field(description="(Optional) The offset in the list of item to return."), - ] = None, + name: Annotated[Optional[StrictStr], Field(description="(Optional) Filter on repository name using a fuzzy search.")] = None, + name_search_op: Annotated[Optional[StrictStr], Field(description="(Optional) Define search operation for repository name. Accept either \"fuzzy\" or \"equality\", use \"fuzzy\" by default.")] = None, + limit: Annotated[Optional[StrictStr], Field(description="(Optional) The number of items to return.")] = None, + offset: Annotated[Optional[StrictStr], Field(description="(Optional) The offset in the list of item to return.")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -457,7 +419,7 @@ def list_repositories( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._list_repositories_serialize( name=name, @@ -467,20 +429,21 @@ def list_repositories( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "KgitproxyListRepositoriesReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "KgitproxyListRepositoriesReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -488,35 +451,21 @@ def list_repositories( response_types_map=_response_types_map, ).data + @validate_call def list_repositories_with_http_info( self, - name: Annotated[ - Optional[StrictStr], - Field( - description="(Optional) Filter on repository name using a fuzzy search." - ), - ] = None, - name_search_op: Annotated[ - Optional[StrictStr], - Field( - description='(Optional) Define search operation for repository name. Accept either "fuzzy" or "equality", use "fuzzy" by default.' - ), - ] = None, - limit: Annotated[ - Optional[StrictStr], - Field(description="(Optional) The number of items to return."), - ] = None, - offset: Annotated[ - Optional[StrictStr], - Field(description="(Optional) The offset in the list of item to return."), - ] = None, + name: Annotated[Optional[StrictStr], Field(description="(Optional) Filter on repository name using a fuzzy search.")] = None, + name_search_op: Annotated[Optional[StrictStr], Field(description="(Optional) Define search operation for repository name. Accept either \"fuzzy\" or \"equality\", use \"fuzzy\" by default.")] = None, + limit: Annotated[Optional[StrictStr], Field(description="(Optional) The number of items to return.")] = None, + offset: Annotated[Optional[StrictStr], Field(description="(Optional) The offset in the list of item to return.")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -554,7 +503,7 @@ def list_repositories_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._list_repositories_serialize( name=name, @@ -564,20 +513,21 @@ def list_repositories_with_http_info( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "KgitproxyListRepositoriesReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "KgitproxyListRepositoriesReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -585,35 +535,21 @@ def list_repositories_with_http_info( response_types_map=_response_types_map, ) + @validate_call def list_repositories_without_preload_content( self, - name: Annotated[ - Optional[StrictStr], - Field( - description="(Optional) Filter on repository name using a fuzzy search." - ), - ] = None, - name_search_op: Annotated[ - Optional[StrictStr], - Field( - description='(Optional) Define search operation for repository name. Accept either "fuzzy" or "equality", use "fuzzy" by default.' - ), - ] = None, - limit: Annotated[ - Optional[StrictStr], - Field(description="(Optional) The number of items to return."), - ] = None, - offset: Annotated[ - Optional[StrictStr], - Field(description="(Optional) The offset in the list of item to return."), - ] = None, + name: Annotated[Optional[StrictStr], Field(description="(Optional) Filter on repository name using a fuzzy search.")] = None, + name_search_op: Annotated[Optional[StrictStr], Field(description="(Optional) Define search operation for repository name. Accept either \"fuzzy\" or \"equality\", use \"fuzzy\" by default.")] = None, + limit: Annotated[Optional[StrictStr], Field(description="(Optional) The number of items to return.")] = None, + offset: Annotated[Optional[StrictStr], Field(description="(Optional) The offset in the list of item to return.")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -651,7 +587,7 @@ def list_repositories_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._list_repositories_serialize( name=name, @@ -661,23 +597,25 @@ def list_repositories_without_preload_content( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "KgitproxyListRepositoriesReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "KgitproxyListRepositoriesReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) return response_data.response + def _list_repositories_serialize( self, name, @@ -692,7 +630,8 @@ def _list_repositories_serialize( _host = None - _collection_formats: Dict[str, str] = {} + _collection_formats: Dict[str, str] = { + } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -706,35 +645,43 @@ def _list_repositories_serialize( # process the path parameters # process the query parameters if name is not None: - - _query_params.append(("name", name)) - + + _query_params.append(('name', name)) + if name_search_op is not None: - - _query_params.append(("name_search_op", name_search_op)) - + + _query_params.append(('name_search_op', name_search_op)) + if limit is not None: - - _query_params.append(("limit", limit)) - + + _query_params.append(('limit', limit)) + if offset is not None: - - _query_params.append(("offset", offset)) - + + _query_params.append(('offset', offset)) + # process the header parameters # process the form parameters # process the body parameter + # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept(["*/*"]) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + '*/*' + ] + ) + # authentication setting - _auth_settings: List[str] = ["Bearer"] + _auth_settings: List[str] = [ + 'Bearer' + ] return self.api_client.param_serialize( - method="GET", - resource_path="/v1/git/repositories", + method='GET', + resource_path='/v1/git/repositories', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -744,9 +691,12 @@ def _list_repositories_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth, + _request_auth=_request_auth ) + + + @validate_call def resync_organization( self, @@ -755,8 +705,9 @@ def resync_organization( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -788,27 +739,28 @@ def resync_organization( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._resync_organization_serialize( organization_id=organization_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "object", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "object", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -816,6 +768,7 @@ def resync_organization( response_types_map=_response_types_map, ).data + @validate_call def resync_organization_with_http_info( self, @@ -824,8 +777,9 @@ def resync_organization_with_http_info( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -857,27 +811,28 @@ def resync_organization_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._resync_organization_serialize( organization_id=organization_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "object", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "object", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -885,6 +840,7 @@ def resync_organization_with_http_info( response_types_map=_response_types_map, ) + @validate_call def resync_organization_without_preload_content( self, @@ -893,8 +849,9 @@ def resync_organization_without_preload_content( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -926,30 +883,32 @@ def resync_organization_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._resync_organization_serialize( organization_id=organization_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "object", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "object", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) return response_data.response + def _resync_organization_serialize( self, organization_id, @@ -961,7 +920,8 @@ def _resync_organization_serialize( _host = None - _collection_formats: Dict[str, str] = {} + _collection_formats: Dict[str, str] = { + } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -974,22 +934,30 @@ def _resync_organization_serialize( # process the path parameters if organization_id is not None: - _path_params["organization_id"] = organization_id + _path_params['organization_id'] = organization_id # process the query parameters # process the header parameters # process the form parameters # process the body parameter + # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept(["*/*"]) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + '*/*' + ] + ) + # authentication setting - _auth_settings: List[str] = ["Bearer"] + _auth_settings: List[str] = [ + 'Bearer' + ] return self.api_client.param_serialize( - method="POST", - resource_path="/v1/git/sync/organization/{organization_id}", + method='POST', + resource_path='/v1/git/sync/organization/{organization_id}', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -999,5 +967,7 @@ def _resync_organization_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth, + _request_auth=_request_auth ) + + diff --git a/koyeb/api/api/search_api.py b/koyeb/api/api/search_api.py index e38d827b..be968da5 100644 --- a/koyeb/api/api/search_api.py +++ b/koyeb/api/api/search_api.py @@ -1,16 +1,15 @@ -# coding: utf-8 - """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 + import warnings from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt from typing import Any, Dict, List, Optional, Tuple, Union @@ -38,18 +37,18 @@ def __init__(self, api_client=None) -> None: api_client = ApiClient.get_default() self.api_client = api_client + @validate_call def search( self, - query: Annotated[ - Optional[StrictStr], Field(description="(Optional) Search query") - ] = None, + query: Annotated[Optional[StrictStr], Field(description="(Optional) Search query")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -81,27 +80,28 @@ def search( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._search_serialize( query=query, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "KsearchSearchReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "KsearchSearchReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -109,18 +109,18 @@ def search( response_types_map=_response_types_map, ).data + @validate_call def search_with_http_info( self, - query: Annotated[ - Optional[StrictStr], Field(description="(Optional) Search query") - ] = None, + query: Annotated[Optional[StrictStr], Field(description="(Optional) Search query")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -152,27 +152,28 @@ def search_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._search_serialize( query=query, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "KsearchSearchReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "KsearchSearchReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -180,18 +181,18 @@ def search_with_http_info( response_types_map=_response_types_map, ) + @validate_call def search_without_preload_content( self, - query: Annotated[ - Optional[StrictStr], Field(description="(Optional) Search query") - ] = None, + query: Annotated[Optional[StrictStr], Field(description="(Optional) Search query")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -223,30 +224,32 @@ def search_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._search_serialize( query=query, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "KsearchSearchReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "KsearchSearchReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) return response_data.response + def _search_serialize( self, query, @@ -258,7 +261,8 @@ def _search_serialize( _host = None - _collection_formats: Dict[str, str] = {} + _collection_formats: Dict[str, str] = { + } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -272,23 +276,31 @@ def _search_serialize( # process the path parameters # process the query parameters if query is not None: - - _query_params.append(("query", query)) - + + _query_params.append(('query', query)) + # process the header parameters # process the form parameters # process the body parameter + # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept(["*/*"]) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + '*/*' + ] + ) + # authentication setting - _auth_settings: List[str] = ["Bearer"] + _auth_settings: List[str] = [ + 'Bearer' + ] return self.api_client.param_serialize( - method="GET", - resource_path="/v1/search", + method='GET', + resource_path='/v1/search', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -298,5 +310,7 @@ def _search_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth, + _request_auth=_request_auth ) + + diff --git a/koyeb/api/api/secrets_api.py b/koyeb/api/api/secrets_api.py index 1607f36c..5a8aa506 100644 --- a/koyeb/api/api/secrets_api.py +++ b/koyeb/api/api/secrets_api.py @@ -1,16 +1,15 @@ -# coding: utf-8 - """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 + import warnings from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt from typing import Any, Dict, List, Optional, Tuple, Union @@ -44,6 +43,7 @@ def __init__(self, api_client=None) -> None: api_client = ApiClient.get_default() self.api_client = api_client + @validate_call def create_secret( self, @@ -52,8 +52,9 @@ def create_secret( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -85,27 +86,28 @@ def create_secret( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._create_secret_serialize( secret=secret, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "CreateSecretReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "CreateSecretReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -113,6 +115,7 @@ def create_secret( response_types_map=_response_types_map, ).data + @validate_call def create_secret_with_http_info( self, @@ -121,8 +124,9 @@ def create_secret_with_http_info( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -154,27 +158,28 @@ def create_secret_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._create_secret_serialize( secret=secret, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "CreateSecretReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "CreateSecretReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -182,6 +187,7 @@ def create_secret_with_http_info( response_types_map=_response_types_map, ) + @validate_call def create_secret_without_preload_content( self, @@ -190,8 +196,9 @@ def create_secret_without_preload_content( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -223,30 +230,32 @@ def create_secret_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._create_secret_serialize( secret=secret, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "CreateSecretReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "CreateSecretReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) return response_data.response + def _create_secret_serialize( self, secret, @@ -258,7 +267,8 @@ def _create_secret_serialize( _host = None - _collection_formats: Dict[str, str] = {} + _collection_formats: Dict[str, str] = { + } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -277,16 +287,24 @@ def _create_secret_serialize( if secret is not None: _body_params = secret + # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept(["*/*"]) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + '*/*' + ] + ) + # authentication setting - _auth_settings: List[str] = ["Bearer"] + _auth_settings: List[str] = [ + 'Bearer' + ] return self.api_client.param_serialize( - method="POST", - resource_path="/v1/secrets", + method='POST', + resource_path='/v1/secrets', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -296,9 +314,12 @@ def _create_secret_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth, + _request_auth=_request_auth ) + + + @validate_call def delete_secret( self, @@ -307,8 +328,9 @@ def delete_secret( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -340,27 +362,28 @@ def delete_secret( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._delete_secret_serialize( id=id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "object", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "object", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -368,6 +391,7 @@ def delete_secret( response_types_map=_response_types_map, ).data + @validate_call def delete_secret_with_http_info( self, @@ -376,8 +400,9 @@ def delete_secret_with_http_info( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -409,27 +434,28 @@ def delete_secret_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._delete_secret_serialize( id=id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "object", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "object", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -437,6 +463,7 @@ def delete_secret_with_http_info( response_types_map=_response_types_map, ) + @validate_call def delete_secret_without_preload_content( self, @@ -445,8 +472,9 @@ def delete_secret_without_preload_content( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -478,30 +506,32 @@ def delete_secret_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._delete_secret_serialize( id=id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "object", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "object", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) return response_data.response + def _delete_secret_serialize( self, id, @@ -513,7 +543,8 @@ def _delete_secret_serialize( _host = None - _collection_formats: Dict[str, str] = {} + _collection_formats: Dict[str, str] = { + } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -526,22 +557,30 @@ def _delete_secret_serialize( # process the path parameters if id is not None: - _path_params["id"] = id + _path_params['id'] = id # process the query parameters # process the header parameters # process the form parameters # process the body parameter + # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept(["*/*"]) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + '*/*' + ] + ) + # authentication setting - _auth_settings: List[str] = ["Bearer"] + _auth_settings: List[str] = [ + 'Bearer' + ] return self.api_client.param_serialize( - method="DELETE", - resource_path="/v1/secrets/{id}", + method='DELETE', + resource_path='/v1/secrets/{id}', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -551,9 +590,12 @@ def _delete_secret_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth, + _request_auth=_request_auth ) + + + @validate_call def get_secret( self, @@ -562,8 +604,9 @@ def get_secret( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -595,27 +638,28 @@ def get_secret( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._get_secret_serialize( id=id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "GetSecretReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "GetSecretReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -623,6 +667,7 @@ def get_secret( response_types_map=_response_types_map, ).data + @validate_call def get_secret_with_http_info( self, @@ -631,8 +676,9 @@ def get_secret_with_http_info( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -664,27 +710,28 @@ def get_secret_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._get_secret_serialize( id=id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "GetSecretReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "GetSecretReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -692,6 +739,7 @@ def get_secret_with_http_info( response_types_map=_response_types_map, ) + @validate_call def get_secret_without_preload_content( self, @@ -700,8 +748,9 @@ def get_secret_without_preload_content( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -733,30 +782,32 @@ def get_secret_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._get_secret_serialize( id=id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "GetSecretReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "GetSecretReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) return response_data.response + def _get_secret_serialize( self, id, @@ -768,7 +819,8 @@ def _get_secret_serialize( _host = None - _collection_formats: Dict[str, str] = {} + _collection_formats: Dict[str, str] = { + } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -781,22 +833,30 @@ def _get_secret_serialize( # process the path parameters if id is not None: - _path_params["id"] = id + _path_params['id'] = id # process the query parameters # process the header parameters # process the form parameters # process the body parameter + # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept(["*/*"]) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + '*/*' + ] + ) + # authentication setting - _auth_settings: List[str] = ["Bearer"] + _auth_settings: List[str] = [ + 'Bearer' + ] return self.api_client.param_serialize( - method="GET", - resource_path="/v1/secrets/{id}", + method='GET', + resource_path='/v1/secrets/{id}', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -806,24 +866,27 @@ def _get_secret_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth, + _request_auth=_request_auth ) + + + @validate_call def list_secrets( self, name: Optional[StrictStr] = None, limit: Optional[StrictStr] = None, offset: Optional[StrictStr] = None, - types: Annotated[ - Optional[List[StrictStr]], Field(description="Filter by secret types") - ] = None, + types: Annotated[Optional[List[StrictStr]], Field(description="Filter by secret types")] = None, + project_id: Annotated[Optional[StrictStr], Field(description="(Optional) A filter for the project ID")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -841,6 +904,8 @@ def list_secrets( :type offset: str :param types: Filter by secret types :type types: List[str] + :param project_id: (Optional) A filter for the project ID + :type project_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -861,30 +926,32 @@ def list_secrets( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._list_secrets_serialize( name=name, limit=limit, offset=offset, types=types, + project_id=project_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ListSecretsReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "ListSecretsReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -892,21 +959,22 @@ def list_secrets( response_types_map=_response_types_map, ).data + @validate_call def list_secrets_with_http_info( self, name: Optional[StrictStr] = None, limit: Optional[StrictStr] = None, offset: Optional[StrictStr] = None, - types: Annotated[ - Optional[List[StrictStr]], Field(description="Filter by secret types") - ] = None, + types: Annotated[Optional[List[StrictStr]], Field(description="Filter by secret types")] = None, + project_id: Annotated[Optional[StrictStr], Field(description="(Optional) A filter for the project ID")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -924,6 +992,8 @@ def list_secrets_with_http_info( :type offset: str :param types: Filter by secret types :type types: List[str] + :param project_id: (Optional) A filter for the project ID + :type project_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -944,30 +1014,32 @@ def list_secrets_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._list_secrets_serialize( name=name, limit=limit, offset=offset, types=types, + project_id=project_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ListSecretsReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "ListSecretsReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -975,21 +1047,22 @@ def list_secrets_with_http_info( response_types_map=_response_types_map, ) + @validate_call def list_secrets_without_preload_content( self, name: Optional[StrictStr] = None, limit: Optional[StrictStr] = None, offset: Optional[StrictStr] = None, - types: Annotated[ - Optional[List[StrictStr]], Field(description="Filter by secret types") - ] = None, + types: Annotated[Optional[List[StrictStr]], Field(description="Filter by secret types")] = None, + project_id: Annotated[Optional[StrictStr], Field(description="(Optional) A filter for the project ID")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -1007,6 +1080,8 @@ def list_secrets_without_preload_content( :type offset: str :param types: Filter by secret types :type types: List[str] + :param project_id: (Optional) A filter for the project ID + :type project_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -1027,39 +1102,43 @@ def list_secrets_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._list_secrets_serialize( name=name, limit=limit, offset=offset, types=types, + project_id=project_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ListSecretsReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "ListSecretsReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) return response_data.response + def _list_secrets_serialize( self, name, limit, offset, types, + project_id, _request_auth, _content_type, _headers, @@ -1069,7 +1148,7 @@ def _list_secrets_serialize( _host = None _collection_formats: Dict[str, str] = { - "types": "multi", + 'types': 'multi', } _path_params: Dict[str, str] = {} @@ -1084,35 +1163,47 @@ def _list_secrets_serialize( # process the path parameters # process the query parameters if name is not None: - - _query_params.append(("name", name)) - + + _query_params.append(('name', name)) + if limit is not None: - - _query_params.append(("limit", limit)) - + + _query_params.append(('limit', limit)) + if offset is not None: - - _query_params.append(("offset", offset)) - + + _query_params.append(('offset', offset)) + if types is not None: - - _query_params.append(("types", types)) - + + _query_params.append(('types', types)) + + if project_id is not None: + + _query_params.append(('project_id', project_id)) + # process the header parameters # process the form parameters # process the body parameter + # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept(["*/*"]) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + '*/*' + ] + ) + # authentication setting - _auth_settings: List[str] = ["Bearer"] + _auth_settings: List[str] = [ + 'Bearer' + ] return self.api_client.param_serialize( - method="GET", - resource_path="/v1/secrets", + method='GET', + resource_path='/v1/secrets', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -1122,9 +1213,12 @@ def _list_secrets_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth, + _request_auth=_request_auth ) + + + @validate_call def reveal_secret( self, @@ -1134,8 +1228,9 @@ def reveal_secret( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -1169,7 +1264,7 @@ def reveal_secret( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._reveal_secret_serialize( id=id, @@ -1177,20 +1272,21 @@ def reveal_secret( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "RevealSecretReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "RevealSecretReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -1198,6 +1294,7 @@ def reveal_secret( response_types_map=_response_types_map, ).data + @validate_call def reveal_secret_with_http_info( self, @@ -1207,8 +1304,9 @@ def reveal_secret_with_http_info( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -1242,7 +1340,7 @@ def reveal_secret_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._reveal_secret_serialize( id=id, @@ -1250,20 +1348,21 @@ def reveal_secret_with_http_info( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "RevealSecretReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "RevealSecretReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -1271,6 +1370,7 @@ def reveal_secret_with_http_info( response_types_map=_response_types_map, ) + @validate_call def reveal_secret_without_preload_content( self, @@ -1280,8 +1380,9 @@ def reveal_secret_without_preload_content( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -1315,7 +1416,7 @@ def reveal_secret_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._reveal_secret_serialize( id=id, @@ -1323,23 +1424,25 @@ def reveal_secret_without_preload_content( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "RevealSecretReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "RevealSecretReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) return response_data.response + def _reveal_secret_serialize( self, id, @@ -1352,7 +1455,8 @@ def _reveal_secret_serialize( _host = None - _collection_formats: Dict[str, str] = {} + _collection_formats: Dict[str, str] = { + } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -1365,7 +1469,7 @@ def _reveal_secret_serialize( # process the path parameters if id is not None: - _path_params["id"] = id + _path_params['id'] = id # process the query parameters # process the header parameters # process the form parameters @@ -1373,16 +1477,24 @@ def _reveal_secret_serialize( if body is not None: _body_params = body + # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept(["*/*"]) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + '*/*' + ] + ) + # authentication setting - _auth_settings: List[str] = ["Bearer"] + _auth_settings: List[str] = [ + 'Bearer' + ] return self.api_client.param_serialize( - method="POST", - resource_path="/v1/secrets/{id}/reveal", + method='POST', + resource_path='/v1/secrets/{id}/reveal', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -1392,9 +1504,12 @@ def _reveal_secret_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth, + _request_auth=_request_auth ) + + + @validate_call def update_secret( self, @@ -1405,8 +1520,9 @@ def update_secret( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -1442,7 +1558,7 @@ def update_secret( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._update_secret_serialize( id=id, @@ -1451,20 +1567,21 @@ def update_secret( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "UpdateSecretReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "UpdateSecretReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -1472,6 +1589,7 @@ def update_secret( response_types_map=_response_types_map, ).data + @validate_call def update_secret_with_http_info( self, @@ -1482,8 +1600,9 @@ def update_secret_with_http_info( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -1519,7 +1638,7 @@ def update_secret_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._update_secret_serialize( id=id, @@ -1528,20 +1647,21 @@ def update_secret_with_http_info( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "UpdateSecretReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "UpdateSecretReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -1549,6 +1669,7 @@ def update_secret_with_http_info( response_types_map=_response_types_map, ) + @validate_call def update_secret_without_preload_content( self, @@ -1559,8 +1680,9 @@ def update_secret_without_preload_content( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -1596,7 +1718,7 @@ def update_secret_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._update_secret_serialize( id=id, @@ -1605,23 +1727,25 @@ def update_secret_without_preload_content( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "UpdateSecretReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "UpdateSecretReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) return response_data.response + def _update_secret_serialize( self, id, @@ -1635,7 +1759,8 @@ def _update_secret_serialize( _host = None - _collection_formats: Dict[str, str] = {} + _collection_formats: Dict[str, str] = { + } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -1648,28 +1773,36 @@ def _update_secret_serialize( # process the path parameters if id is not None: - _path_params["id"] = id + _path_params['id'] = id # process the query parameters if update_mask is not None: - - _query_params.append(("update_mask", update_mask)) - + + _query_params.append(('update_mask', update_mask)) + # process the header parameters # process the form parameters # process the body parameter if secret is not None: _body_params = secret + # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept(["*/*"]) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + '*/*' + ] + ) + # authentication setting - _auth_settings: List[str] = ["Bearer"] + _auth_settings: List[str] = [ + 'Bearer' + ] return self.api_client.param_serialize( - method="PUT", - resource_path="/v1/secrets/{id}", + method='PUT', + resource_path='/v1/secrets/{id}', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -1679,9 +1812,12 @@ def _update_secret_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth, + _request_auth=_request_auth ) + + + @validate_call def update_secret2( self, @@ -1692,8 +1828,9 @@ def update_secret2( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -1729,7 +1866,7 @@ def update_secret2( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._update_secret2_serialize( id=id, @@ -1738,20 +1875,21 @@ def update_secret2( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "UpdateSecretReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "UpdateSecretReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -1759,6 +1897,7 @@ def update_secret2( response_types_map=_response_types_map, ).data + @validate_call def update_secret2_with_http_info( self, @@ -1769,8 +1908,9 @@ def update_secret2_with_http_info( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -1806,7 +1946,7 @@ def update_secret2_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._update_secret2_serialize( id=id, @@ -1815,20 +1955,21 @@ def update_secret2_with_http_info( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "UpdateSecretReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "UpdateSecretReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -1836,6 +1977,7 @@ def update_secret2_with_http_info( response_types_map=_response_types_map, ) + @validate_call def update_secret2_without_preload_content( self, @@ -1846,8 +1988,9 @@ def update_secret2_without_preload_content( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -1883,7 +2026,7 @@ def update_secret2_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._update_secret2_serialize( id=id, @@ -1892,23 +2035,25 @@ def update_secret2_without_preload_content( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "UpdateSecretReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "UpdateSecretReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) return response_data.response + def _update_secret2_serialize( self, id, @@ -1922,7 +2067,8 @@ def _update_secret2_serialize( _host = None - _collection_formats: Dict[str, str] = {} + _collection_formats: Dict[str, str] = { + } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -1935,28 +2081,36 @@ def _update_secret2_serialize( # process the path parameters if id is not None: - _path_params["id"] = id + _path_params['id'] = id # process the query parameters if update_mask is not None: - - _query_params.append(("update_mask", update_mask)) - + + _query_params.append(('update_mask', update_mask)) + # process the header parameters # process the form parameters # process the body parameter if secret is not None: _body_params = secret + # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept(["*/*"]) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + '*/*' + ] + ) + # authentication setting - _auth_settings: List[str] = ["Bearer"] + _auth_settings: List[str] = [ + 'Bearer' + ] return self.api_client.param_serialize( - method="PATCH", - resource_path="/v1/secrets/{id}", + method='PATCH', + resource_path='/v1/secrets/{id}', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -1966,5 +2120,7 @@ def _update_secret2_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth, + _request_auth=_request_auth ) + + diff --git a/koyeb/api/api/services_api.py b/koyeb/api/api/services_api.py index 7028ef40..b3220783 100644 --- a/koyeb/api/api/services_api.py +++ b/koyeb/api/api/services_api.py @@ -1,16 +1,15 @@ -# coding: utf-8 - """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 + import warnings from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt from typing import Any, Dict, List, Optional, Tuple, Union @@ -24,12 +23,14 @@ from koyeb.api.models.create_service import CreateService from koyeb.api.models.create_service_reply import CreateServiceReply from koyeb.api.models.get_service_reply import GetServiceReply +from koyeb.api.models.get_service_scaling_reply import GetServiceScalingReply from koyeb.api.models.list_service_events_reply import ListServiceEventsReply from koyeb.api.models.list_services_reply import ListServicesReply from koyeb.api.models.redeploy_reply import RedeployReply from koyeb.api.models.redeploy_request_info import RedeployRequestInfo from koyeb.api.models.update_service import UpdateService from koyeb.api.models.update_service_reply import UpdateServiceReply +from koyeb.api.models.update_service_scaling_request import UpdateServiceScalingRequest from koyeb.api.api_client import ApiClient, RequestSerialized from koyeb.api.api_response import ApiResponse @@ -48,6 +49,7 @@ def __init__(self, api_client=None) -> None: api_client = ApiClient.get_default() self.api_client = api_client + @validate_call def autocomplete( self, @@ -56,8 +58,9 @@ def autocomplete( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -90,27 +93,28 @@ def autocomplete( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._autocomplete_serialize( body=body, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "AutocompleteReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "AutocompleteReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -118,6 +122,7 @@ def autocomplete( response_types_map=_response_types_map, ).data + @validate_call def autocomplete_with_http_info( self, @@ -126,8 +131,9 @@ def autocomplete_with_http_info( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -160,27 +166,28 @@ def autocomplete_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._autocomplete_serialize( body=body, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "AutocompleteReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "AutocompleteReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -188,6 +195,7 @@ def autocomplete_with_http_info( response_types_map=_response_types_map, ) + @validate_call def autocomplete_without_preload_content( self, @@ -196,8 +204,9 @@ def autocomplete_without_preload_content( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -230,30 +239,32 @@ def autocomplete_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._autocomplete_serialize( body=body, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "AutocompleteReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "AutocompleteReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) return response_data.response + def _autocomplete_serialize( self, body, @@ -265,7 +276,8 @@ def _autocomplete_serialize( _host = None - _collection_formats: Dict[str, str] = {} + _collection_formats: Dict[str, str] = { + } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -284,16 +296,24 @@ def _autocomplete_serialize( if body is not None: _body_params = body + # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept(["*/*"]) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + '*/*' + ] + ) + # authentication setting - _auth_settings: List[str] = ["Bearer"] + _auth_settings: List[str] = [ + 'Bearer' + ] return self.api_client.param_serialize( - method="POST", - resource_path="/v1/services-autocomplete", + method='POST', + resource_path='/v1/services-autocomplete', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -303,22 +323,24 @@ def _autocomplete_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth, + _request_auth=_request_auth ) + + + @validate_call def create_service( self, service: CreateService, - dry_run: Annotated[ - Optional[StrictBool], Field(description="If set only run validation") - ] = None, + dry_run: Annotated[Optional[StrictBool], Field(description="If set only run validation")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -352,7 +374,7 @@ def create_service( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._create_service_serialize( service=service, @@ -360,20 +382,21 @@ def create_service( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "CreateServiceReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "CreateServiceReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -381,19 +404,19 @@ def create_service( response_types_map=_response_types_map, ).data + @validate_call def create_service_with_http_info( self, service: CreateService, - dry_run: Annotated[ - Optional[StrictBool], Field(description="If set only run validation") - ] = None, + dry_run: Annotated[Optional[StrictBool], Field(description="If set only run validation")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -427,7 +450,7 @@ def create_service_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._create_service_serialize( service=service, @@ -435,20 +458,21 @@ def create_service_with_http_info( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "CreateServiceReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "CreateServiceReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -456,19 +480,19 @@ def create_service_with_http_info( response_types_map=_response_types_map, ) + @validate_call def create_service_without_preload_content( self, service: CreateService, - dry_run: Annotated[ - Optional[StrictBool], Field(description="If set only run validation") - ] = None, + dry_run: Annotated[Optional[StrictBool], Field(description="If set only run validation")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -502,7 +526,7 @@ def create_service_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._create_service_serialize( service=service, @@ -510,23 +534,25 @@ def create_service_without_preload_content( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "CreateServiceReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "CreateServiceReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) return response_data.response + def _create_service_serialize( self, service, @@ -539,7 +565,8 @@ def _create_service_serialize( _host = None - _collection_formats: Dict[str, str] = {} + _collection_formats: Dict[str, str] = { + } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -553,25 +580,33 @@ def _create_service_serialize( # process the path parameters # process the query parameters if dry_run is not None: - - _query_params.append(("dry_run", dry_run)) - + + _query_params.append(('dry_run', dry_run)) + # process the header parameters # process the form parameters # process the body parameter if service is not None: _body_params = service + # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept(["*/*"]) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + '*/*' + ] + ) + # authentication setting - _auth_settings: List[str] = ["Bearer"] + _auth_settings: List[str] = [ + 'Bearer' + ] return self.api_client.param_serialize( - method="POST", - resource_path="/v1/services", + method='POST', + resource_path='/v1/services', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -581,9 +616,12 @@ def _create_service_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth, + _request_auth=_request_auth ) + + + @validate_call def delete_service( self, @@ -592,8 +630,9 @@ def delete_service( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -626,27 +665,28 @@ def delete_service( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._delete_service_serialize( id=id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "object", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "object", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -654,6 +694,7 @@ def delete_service( response_types_map=_response_types_map, ).data + @validate_call def delete_service_with_http_info( self, @@ -662,8 +703,9 @@ def delete_service_with_http_info( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -696,27 +738,28 @@ def delete_service_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._delete_service_serialize( id=id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "object", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "object", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -724,6 +767,7 @@ def delete_service_with_http_info( response_types_map=_response_types_map, ) + @validate_call def delete_service_without_preload_content( self, @@ -732,8 +776,9 @@ def delete_service_without_preload_content( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -766,30 +811,32 @@ def delete_service_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._delete_service_serialize( id=id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "object", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "object", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) return response_data.response + def _delete_service_serialize( self, id, @@ -801,7 +848,8 @@ def _delete_service_serialize( _host = None - _collection_formats: Dict[str, str] = {} + _collection_formats: Dict[str, str] = { + } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -814,22 +862,30 @@ def _delete_service_serialize( # process the path parameters if id is not None: - _path_params["id"] = id + _path_params['id'] = id # process the query parameters # process the header parameters # process the form parameters # process the body parameter + # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept(["*/*"]) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + '*/*' + ] + ) + # authentication setting - _auth_settings: List[str] = ["Bearer"] + _auth_settings: List[str] = [ + 'Bearer' + ] return self.api_client.param_serialize( - method="DELETE", - resource_path="/v1/services/{id}", + method='DELETE', + resource_path='/v1/services/{id}', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -839,29 +895,34 @@ def _delete_service_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth, + _request_auth=_request_auth ) + + + @validate_call - def get_service( + def delete_service_scaling( self, - id: Annotated[StrictStr, Field(description="The id of the Service")], + id: Annotated[StrictStr, Field(description="The id of the service")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> GetServiceReply: - """Get Service + ) -> object: + """Delete Service Scaling + Deletes the manual scaling configuration for a service, reverting to the scaling defined in the deployment definition. - :param id: The id of the Service (required) + :param id: The id of the service (required) :type id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request @@ -883,27 +944,28 @@ def get_service( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 - _param = self._get_service_serialize( + _param = self._delete_service_scaling_serialize( id=id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "GetServiceReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "object", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -911,26 +973,29 @@ def get_service( response_types_map=_response_types_map, ).data + @validate_call - def get_service_with_http_info( + def delete_service_scaling_with_http_info( self, - id: Annotated[StrictStr, Field(description="The id of the Service")], + id: Annotated[StrictStr, Field(description="The id of the service")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[GetServiceReply]: - """Get Service + ) -> ApiResponse[object]: + """Delete Service Scaling + Deletes the manual scaling configuration for a service, reverting to the scaling defined in the deployment definition. - :param id: The id of the Service (required) + :param id: The id of the service (required) :type id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request @@ -952,27 +1017,28 @@ def get_service_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 - _param = self._get_service_serialize( + _param = self._delete_service_scaling_serialize( id=id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "GetServiceReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "object", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -980,26 +1046,29 @@ def get_service_with_http_info( response_types_map=_response_types_map, ) + @validate_call - def get_service_without_preload_content( + def delete_service_scaling_without_preload_content( self, - id: Annotated[StrictStr, Field(description="The id of the Service")], + id: Annotated[StrictStr, Field(description="The id of the service")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Get Service + """Delete Service Scaling + Deletes the manual scaling configuration for a service, reverting to the scaling defined in the deployment definition. - :param id: The id of the Service (required) + :param id: The id of the service (required) :type id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request @@ -1021,31 +1090,33 @@ def get_service_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 - _param = self._get_service_serialize( + _param = self._delete_service_scaling_serialize( id=id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "GetServiceReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "object", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) return response_data.response - def _get_service_serialize( + + def _delete_service_scaling_serialize( self, id, _request_auth, @@ -1056,7 +1127,8 @@ def _get_service_serialize( _host = None - _collection_formats: Dict[str, str] = {} + _collection_formats: Dict[str, str] = { + } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -1069,22 +1141,30 @@ def _get_service_serialize( # process the path parameters if id is not None: - _path_params["id"] = id + _path_params['id'] = id # process the query parameters # process the header parameters # process the form parameters # process the body parameter + # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept(["*/*"]) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + '*/*' + ] + ) + # authentication setting - _auth_settings: List[str] = ["Bearer"] + _auth_settings: List[str] = [ + 'Bearer' + ] return self.api_client.param_serialize( - method="GET", - resource_path="/v1/services/{id}", + method='DELETE', + resource_path='/v1/services/{id}/scale', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -1094,58 +1174,34 @@ def _get_service_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth, + _request_auth=_request_auth ) + + + @validate_call - def list_service_events( + def get_service( self, - service_id: Annotated[ - Optional[StrictStr], Field(description="(Optional) Filter on service id") - ] = None, - types: Annotated[ - Optional[List[StrictStr]], - Field(description="(Optional) Filter on service event types"), - ] = None, - limit: Annotated[ - Optional[StrictStr], - Field(description="(Optional) The number of items to return"), - ] = None, - offset: Annotated[ - Optional[StrictStr], - Field(description="(Optional) The offset in the list of item to return"), - ] = None, - order: Annotated[ - Optional[StrictStr], - Field( - description="(Optional) Sorts the list in the ascending or the descending order" - ), - ] = None, + id: Annotated[StrictStr, Field(description="The id of the Service")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ListServiceEventsReply: - """List Service events + ) -> GetServiceReply: + """Get Service - :param service_id: (Optional) Filter on service id - :type service_id: str - :param types: (Optional) Filter on service event types - :type types: List[str] - :param limit: (Optional) The number of items to return - :type limit: str - :param offset: (Optional) The offset in the list of item to return - :type offset: str - :param order: (Optional) Sorts the list in the ascending or the descending order - :type order: str + :param id: The id of the Service (required) + :type id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -1166,31 +1222,28 @@ def list_service_events( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 - _param = self._list_service_events_serialize( - service_id=service_id, - types=types, - limit=limit, - offset=offset, - order=order, + _param = self._get_service_serialize( + id=id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ListServiceEventsReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "GetServiceReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -1198,55 +1251,29 @@ def list_service_events( response_types_map=_response_types_map, ).data + @validate_call - def list_service_events_with_http_info( + def get_service_with_http_info( self, - service_id: Annotated[ - Optional[StrictStr], Field(description="(Optional) Filter on service id") - ] = None, - types: Annotated[ - Optional[List[StrictStr]], - Field(description="(Optional) Filter on service event types"), - ] = None, - limit: Annotated[ - Optional[StrictStr], - Field(description="(Optional) The number of items to return"), - ] = None, - offset: Annotated[ - Optional[StrictStr], - Field(description="(Optional) The offset in the list of item to return"), - ] = None, - order: Annotated[ - Optional[StrictStr], - Field( - description="(Optional) Sorts the list in the ascending or the descending order" - ), - ] = None, + id: Annotated[StrictStr, Field(description="The id of the Service")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[ListServiceEventsReply]: - """List Service events + ) -> ApiResponse[GetServiceReply]: + """Get Service - :param service_id: (Optional) Filter on service id - :type service_id: str - :param types: (Optional) Filter on service event types - :type types: List[str] - :param limit: (Optional) The number of items to return - :type limit: str - :param offset: (Optional) The offset in the list of item to return - :type offset: str - :param order: (Optional) Sorts the list in the ascending or the descending order - :type order: str + :param id: The id of the Service (required) + :type id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -1267,31 +1294,28 @@ def list_service_events_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 - _param = self._list_service_events_serialize( - service_id=service_id, - types=types, - limit=limit, - offset=offset, - order=order, + _param = self._get_service_serialize( + id=id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ListServiceEventsReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "GetServiceReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -1299,55 +1323,29 @@ def list_service_events_with_http_info( response_types_map=_response_types_map, ) + @validate_call - def list_service_events_without_preload_content( + def get_service_without_preload_content( self, - service_id: Annotated[ - Optional[StrictStr], Field(description="(Optional) Filter on service id") - ] = None, - types: Annotated[ - Optional[List[StrictStr]], - Field(description="(Optional) Filter on service event types"), - ] = None, - limit: Annotated[ - Optional[StrictStr], - Field(description="(Optional) The number of items to return"), - ] = None, - offset: Annotated[ - Optional[StrictStr], - Field(description="(Optional) The offset in the list of item to return"), - ] = None, - order: Annotated[ - Optional[StrictStr], - Field( - description="(Optional) Sorts the list in the ascending or the descending order" - ), - ] = None, + id: Annotated[StrictStr, Field(description="The id of the Service")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """List Service events + """Get Service - :param service_id: (Optional) Filter on service id - :type service_id: str - :param types: (Optional) Filter on service event types - :type types: List[str] - :param limit: (Optional) The number of items to return - :type limit: str - :param offset: (Optional) The offset in the list of item to return - :type offset: str - :param order: (Optional) Sorts the list in the ascending or the descending order - :type order: str + :param id: The id of the Service (required) + :type id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -1368,41 +1366,35 @@ def list_service_events_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 - _param = self._list_service_events_serialize( - service_id=service_id, - types=types, - limit=limit, - offset=offset, - order=order, + _param = self._get_service_serialize( + id=id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ListServiceEventsReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "GetServiceReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) return response_data.response - def _list_service_events_serialize( + + def _get_service_serialize( self, - service_id, - types, - limit, - offset, - order, + id, _request_auth, _content_type, _headers, @@ -1412,7 +1404,6 @@ def _list_service_events_serialize( _host = None _collection_formats: Dict[str, str] = { - "types": "multi", } _path_params: Dict[str, str] = {} @@ -1425,41 +1416,31 @@ def _list_service_events_serialize( _body_params: Optional[bytes] = None # process the path parameters + if id is not None: + _path_params['id'] = id # process the query parameters - if service_id is not None: - - _query_params.append(("service_id", service_id)) - - if types is not None: - - _query_params.append(("types", types)) - - if limit is not None: - - _query_params.append(("limit", limit)) - - if offset is not None: - - _query_params.append(("offset", offset)) - - if order is not None: - - _query_params.append(("order", order)) - # process the header parameters # process the form parameters # process the body parameter + # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept(["*/*"]) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + '*/*' + ] + ) + # authentication setting - _auth_settings: List[str] = ["Bearer"] + _auth_settings: List[str] = [ + 'Bearer' + ] return self.api_client.param_serialize( - method="GET", - resource_path="/v1/service_events", + method='GET', + resource_path='/v1/services/{id}', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -1469,61 +1450,35 @@ def _list_service_events_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth, + _request_auth=_request_auth ) + + + @validate_call - def list_services( + def get_service_scaling( self, - app_id: Annotated[ - Optional[StrictStr], Field(description="(Optional) The id of the app") - ] = None, - limit: Annotated[ - Optional[StrictStr], - Field(description="(Optional) The number of items to return"), - ] = None, - offset: Annotated[ - Optional[StrictStr], - Field(description="(Optional) The offset in the list of item to return"), - ] = None, - name: Annotated[ - Optional[StrictStr], Field(description="(Optional) A filter for name") - ] = None, - types: Annotated[ - Optional[List[StrictStr]], - Field(description="(Optional) Filter on service types"), - ] = None, - statuses: Annotated[ - Optional[List[StrictStr]], - Field(description="(Optional) Filter on service statuses"), - ] = None, + id: Annotated[StrictStr, Field(description="The id of the service")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ListServicesReply: - """List Services + ) -> GetServiceScalingReply: + """Get Service Scaling + Returns the current scaling configuration for a service - :param app_id: (Optional) The id of the app - :type app_id: str - :param limit: (Optional) The number of items to return - :type limit: str - :param offset: (Optional) The offset in the list of item to return - :type offset: str - :param name: (Optional) A filter for name - :type name: str - :param types: (Optional) Filter on service types - :type types: List[str] - :param statuses: (Optional) Filter on service statuses - :type statuses: List[str] + :param id: The id of the service (required) + :type id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -1544,32 +1499,28 @@ def list_services( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 - _param = self._list_services_serialize( - app_id=app_id, - limit=limit, - offset=offset, - name=name, - types=types, - statuses=statuses, + _param = self._get_service_scaling_serialize( + id=id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ListServicesReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "GetServiceScalingReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -1577,58 +1528,30 @@ def list_services( response_types_map=_response_types_map, ).data + @validate_call - def list_services_with_http_info( + def get_service_scaling_with_http_info( self, - app_id: Annotated[ - Optional[StrictStr], Field(description="(Optional) The id of the app") - ] = None, - limit: Annotated[ - Optional[StrictStr], - Field(description="(Optional) The number of items to return"), - ] = None, - offset: Annotated[ - Optional[StrictStr], - Field(description="(Optional) The offset in the list of item to return"), - ] = None, - name: Annotated[ - Optional[StrictStr], Field(description="(Optional) A filter for name") - ] = None, - types: Annotated[ - Optional[List[StrictStr]], - Field(description="(Optional) Filter on service types"), - ] = None, - statuses: Annotated[ - Optional[List[StrictStr]], - Field(description="(Optional) Filter on service statuses"), - ] = None, + id: Annotated[StrictStr, Field(description="The id of the service")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[ListServicesReply]: - """List Services + ) -> ApiResponse[GetServiceScalingReply]: + """Get Service Scaling + Returns the current scaling configuration for a service - :param app_id: (Optional) The id of the app - :type app_id: str - :param limit: (Optional) The number of items to return - :type limit: str - :param offset: (Optional) The offset in the list of item to return - :type offset: str - :param name: (Optional) A filter for name - :type name: str - :param types: (Optional) Filter on service types - :type types: List[str] - :param statuses: (Optional) Filter on service statuses - :type statuses: List[str] + :param id: The id of the service (required) + :type id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -1649,91 +1572,1085 @@ def list_services_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 - _param = self._list_services_serialize( - app_id=app_id, - limit=limit, + _param = self._get_service_scaling_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "GetServiceScalingReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def get_service_scaling_without_preload_content( + self, + id: Annotated[StrictStr, Field(description="The id of the service")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get Service Scaling + + Returns the current scaling configuration for a service + + :param id: The id of the service (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_service_scaling_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "GetServiceScalingReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_service_scaling_serialize( + self, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + '*/*' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'Bearer' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/v1/services/{id}/scale', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def list_service_events( + self, + service_id: Annotated[Optional[StrictStr], Field(description="(Optional) Filter on service id")] = None, + types: Annotated[Optional[List[StrictStr]], Field(description="(Optional) Filter on service event types")] = None, + limit: Annotated[Optional[StrictStr], Field(description="(Optional) The number of items to return")] = None, + offset: Annotated[Optional[StrictStr], Field(description="(Optional) The offset in the list of item to return")] = None, + order: Annotated[Optional[StrictStr], Field(description="(Optional) Sorts the list in the ascending or the descending order")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ListServiceEventsReply: + """List Service events + + + :param service_id: (Optional) Filter on service id + :type service_id: str + :param types: (Optional) Filter on service event types + :type types: List[str] + :param limit: (Optional) The number of items to return + :type limit: str + :param offset: (Optional) The offset in the list of item to return + :type offset: str + :param order: (Optional) Sorts the list in the ascending or the descending order + :type order: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_service_events_serialize( + service_id=service_id, + types=types, + limit=limit, + offset=offset, + order=order, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ListServiceEventsReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def list_service_events_with_http_info( + self, + service_id: Annotated[Optional[StrictStr], Field(description="(Optional) Filter on service id")] = None, + types: Annotated[Optional[List[StrictStr]], Field(description="(Optional) Filter on service event types")] = None, + limit: Annotated[Optional[StrictStr], Field(description="(Optional) The number of items to return")] = None, + offset: Annotated[Optional[StrictStr], Field(description="(Optional) The offset in the list of item to return")] = None, + order: Annotated[Optional[StrictStr], Field(description="(Optional) Sorts the list in the ascending or the descending order")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ListServiceEventsReply]: + """List Service events + + + :param service_id: (Optional) Filter on service id + :type service_id: str + :param types: (Optional) Filter on service event types + :type types: List[str] + :param limit: (Optional) The number of items to return + :type limit: str + :param offset: (Optional) The offset in the list of item to return + :type offset: str + :param order: (Optional) Sorts the list in the ascending or the descending order + :type order: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_service_events_serialize( + service_id=service_id, + types=types, + limit=limit, + offset=offset, + order=order, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ListServiceEventsReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def list_service_events_without_preload_content( + self, + service_id: Annotated[Optional[StrictStr], Field(description="(Optional) Filter on service id")] = None, + types: Annotated[Optional[List[StrictStr]], Field(description="(Optional) Filter on service event types")] = None, + limit: Annotated[Optional[StrictStr], Field(description="(Optional) The number of items to return")] = None, + offset: Annotated[Optional[StrictStr], Field(description="(Optional) The offset in the list of item to return")] = None, + order: Annotated[Optional[StrictStr], Field(description="(Optional) Sorts the list in the ascending or the descending order")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """List Service events + + + :param service_id: (Optional) Filter on service id + :type service_id: str + :param types: (Optional) Filter on service event types + :type types: List[str] + :param limit: (Optional) The number of items to return + :type limit: str + :param offset: (Optional) The offset in the list of item to return + :type offset: str + :param order: (Optional) Sorts the list in the ascending or the descending order + :type order: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_service_events_serialize( + service_id=service_id, + types=types, + limit=limit, + offset=offset, + order=order, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ListServiceEventsReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _list_service_events_serialize( + self, + service_id, + types, + limit, + offset, + order, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'types': 'multi', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if service_id is not None: + + _query_params.append(('service_id', service_id)) + + if types is not None: + + _query_params.append(('types', types)) + + if limit is not None: + + _query_params.append(('limit', limit)) + + if offset is not None: + + _query_params.append(('offset', offset)) + + if order is not None: + + _query_params.append(('order', order)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + '*/*' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'Bearer' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/v1/service_events', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def list_services( + self, + app_id: Annotated[Optional[StrictStr], Field(description="(Optional) The id of the app")] = None, + limit: Annotated[Optional[StrictStr], Field(description="(Optional) The number of items to return")] = None, + offset: Annotated[Optional[StrictStr], Field(description="(Optional) The offset in the list of item to return")] = None, + name: Annotated[Optional[StrictStr], Field(description="(Optional) A filter for name")] = None, + types: Annotated[Optional[List[StrictStr]], Field(description="(Optional) Filter on service types")] = None, + statuses: Annotated[Optional[List[StrictStr]], Field(description="(Optional) Filter on service statuses")] = None, + regions: Annotated[Optional[List[StrictStr]], Field(description="(Optional) Filter on regions")] = None, + project_id: Annotated[Optional[StrictStr], Field(description="(Optional) A filter for the project ID")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ListServicesReply: + """List Services + + + :param app_id: (Optional) The id of the app + :type app_id: str + :param limit: (Optional) The number of items to return + :type limit: str + :param offset: (Optional) The offset in the list of item to return + :type offset: str + :param name: (Optional) A filter for name + :type name: str + :param types: (Optional) Filter on service types + :type types: List[str] + :param statuses: (Optional) Filter on service statuses + :type statuses: List[str] + :param regions: (Optional) Filter on regions + :type regions: List[str] + :param project_id: (Optional) A filter for the project ID + :type project_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_services_serialize( + app_id=app_id, + limit=limit, + offset=offset, + name=name, + types=types, + statuses=statuses, + regions=regions, + project_id=project_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ListServicesReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def list_services_with_http_info( + self, + app_id: Annotated[Optional[StrictStr], Field(description="(Optional) The id of the app")] = None, + limit: Annotated[Optional[StrictStr], Field(description="(Optional) The number of items to return")] = None, + offset: Annotated[Optional[StrictStr], Field(description="(Optional) The offset in the list of item to return")] = None, + name: Annotated[Optional[StrictStr], Field(description="(Optional) A filter for name")] = None, + types: Annotated[Optional[List[StrictStr]], Field(description="(Optional) Filter on service types")] = None, + statuses: Annotated[Optional[List[StrictStr]], Field(description="(Optional) Filter on service statuses")] = None, + regions: Annotated[Optional[List[StrictStr]], Field(description="(Optional) Filter on regions")] = None, + project_id: Annotated[Optional[StrictStr], Field(description="(Optional) A filter for the project ID")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ListServicesReply]: + """List Services + + + :param app_id: (Optional) The id of the app + :type app_id: str + :param limit: (Optional) The number of items to return + :type limit: str + :param offset: (Optional) The offset in the list of item to return + :type offset: str + :param name: (Optional) A filter for name + :type name: str + :param types: (Optional) Filter on service types + :type types: List[str] + :param statuses: (Optional) Filter on service statuses + :type statuses: List[str] + :param regions: (Optional) Filter on regions + :type regions: List[str] + :param project_id: (Optional) A filter for the project ID + :type project_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_services_serialize( + app_id=app_id, + limit=limit, + offset=offset, + name=name, + types=types, + statuses=statuses, + regions=regions, + project_id=project_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ListServicesReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def list_services_without_preload_content( + self, + app_id: Annotated[Optional[StrictStr], Field(description="(Optional) The id of the app")] = None, + limit: Annotated[Optional[StrictStr], Field(description="(Optional) The number of items to return")] = None, + offset: Annotated[Optional[StrictStr], Field(description="(Optional) The offset in the list of item to return")] = None, + name: Annotated[Optional[StrictStr], Field(description="(Optional) A filter for name")] = None, + types: Annotated[Optional[List[StrictStr]], Field(description="(Optional) Filter on service types")] = None, + statuses: Annotated[Optional[List[StrictStr]], Field(description="(Optional) Filter on service statuses")] = None, + regions: Annotated[Optional[List[StrictStr]], Field(description="(Optional) Filter on regions")] = None, + project_id: Annotated[Optional[StrictStr], Field(description="(Optional) A filter for the project ID")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """List Services + + + :param app_id: (Optional) The id of the app + :type app_id: str + :param limit: (Optional) The number of items to return + :type limit: str + :param offset: (Optional) The offset in the list of item to return + :type offset: str + :param name: (Optional) A filter for name + :type name: str + :param types: (Optional) Filter on service types + :type types: List[str] + :param statuses: (Optional) Filter on service statuses + :type statuses: List[str] + :param regions: (Optional) Filter on regions + :type regions: List[str] + :param project_id: (Optional) A filter for the project ID + :type project_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_services_serialize( + app_id=app_id, + limit=limit, offset=offset, name=name, types=types, statuses=statuses, + regions=regions, + project_id=project_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ListServicesReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _list_services_serialize( + self, + app_id, + limit, + offset, + name, + types, + statuses, + regions, + project_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'types': 'multi', + 'statuses': 'multi', + 'regions': 'multi', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if app_id is not None: + + _query_params.append(('app_id', app_id)) + + if limit is not None: + + _query_params.append(('limit', limit)) + + if offset is not None: + + _query_params.append(('offset', offset)) + + if name is not None: + + _query_params.append(('name', name)) + + if types is not None: + + _query_params.append(('types', types)) + + if statuses is not None: + + _query_params.append(('statuses', statuses)) + + if regions is not None: + + _query_params.append(('regions', regions)) + + if project_id is not None: + + _query_params.append(('project_id', project_id)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + '*/*' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'Bearer' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/v1/services', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def pause_service( + self, + id: Annotated[StrictStr, Field(description="The id of the service to pause.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> object: + """Pause Service + + Service pause action is allowed for the following status: - starting - healthy - degraded - unhealthy - resuming + + :param id: The id of the service to pause. (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._pause_service_serialize( + id=id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ListServicesReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "object", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( response_data=response_data, response_types_map=_response_types_map, - ) + ).data + @validate_call - def list_services_without_preload_content( + def pause_service_with_http_info( self, - app_id: Annotated[ - Optional[StrictStr], Field(description="(Optional) The id of the app") - ] = None, - limit: Annotated[ - Optional[StrictStr], - Field(description="(Optional) The number of items to return"), - ] = None, - offset: Annotated[ - Optional[StrictStr], - Field(description="(Optional) The offset in the list of item to return"), - ] = None, - name: Annotated[ - Optional[StrictStr], Field(description="(Optional) A filter for name") - ] = None, - types: Annotated[ - Optional[List[StrictStr]], - Field(description="(Optional) Filter on service types"), - ] = None, - statuses: Annotated[ - Optional[List[StrictStr]], - Field(description="(Optional) Filter on service statuses"), + id: Annotated[StrictStr, Field(description="The id of the service to pause.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[object]: + """Pause Service + + Service pause action is allowed for the following status: - starting - healthy - degraded - unhealthy - resuming + + :param id: The id of the service to pause. (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._pause_service_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "object", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def pause_service_without_preload_content( + self, + id: Annotated[StrictStr, Field(description="The id of the service to pause.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """List Services + """Pause Service + Service pause action is allowed for the following status: - starting - healthy - degraded - unhealthy - resuming - :param app_id: (Optional) The id of the app - :type app_id: str - :param limit: (Optional) The number of items to return - :type limit: str - :param offset: (Optional) The offset in the list of item to return - :type offset: str - :param name: (Optional) A filter for name - :type name: str - :param types: (Optional) Filter on service types - :type types: List[str] - :param statuses: (Optional) Filter on service statuses - :type statuses: List[str] + :param id: The id of the service to pause. (required) + :type id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -1754,43 +2671,35 @@ def list_services_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 - _param = self._list_services_serialize( - app_id=app_id, - limit=limit, - offset=offset, - name=name, - types=types, - statuses=statuses, + _param = self._pause_service_serialize( + id=id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ListServicesReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "object", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) return response_data.response - def _list_services_serialize( + + def _pause_service_serialize( self, - app_id, - limit, - offset, - name, - types, - statuses, + id, _request_auth, _content_type, _headers, @@ -1800,8 +2709,6 @@ def _list_services_serialize( _host = None _collection_formats: Dict[str, str] = { - "types": "multi", - "statuses": "multi", } _path_params: Dict[str, str] = {} @@ -1814,45 +2721,31 @@ def _list_services_serialize( _body_params: Optional[bytes] = None # process the path parameters + if id is not None: + _path_params['id'] = id # process the query parameters - if app_id is not None: - - _query_params.append(("app_id", app_id)) - - if limit is not None: - - _query_params.append(("limit", limit)) - - if offset is not None: - - _query_params.append(("offset", offset)) - - if name is not None: - - _query_params.append(("name", name)) - - if types is not None: - - _query_params.append(("types", types)) - - if statuses is not None: - - _query_params.append(("statuses", statuses)) - # process the header parameters # process the form parameters # process the body parameter + # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept(["*/*"]) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + '*/*' + ] + ) + # authentication setting - _auth_settings: List[str] = ["Bearer"] + _auth_settings: List[str] = [ + 'Bearer' + ] return self.api_client.param_serialize( - method="GET", - resource_path="/v1/services", + method='POST', + resource_path='/v1/services/{id}/pause', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -1862,31 +2755,37 @@ def _list_services_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth, + _request_auth=_request_auth ) + + + @validate_call - def pause_service( + def re_deploy( self, - id: Annotated[StrictStr, Field(description="The id of the service to pause.")], + id: StrictStr, + info: RedeployRequestInfo, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> object: - """Pause Service + ) -> RedeployReply: + """ReDeploy Service - Service pause action is allowed for the following status: - starting - healthy - degraded - unhealthy - resuming - :param id: The id of the service to pause. (required) + :param id: (required) :type id: str + :param info: (required) + :type info: RedeployRequestInfo :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -1907,27 +2806,29 @@ def pause_service( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 - _param = self._pause_service_serialize( + _param = self._re_deploy_serialize( id=id, + info=info, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "object", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "RedeployReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -1935,28 +2836,32 @@ def pause_service( response_types_map=_response_types_map, ).data + @validate_call - def pause_service_with_http_info( + def re_deploy_with_http_info( self, - id: Annotated[StrictStr, Field(description="The id of the service to pause.")], + id: StrictStr, + info: RedeployRequestInfo, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[object]: - """Pause Service + ) -> ApiResponse[RedeployReply]: + """ReDeploy Service - Service pause action is allowed for the following status: - starting - healthy - degraded - unhealthy - resuming - :param id: The id of the service to pause. (required) + :param id: (required) :type id: str + :param info: (required) + :type info: RedeployRequestInfo :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -1977,27 +2882,29 @@ def pause_service_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 - _param = self._pause_service_serialize( + _param = self._re_deploy_serialize( id=id, + info=info, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "object", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "RedeployReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -2005,28 +2912,32 @@ def pause_service_with_http_info( response_types_map=_response_types_map, ) + @validate_call - def pause_service_without_preload_content( + def re_deploy_without_preload_content( self, - id: Annotated[StrictStr, Field(description="The id of the service to pause.")], + id: StrictStr, + info: RedeployRequestInfo, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Pause Service + """ReDeploy Service - Service pause action is allowed for the following status: - starting - healthy - degraded - unhealthy - resuming - :param id: The id of the service to pause. (required) + :param id: (required) :type id: str + :param info: (required) + :type info: RedeployRequestInfo :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -2047,33 +2958,37 @@ def pause_service_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 - _param = self._pause_service_serialize( + _param = self._re_deploy_serialize( id=id, + info=info, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "object", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "RedeployReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) return response_data.response - def _pause_service_serialize( + + def _re_deploy_serialize( self, id, + info, _request_auth, _content_type, _headers, @@ -2082,7 +2997,8 @@ def _pause_service_serialize( _host = None - _collection_formats: Dict[str, str] = {} + _collection_formats: Dict[str, str] = { + } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -2095,22 +3011,32 @@ def _pause_service_serialize( # process the path parameters if id is not None: - _path_params["id"] = id + _path_params['id'] = id # process the query parameters # process the header parameters # process the form parameters # process the body parameter + if info is not None: + _body_params = info + # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept(["*/*"]) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + '*/*' + ] + ) + # authentication setting - _auth_settings: List[str] = ["Bearer"] + _auth_settings: List[str] = [ + 'Bearer' + ] return self.api_client.param_serialize( - method="POST", - resource_path="/v1/services/{id}/pause", + method='POST', + resource_path='/v1/services/{id}/redeploy', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -2120,33 +3046,41 @@ def _pause_service_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth, + _request_auth=_request_auth ) + + + @validate_call - def re_deploy( + def resume_service( self, - id: StrictStr, - info: RedeployRequestInfo, + id: Annotated[StrictStr, Field(description="The id of the service to pause.")], + skip_build: Annotated[Optional[StrictBool], Field(description="If set to true, the build stage will be skipped and the image coming from the last successful build step will be used instead. The call fails if no previous successful builds happened.")] = None, + use_cache: Optional[StrictBool] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RedeployReply: - """ReDeploy Service + ) -> object: + """Resume Service + Service resume action is allowed for the following status: - paused - :param id: (required) + :param id: The id of the service to pause. (required) :type id: str - :param info: (required) - :type info: RedeployRequestInfo + :param skip_build: If set to true, the build stage will be skipped and the image coming from the last successful build step will be used instead. The call fails if no previous successful builds happened. + :type skip_build: bool + :param use_cache: + :type use_cache: bool :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -2167,28 +3101,30 @@ def re_deploy( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 - _param = self._re_deploy_serialize( + _param = self._resume_service_serialize( id=id, - info=info, + skip_build=skip_build, + use_cache=use_cache, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "RedeployReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "object", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -2196,30 +3132,36 @@ def re_deploy( response_types_map=_response_types_map, ).data + @validate_call - def re_deploy_with_http_info( + def resume_service_with_http_info( self, - id: StrictStr, - info: RedeployRequestInfo, + id: Annotated[StrictStr, Field(description="The id of the service to pause.")], + skip_build: Annotated[Optional[StrictBool], Field(description="If set to true, the build stage will be skipped and the image coming from the last successful build step will be used instead. The call fails if no previous successful builds happened.")] = None, + use_cache: Optional[StrictBool] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[RedeployReply]: - """ReDeploy Service + ) -> ApiResponse[object]: + """Resume Service + Service resume action is allowed for the following status: - paused - :param id: (required) + :param id: The id of the service to pause. (required) :type id: str - :param info: (required) - :type info: RedeployRequestInfo + :param skip_build: If set to true, the build stage will be skipped and the image coming from the last successful build step will be used instead. The call fails if no previous successful builds happened. + :type skip_build: bool + :param use_cache: + :type use_cache: bool :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -2240,28 +3182,30 @@ def re_deploy_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 - _param = self._re_deploy_serialize( + _param = self._resume_service_serialize( id=id, - info=info, + skip_build=skip_build, + use_cache=use_cache, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "RedeployReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "object", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -2269,30 +3213,36 @@ def re_deploy_with_http_info( response_types_map=_response_types_map, ) + @validate_call - def re_deploy_without_preload_content( + def resume_service_without_preload_content( self, - id: StrictStr, - info: RedeployRequestInfo, + id: Annotated[StrictStr, Field(description="The id of the service to pause.")], + skip_build: Annotated[Optional[StrictBool], Field(description="If set to true, the build stage will be skipped and the image coming from the last successful build step will be used instead. The call fails if no previous successful builds happened.")] = None, + use_cache: Optional[StrictBool] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """ReDeploy Service + """Resume Service + Service resume action is allowed for the following status: - paused - :param id: (required) + :param id: The id of the service to pause. (required) :type id: str - :param info: (required) - :type info: RedeployRequestInfo + :param skip_build: If set to true, the build stage will be skipped and the image coming from the last successful build step will be used instead. The call fails if no previous successful builds happened. + :type skip_build: bool + :param use_cache: + :type use_cache: bool :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -2313,35 +3263,39 @@ def re_deploy_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 - _param = self._re_deploy_serialize( + _param = self._resume_service_serialize( id=id, - info=info, + skip_build=skip_build, + use_cache=use_cache, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "RedeployReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "object", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) return response_data.response - def _re_deploy_serialize( + + def _resume_service_serialize( self, id, - info, + skip_build, + use_cache, _request_auth, _content_type, _headers, @@ -2350,7 +3304,8 @@ def _re_deploy_serialize( _host = None - _collection_formats: Dict[str, str] = {} + _collection_formats: Dict[str, str] = { + } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -2363,24 +3318,38 @@ def _re_deploy_serialize( # process the path parameters if id is not None: - _path_params["id"] = id + _path_params['id'] = id # process the query parameters + if skip_build is not None: + + _query_params.append(('skip_build', skip_build)) + + if use_cache is not None: + + _query_params.append(('use_cache', use_cache)) + # process the header parameters # process the form parameters # process the body parameter - if info is not None: - _body_params = info + # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept(["*/*"]) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + '*/*' + ] + ) + # authentication setting - _auth_settings: List[str] = ["Bearer"] + _auth_settings: List[str] = [ + 'Bearer' + ] return self.api_client.param_serialize( - method="POST", - resource_path="/v1/services/{id}/redeploy", + method='POST', + resource_path='/v1/services/{id}/resume', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -2390,42 +3359,43 @@ def _re_deploy_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth, + _request_auth=_request_auth ) + + + @validate_call - def resume_service( + def update_service( self, - id: Annotated[StrictStr, Field(description="The id of the service to pause.")], - skip_build: Annotated[ - Optional[StrictBool], - Field( - description="If set to true, the build stage will be skipped and the image coming from the last successful build step will be used instead. The call fails if no previous successful builds happened." - ), - ] = None, - use_cache: Optional[StrictBool] = None, + id: Annotated[StrictStr, Field(description="The id of the entity to update")], + service: UpdateService, + update_mask: Optional[StrictStr] = None, + dry_run: Annotated[Optional[StrictBool], Field(description="If set, run validation and check that the service exists")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> object: - """Resume Service + ) -> UpdateServiceReply: + """Update Service - Service resume action is allowed for the following status: - paused - :param id: The id of the service to pause. (required) + :param id: The id of the entity to update (required) :type id: str - :param skip_build: If set to true, the build stage will be skipped and the image coming from the last successful build step will be used instead. The call fails if no previous successful builds happened. - :type skip_build: bool - :param use_cache: - :type use_cache: bool + :param service: (required) + :type service: UpdateService + :param update_mask: + :type update_mask: str + :param dry_run: If set, run validation and check that the service exists + :type dry_run: bool :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -2446,29 +3416,31 @@ def resume_service( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 - _param = self._resume_service_serialize( + _param = self._update_service_serialize( id=id, - skip_build=skip_build, - use_cache=use_cache, + service=service, + update_mask=update_mask, + dry_run=dry_run, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "object", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "UpdateServiceReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -2476,39 +3448,38 @@ def resume_service( response_types_map=_response_types_map, ).data + @validate_call - def resume_service_with_http_info( + def update_service_with_http_info( self, - id: Annotated[StrictStr, Field(description="The id of the service to pause.")], - skip_build: Annotated[ - Optional[StrictBool], - Field( - description="If set to true, the build stage will be skipped and the image coming from the last successful build step will be used instead. The call fails if no previous successful builds happened." - ), - ] = None, - use_cache: Optional[StrictBool] = None, + id: Annotated[StrictStr, Field(description="The id of the entity to update")], + service: UpdateService, + update_mask: Optional[StrictStr] = None, + dry_run: Annotated[Optional[StrictBool], Field(description="If set, run validation and check that the service exists")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[object]: - """Resume Service + ) -> ApiResponse[UpdateServiceReply]: + """Update Service - Service resume action is allowed for the following status: - paused - :param id: The id of the service to pause. (required) + :param id: The id of the entity to update (required) :type id: str - :param skip_build: If set to true, the build stage will be skipped and the image coming from the last successful build step will be used instead. The call fails if no previous successful builds happened. - :type skip_build: bool - :param use_cache: - :type use_cache: bool + :param service: (required) + :type service: UpdateService + :param update_mask: + :type update_mask: str + :param dry_run: If set, run validation and check that the service exists + :type dry_run: bool :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -2529,29 +3500,31 @@ def resume_service_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 - _param = self._resume_service_serialize( + _param = self._update_service_serialize( id=id, - skip_build=skip_build, - use_cache=use_cache, + service=service, + update_mask=update_mask, + dry_run=dry_run, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "object", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "UpdateServiceReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -2559,39 +3532,38 @@ def resume_service_with_http_info( response_types_map=_response_types_map, ) + @validate_call - def resume_service_without_preload_content( + def update_service_without_preload_content( self, - id: Annotated[StrictStr, Field(description="The id of the service to pause.")], - skip_build: Annotated[ - Optional[StrictBool], - Field( - description="If set to true, the build stage will be skipped and the image coming from the last successful build step will be used instead. The call fails if no previous successful builds happened." - ), - ] = None, - use_cache: Optional[StrictBool] = None, + id: Annotated[StrictStr, Field(description="The id of the entity to update")], + service: UpdateService, + update_mask: Optional[StrictStr] = None, + dry_run: Annotated[Optional[StrictBool], Field(description="If set, run validation and check that the service exists")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Resume Service + """Update Service - Service resume action is allowed for the following status: - paused - :param id: The id of the service to pause. (required) + :param id: The id of the entity to update (required) :type id: str - :param skip_build: If set to true, the build stage will be skipped and the image coming from the last successful build step will be used instead. The call fails if no previous successful builds happened. - :type skip_build: bool - :param use_cache: - :type use_cache: bool + :param service: (required) + :type service: UpdateService + :param update_mask: + :type update_mask: str + :param dry_run: If set, run validation and check that the service exists + :type dry_run: bool :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -2612,37 +3584,41 @@ def resume_service_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 - _param = self._resume_service_serialize( + _param = self._update_service_serialize( id=id, - skip_build=skip_build, - use_cache=use_cache, + service=service, + update_mask=update_mask, + dry_run=dry_run, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "object", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "UpdateServiceReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) return response_data.response - def _resume_service_serialize( + + def _update_service_serialize( self, id, - skip_build, - use_cache, + service, + update_mask, + dry_run, _request_auth, _content_type, _headers, @@ -2651,7 +3627,8 @@ def _resume_service_serialize( _host = None - _collection_formats: Dict[str, str] = {} + _collection_formats: Dict[str, str] = { + } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -2664,30 +3641,40 @@ def _resume_service_serialize( # process the path parameters if id is not None: - _path_params["id"] = id + _path_params['id'] = id # process the query parameters - if skip_build is not None: - - _query_params.append(("skip_build", skip_build)) - - if use_cache is not None: - - _query_params.append(("use_cache", use_cache)) - + if update_mask is not None: + + _query_params.append(('update_mask', update_mask)) + + if dry_run is not None: + + _query_params.append(('dry_run', dry_run)) + # process the header parameters # process the form parameters # process the body parameter + if service is not None: + _body_params = service + # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept(["*/*"]) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + '*/*' + ] + ) + # authentication setting - _auth_settings: List[str] = ["Bearer"] + _auth_settings: List[str] = [ + 'Bearer' + ] return self.api_client.param_serialize( - method="POST", - resource_path="/v1/services/{id}/resume", + method='PUT', + resource_path='/v1/services/{id}', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -2697,26 +3684,26 @@ def _resume_service_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth, + _request_auth=_request_auth ) + + + @validate_call - def update_service( + def update_service2( self, id: Annotated[StrictStr, Field(description="The id of the entity to update")], service: UpdateService, - dry_run: Annotated[ - Optional[StrictBool], - Field( - description="If set, run validation and check that the service exists" - ), - ] = None, + update_mask: Optional[StrictStr] = None, + dry_run: Annotated[Optional[StrictBool], Field(description="If set, run validation and check that the service exists")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -2730,6 +3717,8 @@ def update_service( :type id: str :param service: (required) :type service: UpdateService + :param update_mask: + :type update_mask: str :param dry_run: If set, run validation and check that the service exists :type dry_run: bool :param _request_timeout: timeout setting for this request. If one @@ -2752,29 +3741,31 @@ def update_service( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 - _param = self._update_service_serialize( + _param = self._update_service2_serialize( id=id, service=service, + update_mask=update_mask, dry_run=dry_run, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "UpdateServiceReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "UpdateServiceReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -2782,23 +3773,21 @@ def update_service( response_types_map=_response_types_map, ).data + @validate_call - def update_service_with_http_info( + def update_service2_with_http_info( self, id: Annotated[StrictStr, Field(description="The id of the entity to update")], service: UpdateService, - dry_run: Annotated[ - Optional[StrictBool], - Field( - description="If set, run validation and check that the service exists" - ), - ] = None, + update_mask: Optional[StrictStr] = None, + dry_run: Annotated[Optional[StrictBool], Field(description="If set, run validation and check that the service exists")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -2812,6 +3801,8 @@ def update_service_with_http_info( :type id: str :param service: (required) :type service: UpdateService + :param update_mask: + :type update_mask: str :param dry_run: If set, run validation and check that the service exists :type dry_run: bool :param _request_timeout: timeout setting for this request. If one @@ -2834,29 +3825,31 @@ def update_service_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 - _param = self._update_service_serialize( + _param = self._update_service2_serialize( id=id, service=service, + update_mask=update_mask, dry_run=dry_run, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "UpdateServiceReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "UpdateServiceReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -2864,23 +3857,21 @@ def update_service_with_http_info( response_types_map=_response_types_map, ) + @validate_call - def update_service_without_preload_content( + def update_service2_without_preload_content( self, id: Annotated[StrictStr, Field(description="The id of the entity to update")], service: UpdateService, - dry_run: Annotated[ - Optional[StrictBool], - Field( - description="If set, run validation and check that the service exists" - ), - ] = None, + update_mask: Optional[StrictStr] = None, + dry_run: Annotated[Optional[StrictBool], Field(description="If set, run validation and check that the service exists")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -2894,6 +3885,8 @@ def update_service_without_preload_content( :type id: str :param service: (required) :type service: UpdateService + :param update_mask: + :type update_mask: str :param dry_run: If set, run validation and check that the service exists :type dry_run: bool :param _request_timeout: timeout setting for this request. If one @@ -2916,36 +3909,40 @@ def update_service_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 - _param = self._update_service_serialize( + _param = self._update_service2_serialize( id=id, service=service, + update_mask=update_mask, dry_run=dry_run, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "UpdateServiceReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "UpdateServiceReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) return response_data.response - def _update_service_serialize( + + def _update_service2_serialize( self, id, service, + update_mask, dry_run, _request_auth, _content_type, @@ -2955,7 +3952,8 @@ def _update_service_serialize( _host = None - _collection_formats: Dict[str, str] = {} + _collection_formats: Dict[str, str] = { + } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -2968,28 +3966,40 @@ def _update_service_serialize( # process the path parameters if id is not None: - _path_params["id"] = id + _path_params['id'] = id # process the query parameters + if update_mask is not None: + + _query_params.append(('update_mask', update_mask)) + if dry_run is not None: - - _query_params.append(("dry_run", dry_run)) - + + _query_params.append(('dry_run', dry_run)) + # process the header parameters # process the form parameters # process the body parameter if service is not None: _body_params = service + # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept(["*/*"]) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + '*/*' + ] + ) + # authentication setting - _auth_settings: List[str] = ["Bearer"] + _auth_settings: List[str] = [ + 'Bearer' + ] return self.api_client.param_serialize( - method="PUT", - resource_path="/v1/services/{id}", + method='PATCH', + resource_path='/v1/services/{id}', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -2999,41 +4009,38 @@ def _update_service_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth, + _request_auth=_request_auth ) + + + @validate_call - def update_service2( + def update_service_scaling( self, - id: Annotated[StrictStr, Field(description="The id of the entity to update")], - service: UpdateService, - dry_run: Annotated[ - Optional[StrictBool], - Field( - description="If set, run validation and check that the service exists" - ), - ] = None, + id: Annotated[StrictStr, Field(description="The id of the service to scale")], + body: UpdateServiceScalingRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> UpdateServiceReply: - """Update Service + ) -> object: + """Update Service Scaling + Stores or updates the scaling configuration for a service to use manual scaling - :param id: The id of the entity to update (required) + :param id: The id of the service to scale (required) :type id: str - :param service: (required) - :type service: UpdateService - :param dry_run: If set, run validation and check that the service exists - :type dry_run: bool + :param body: (required) + :type body: UpdateServiceScalingRequest :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -3054,29 +4061,29 @@ def update_service2( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 - _param = self._update_service2_serialize( + _param = self._update_service_scaling_serialize( id=id, - service=service, - dry_run=dry_run, + body=body, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "UpdateServiceReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "object", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -3084,38 +4091,33 @@ def update_service2( response_types_map=_response_types_map, ).data + @validate_call - def update_service2_with_http_info( + def update_service_scaling_with_http_info( self, - id: Annotated[StrictStr, Field(description="The id of the entity to update")], - service: UpdateService, - dry_run: Annotated[ - Optional[StrictBool], - Field( - description="If set, run validation and check that the service exists" - ), - ] = None, + id: Annotated[StrictStr, Field(description="The id of the service to scale")], + body: UpdateServiceScalingRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[UpdateServiceReply]: - """Update Service + ) -> ApiResponse[object]: + """Update Service Scaling + Stores or updates the scaling configuration for a service to use manual scaling - :param id: The id of the entity to update (required) + :param id: The id of the service to scale (required) :type id: str - :param service: (required) - :type service: UpdateService - :param dry_run: If set, run validation and check that the service exists - :type dry_run: bool + :param body: (required) + :type body: UpdateServiceScalingRequest :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -3136,29 +4138,29 @@ def update_service2_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 - _param = self._update_service2_serialize( + _param = self._update_service_scaling_serialize( id=id, - service=service, - dry_run=dry_run, + body=body, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "UpdateServiceReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "object", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -3166,38 +4168,33 @@ def update_service2_with_http_info( response_types_map=_response_types_map, ) + @validate_call - def update_service2_without_preload_content( + def update_service_scaling_without_preload_content( self, - id: Annotated[StrictStr, Field(description="The id of the entity to update")], - service: UpdateService, - dry_run: Annotated[ - Optional[StrictBool], - Field( - description="If set, run validation and check that the service exists" - ), - ] = None, + id: Annotated[StrictStr, Field(description="The id of the service to scale")], + body: UpdateServiceScalingRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Update Service + """Update Service Scaling + Stores or updates the scaling configuration for a service to use manual scaling - :param id: The id of the entity to update (required) + :param id: The id of the service to scale (required) :type id: str - :param service: (required) - :type service: UpdateService - :param dry_run: If set, run validation and check that the service exists - :type dry_run: bool + :param body: (required) + :type body: UpdateServiceScalingRequest :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -3218,37 +4215,37 @@ def update_service2_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 - _param = self._update_service2_serialize( + _param = self._update_service_scaling_serialize( id=id, - service=service, - dry_run=dry_run, + body=body, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "UpdateServiceReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "object", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) return response_data.response - def _update_service2_serialize( + + def _update_service_scaling_serialize( self, id, - service, - dry_run, + body, _request_auth, _content_type, _headers, @@ -3257,7 +4254,8 @@ def _update_service2_serialize( _host = None - _collection_formats: Dict[str, str] = {} + _collection_formats: Dict[str, str] = { + } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -3270,28 +4268,32 @@ def _update_service2_serialize( # process the path parameters if id is not None: - _path_params["id"] = id + _path_params['id'] = id # process the query parameters - if dry_run is not None: - - _query_params.append(("dry_run", dry_run)) - # process the header parameters # process the form parameters # process the body parameter - if service is not None: - _body_params = service + if body is not None: + _body_params = body + # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept(["*/*"]) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + '*/*' + ] + ) + # authentication setting - _auth_settings: List[str] = ["Bearer"] + _auth_settings: List[str] = [ + 'Bearer' + ] return self.api_client.param_serialize( - method="PATCH", - resource_path="/v1/services/{id}", + method='PUT', + resource_path='/v1/services/{id}/scale', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -3301,5 +4303,7 @@ def _update_service2_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth, + _request_auth=_request_auth ) + + diff --git a/koyeb/api/api/sessions_api.py b/koyeb/api/api/sessions_api.py index a0912608..a1e250a3 100644 --- a/koyeb/api/api/sessions_api.py +++ b/koyeb/api/api/sessions_api.py @@ -1,16 +1,15 @@ -# coding: utf-8 - """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 + import warnings from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt from typing import Any, Dict, List, Optional, Tuple, Union @@ -39,19 +38,19 @@ def __init__(self, api_client=None) -> None: api_client = ApiClient.get_default() self.api_client = api_client + @validate_call def login( self, body: LoginRequest, - seon_fp: Annotated[ - Optional[StrictStr], Field(description="Seon Fingerprint") - ] = None, + seon_fp: Annotated[Optional[StrictStr], Field(description="Seon Fingerprint")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -85,7 +84,7 @@ def login( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._login_serialize( body=body, @@ -93,20 +92,21 @@ def login( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "LoginReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "LoginReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -114,19 +114,19 @@ def login( response_types_map=_response_types_map, ).data + @validate_call def login_with_http_info( self, body: LoginRequest, - seon_fp: Annotated[ - Optional[StrictStr], Field(description="Seon Fingerprint") - ] = None, + seon_fp: Annotated[Optional[StrictStr], Field(description="Seon Fingerprint")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -160,7 +160,7 @@ def login_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._login_serialize( body=body, @@ -168,20 +168,21 @@ def login_with_http_info( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "LoginReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "LoginReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -189,19 +190,19 @@ def login_with_http_info( response_types_map=_response_types_map, ) + @validate_call def login_without_preload_content( self, body: LoginRequest, - seon_fp: Annotated[ - Optional[StrictStr], Field(description="Seon Fingerprint") - ] = None, + seon_fp: Annotated[Optional[StrictStr], Field(description="Seon Fingerprint")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -235,7 +236,7 @@ def login_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._login_serialize( body=body, @@ -243,23 +244,25 @@ def login_without_preload_content( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "LoginReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "LoginReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) return response_data.response + def _login_serialize( self, body, @@ -272,7 +275,8 @@ def _login_serialize( _host = None - _collection_formats: Dict[str, str] = {} + _collection_formats: Dict[str, str] = { + } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -287,22 +291,30 @@ def _login_serialize( # process the query parameters # process the header parameters if seon_fp is not None: - _header_params["seon-fp"] = seon_fp + _header_params['seon-fp'] = seon_fp # process the form parameters # process the body parameter if body is not None: _body_params = body + # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept(["*/*"]) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + '*/*' + ] + ) + # authentication setting - _auth_settings: List[str] = ["Bearer"] + _auth_settings: List[str] = [ + 'Bearer' + ] return self.api_client.param_serialize( - method="POST", - resource_path="/v1/account/login", + method='POST', + resource_path='/v1/account/login', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -312,9 +324,12 @@ def _login_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth, + _request_auth=_request_auth ) + + + @validate_call def logout( self, @@ -322,8 +337,9 @@ def logout( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -353,26 +369,27 @@ def logout( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._logout_serialize( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "object", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "object", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -380,6 +397,7 @@ def logout( response_types_map=_response_types_map, ).data + @validate_call def logout_with_http_info( self, @@ -387,8 +405,9 @@ def logout_with_http_info( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -418,26 +437,27 @@ def logout_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._logout_serialize( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "object", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "object", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -445,6 +465,7 @@ def logout_with_http_info( response_types_map=_response_types_map, ) + @validate_call def logout_without_preload_content( self, @@ -452,8 +473,9 @@ def logout_without_preload_content( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -483,29 +505,31 @@ def logout_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._logout_serialize( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "object", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "object", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) return response_data.response + def _logout_serialize( self, _request_auth, @@ -516,7 +540,8 @@ def _logout_serialize( _host = None - _collection_formats: Dict[str, str] = {} + _collection_formats: Dict[str, str] = { + } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -533,16 +558,24 @@ def _logout_serialize( # process the form parameters # process the body parameter + # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept(["*/*"]) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + '*/*' + ] + ) + # authentication setting - _auth_settings: List[str] = ["Bearer"] + _auth_settings: List[str] = [ + 'Bearer' + ] return self.api_client.param_serialize( - method="DELETE", - resource_path="/v1/account/logout", + method='DELETE', + resource_path='/v1/account/logout', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -552,9 +585,12 @@ def _logout_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth, + _request_auth=_request_auth ) + + + @validate_call def new_session( self, @@ -562,8 +598,9 @@ def new_session( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -594,26 +631,27 @@ def new_session( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._new_session_serialize( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "LoginReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "LoginReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -621,6 +659,7 @@ def new_session( response_types_map=_response_types_map, ).data + @validate_call def new_session_with_http_info( self, @@ -628,8 +667,9 @@ def new_session_with_http_info( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -660,26 +700,27 @@ def new_session_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._new_session_serialize( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "LoginReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "LoginReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -687,6 +728,7 @@ def new_session_with_http_info( response_types_map=_response_types_map, ) + @validate_call def new_session_without_preload_content( self, @@ -694,8 +736,9 @@ def new_session_without_preload_content( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -726,29 +769,31 @@ def new_session_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._new_session_serialize( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "LoginReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "LoginReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) return response_data.response + def _new_session_serialize( self, _request_auth, @@ -759,7 +804,8 @@ def _new_session_serialize( _host = None - _collection_formats: Dict[str, str] = {} + _collection_formats: Dict[str, str] = { + } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -776,16 +822,24 @@ def _new_session_serialize( # process the form parameters # process the body parameter + # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept(["*/*"]) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + '*/*' + ] + ) + # authentication setting - _auth_settings: List[str] = ["Bearer"] + _auth_settings: List[str] = [ + 'Bearer' + ] return self.api_client.param_serialize( - method="POST", - resource_path="/v1/account/session", + method='POST', + resource_path='/v1/account/session', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -795,9 +849,12 @@ def _new_session_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth, + _request_auth=_request_auth ) + + + @validate_call def refresh_token( self, @@ -805,8 +862,9 @@ def refresh_token( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -836,26 +894,27 @@ def refresh_token( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._refresh_token_serialize( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "LoginReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "LoginReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -863,6 +922,7 @@ def refresh_token( response_types_map=_response_types_map, ).data + @validate_call def refresh_token_with_http_info( self, @@ -870,8 +930,9 @@ def refresh_token_with_http_info( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -901,26 +962,27 @@ def refresh_token_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._refresh_token_serialize( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "LoginReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "LoginReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -928,6 +990,7 @@ def refresh_token_with_http_info( response_types_map=_response_types_map, ) + @validate_call def refresh_token_without_preload_content( self, @@ -935,8 +998,9 @@ def refresh_token_without_preload_content( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -966,29 +1030,31 @@ def refresh_token_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._refresh_token_serialize( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "LoginReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "LoginReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) return response_data.response + def _refresh_token_serialize( self, _request_auth, @@ -999,7 +1065,8 @@ def _refresh_token_serialize( _host = None - _collection_formats: Dict[str, str] = {} + _collection_formats: Dict[str, str] = { + } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -1016,16 +1083,24 @@ def _refresh_token_serialize( # process the form parameters # process the body parameter + # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept(["*/*"]) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + '*/*' + ] + ) + # authentication setting - _auth_settings: List[str] = ["Bearer"] + _auth_settings: List[str] = [ + 'Bearer' + ] return self.api_client.param_serialize( - method="PUT", - resource_path="/v1/account/refresh", + method='PUT', + resource_path='/v1/account/refresh', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -1035,5 +1110,7 @@ def _refresh_token_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth, + _request_auth=_request_auth ) + + diff --git a/koyeb/api/api/snapshots_api.py b/koyeb/api/api/snapshots_api.py index cd4abb00..20cfb171 100644 --- a/koyeb/api/api/snapshots_api.py +++ b/koyeb/api/api/snapshots_api.py @@ -1,16 +1,15 @@ -# coding: utf-8 - """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 + import warnings from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt from typing import Any, Dict, List, Optional, Tuple, Union @@ -44,6 +43,7 @@ def __init__(self, api_client=None) -> None: api_client = ApiClient.get_default() self.api_client = api_client + @validate_call def create_snapshot( self, @@ -52,8 +52,9 @@ def create_snapshot( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -85,27 +86,28 @@ def create_snapshot( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._create_snapshot_serialize( body=body, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "CreateSnapshotReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "CreateSnapshotReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -113,6 +115,7 @@ def create_snapshot( response_types_map=_response_types_map, ).data + @validate_call def create_snapshot_with_http_info( self, @@ -121,8 +124,9 @@ def create_snapshot_with_http_info( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -154,27 +158,28 @@ def create_snapshot_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._create_snapshot_serialize( body=body, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "CreateSnapshotReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "CreateSnapshotReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -182,6 +187,7 @@ def create_snapshot_with_http_info( response_types_map=_response_types_map, ) + @validate_call def create_snapshot_without_preload_content( self, @@ -190,8 +196,9 @@ def create_snapshot_without_preload_content( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -223,30 +230,32 @@ def create_snapshot_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._create_snapshot_serialize( body=body, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "CreateSnapshotReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "CreateSnapshotReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) return response_data.response + def _create_snapshot_serialize( self, body, @@ -258,7 +267,8 @@ def _create_snapshot_serialize( _host = None - _collection_formats: Dict[str, str] = {} + _collection_formats: Dict[str, str] = { + } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -277,16 +287,24 @@ def _create_snapshot_serialize( if body is not None: _body_params = body + # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept(["*/*"]) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + '*/*' + ] + ) + # authentication setting - _auth_settings: List[str] = ["Bearer"] + _auth_settings: List[str] = [ + 'Bearer' + ] return self.api_client.param_serialize( - method="POST", - resource_path="/v1/snapshots", + method='POST', + resource_path='/v1/snapshots', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -296,9 +314,12 @@ def _create_snapshot_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth, + _request_auth=_request_auth ) + + + @validate_call def delete_snapshot( self, @@ -307,8 +328,9 @@ def delete_snapshot( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -340,27 +362,28 @@ def delete_snapshot( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._delete_snapshot_serialize( id=id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "DeleteSnapshotReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "DeleteSnapshotReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -368,6 +391,7 @@ def delete_snapshot( response_types_map=_response_types_map, ).data + @validate_call def delete_snapshot_with_http_info( self, @@ -376,8 +400,9 @@ def delete_snapshot_with_http_info( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -409,27 +434,28 @@ def delete_snapshot_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._delete_snapshot_serialize( id=id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "DeleteSnapshotReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "DeleteSnapshotReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -437,6 +463,7 @@ def delete_snapshot_with_http_info( response_types_map=_response_types_map, ) + @validate_call def delete_snapshot_without_preload_content( self, @@ -445,8 +472,9 @@ def delete_snapshot_without_preload_content( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -478,30 +506,32 @@ def delete_snapshot_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._delete_snapshot_serialize( id=id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "DeleteSnapshotReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "DeleteSnapshotReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) return response_data.response + def _delete_snapshot_serialize( self, id, @@ -513,7 +543,8 @@ def _delete_snapshot_serialize( _host = None - _collection_formats: Dict[str, str] = {} + _collection_formats: Dict[str, str] = { + } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -526,22 +557,30 @@ def _delete_snapshot_serialize( # process the path parameters if id is not None: - _path_params["id"] = id + _path_params['id'] = id # process the query parameters # process the header parameters # process the form parameters # process the body parameter + # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept(["*/*"]) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + '*/*' + ] + ) + # authentication setting - _auth_settings: List[str] = ["Bearer"] + _auth_settings: List[str] = [ + 'Bearer' + ] return self.api_client.param_serialize( - method="DELETE", - resource_path="/v1/snapshots/{id}", + method='DELETE', + resource_path='/v1/snapshots/{id}', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -551,9 +590,12 @@ def _delete_snapshot_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth, + _request_auth=_request_auth ) + + + @validate_call def get_snapshot( self, @@ -562,8 +604,9 @@ def get_snapshot( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -595,27 +638,28 @@ def get_snapshot( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._get_snapshot_serialize( id=id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "GetSnapshotReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "GetSnapshotReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -623,6 +667,7 @@ def get_snapshot( response_types_map=_response_types_map, ).data + @validate_call def get_snapshot_with_http_info( self, @@ -631,8 +676,9 @@ def get_snapshot_with_http_info( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -664,27 +710,28 @@ def get_snapshot_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._get_snapshot_serialize( id=id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "GetSnapshotReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "GetSnapshotReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -692,6 +739,7 @@ def get_snapshot_with_http_info( response_types_map=_response_types_map, ) + @validate_call def get_snapshot_without_preload_content( self, @@ -700,8 +748,9 @@ def get_snapshot_without_preload_content( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -733,30 +782,32 @@ def get_snapshot_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._get_snapshot_serialize( id=id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "GetSnapshotReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "GetSnapshotReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) return response_data.response + def _get_snapshot_serialize( self, id, @@ -768,7 +819,8 @@ def _get_snapshot_serialize( _host = None - _collection_formats: Dict[str, str] = {} + _collection_formats: Dict[str, str] = { + } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -781,22 +833,30 @@ def _get_snapshot_serialize( # process the path parameters if id is not None: - _path_params["id"] = id + _path_params['id'] = id # process the query parameters # process the header parameters # process the form parameters # process the body parameter + # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept(["*/*"]) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + '*/*' + ] + ) + # authentication setting - _auth_settings: List[str] = ["Bearer"] + _auth_settings: List[str] = [ + 'Bearer' + ] return self.api_client.param_serialize( - method="GET", - resource_path="/v1/snapshots/{id}", + method='GET', + resource_path='/v1/snapshots/{id}', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -806,39 +866,27 @@ def _get_snapshot_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth, + _request_auth=_request_auth ) + + + @validate_call def list_snapshots( self, - limit: Annotated[ - Optional[StrictStr], - Field(description="(Optional) The number of items to return"), - ] = None, - offset: Annotated[ - Optional[StrictStr], - Field(description="(Optional) The offset in the list of item to return"), - ] = None, - organization_id: Annotated[ - Optional[StrictStr], - Field(description="(Optional) Filter by organization_id"), - ] = None, - statuses: Annotated[ - Optional[List[StrictStr]], - Field( - description="(Optional) Filter by status - SNAPSHOT_STATUS_INVALID: zero value, invalid - SNAPSHOT_STATUS_CREATING: the snapshot is being created - SNAPSHOT_STATUS_AVAILABLE: the snapshot is complete and available - SNAPSHOT_STATUS_MIGRATING: the snapshot is being migrated - SNAPSHOT_STATUS_DELETING: the snapshot is being deleted - SNAPSHOT_STATUS_DELETED: the snapshot is deleted" - ), - ] = None, - region: Annotated[ - Optional[StrictStr], Field(description="(Optional) A filter for the region") - ] = None, + limit: Annotated[Optional[StrictStr], Field(description="(Optional) The number of items to return")] = None, + offset: Annotated[Optional[StrictStr], Field(description="(Optional) The offset in the list of item to return")] = None, + organization_id: Annotated[Optional[StrictStr], Field(description="(Optional) Filter by organization_id")] = None, + statuses: Annotated[Optional[List[StrictStr]], Field(description="(Optional) Filter by status - SNAPSHOT_STATUS_INVALID: zero value, invalid - SNAPSHOT_STATUS_CREATING: the snapshot is being created - SNAPSHOT_STATUS_AVAILABLE: the snapshot is complete and available - SNAPSHOT_STATUS_MIGRATING: the snapshot is being migrated - SNAPSHOT_STATUS_DELETING: the snapshot is being deleted - SNAPSHOT_STATUS_DELETED: the snapshot is deleted")] = None, + region: Annotated[Optional[StrictStr], Field(description="(Optional) A filter for the region")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -878,7 +926,7 @@ def list_snapshots( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._list_snapshots_serialize( limit=limit, @@ -889,20 +937,21 @@ def list_snapshots( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ListSnapshotsReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "ListSnapshotsReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -910,36 +959,22 @@ def list_snapshots( response_types_map=_response_types_map, ).data + @validate_call def list_snapshots_with_http_info( self, - limit: Annotated[ - Optional[StrictStr], - Field(description="(Optional) The number of items to return"), - ] = None, - offset: Annotated[ - Optional[StrictStr], - Field(description="(Optional) The offset in the list of item to return"), - ] = None, - organization_id: Annotated[ - Optional[StrictStr], - Field(description="(Optional) Filter by organization_id"), - ] = None, - statuses: Annotated[ - Optional[List[StrictStr]], - Field( - description="(Optional) Filter by status - SNAPSHOT_STATUS_INVALID: zero value, invalid - SNAPSHOT_STATUS_CREATING: the snapshot is being created - SNAPSHOT_STATUS_AVAILABLE: the snapshot is complete and available - SNAPSHOT_STATUS_MIGRATING: the snapshot is being migrated - SNAPSHOT_STATUS_DELETING: the snapshot is being deleted - SNAPSHOT_STATUS_DELETED: the snapshot is deleted" - ), - ] = None, - region: Annotated[ - Optional[StrictStr], Field(description="(Optional) A filter for the region") - ] = None, + limit: Annotated[Optional[StrictStr], Field(description="(Optional) The number of items to return")] = None, + offset: Annotated[Optional[StrictStr], Field(description="(Optional) The offset in the list of item to return")] = None, + organization_id: Annotated[Optional[StrictStr], Field(description="(Optional) Filter by organization_id")] = None, + statuses: Annotated[Optional[List[StrictStr]], Field(description="(Optional) Filter by status - SNAPSHOT_STATUS_INVALID: zero value, invalid - SNAPSHOT_STATUS_CREATING: the snapshot is being created - SNAPSHOT_STATUS_AVAILABLE: the snapshot is complete and available - SNAPSHOT_STATUS_MIGRATING: the snapshot is being migrated - SNAPSHOT_STATUS_DELETING: the snapshot is being deleted - SNAPSHOT_STATUS_DELETED: the snapshot is deleted")] = None, + region: Annotated[Optional[StrictStr], Field(description="(Optional) A filter for the region")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -979,7 +1014,7 @@ def list_snapshots_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._list_snapshots_serialize( limit=limit, @@ -990,20 +1025,21 @@ def list_snapshots_with_http_info( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ListSnapshotsReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "ListSnapshotsReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -1011,36 +1047,22 @@ def list_snapshots_with_http_info( response_types_map=_response_types_map, ) + @validate_call def list_snapshots_without_preload_content( self, - limit: Annotated[ - Optional[StrictStr], - Field(description="(Optional) The number of items to return"), - ] = None, - offset: Annotated[ - Optional[StrictStr], - Field(description="(Optional) The offset in the list of item to return"), - ] = None, - organization_id: Annotated[ - Optional[StrictStr], - Field(description="(Optional) Filter by organization_id"), - ] = None, - statuses: Annotated[ - Optional[List[StrictStr]], - Field( - description="(Optional) Filter by status - SNAPSHOT_STATUS_INVALID: zero value, invalid - SNAPSHOT_STATUS_CREATING: the snapshot is being created - SNAPSHOT_STATUS_AVAILABLE: the snapshot is complete and available - SNAPSHOT_STATUS_MIGRATING: the snapshot is being migrated - SNAPSHOT_STATUS_DELETING: the snapshot is being deleted - SNAPSHOT_STATUS_DELETED: the snapshot is deleted" - ), - ] = None, - region: Annotated[ - Optional[StrictStr], Field(description="(Optional) A filter for the region") - ] = None, + limit: Annotated[Optional[StrictStr], Field(description="(Optional) The number of items to return")] = None, + offset: Annotated[Optional[StrictStr], Field(description="(Optional) The offset in the list of item to return")] = None, + organization_id: Annotated[Optional[StrictStr], Field(description="(Optional) Filter by organization_id")] = None, + statuses: Annotated[Optional[List[StrictStr]], Field(description="(Optional) Filter by status - SNAPSHOT_STATUS_INVALID: zero value, invalid - SNAPSHOT_STATUS_CREATING: the snapshot is being created - SNAPSHOT_STATUS_AVAILABLE: the snapshot is complete and available - SNAPSHOT_STATUS_MIGRATING: the snapshot is being migrated - SNAPSHOT_STATUS_DELETING: the snapshot is being deleted - SNAPSHOT_STATUS_DELETED: the snapshot is deleted")] = None, + region: Annotated[Optional[StrictStr], Field(description="(Optional) A filter for the region")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -1080,7 +1102,7 @@ def list_snapshots_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._list_snapshots_serialize( limit=limit, @@ -1091,23 +1113,25 @@ def list_snapshots_without_preload_content( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ListSnapshotsReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "ListSnapshotsReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) return response_data.response + def _list_snapshots_serialize( self, limit, @@ -1124,7 +1148,7 @@ def _list_snapshots_serialize( _host = None _collection_formats: Dict[str, str] = { - "statuses": "multi", + 'statuses': 'multi', } _path_params: Dict[str, str] = {} @@ -1139,39 +1163,47 @@ def _list_snapshots_serialize( # process the path parameters # process the query parameters if limit is not None: - - _query_params.append(("limit", limit)) - + + _query_params.append(('limit', limit)) + if offset is not None: - - _query_params.append(("offset", offset)) - + + _query_params.append(('offset', offset)) + if organization_id is not None: - - _query_params.append(("organization_id", organization_id)) - + + _query_params.append(('organization_id', organization_id)) + if statuses is not None: - - _query_params.append(("statuses", statuses)) - + + _query_params.append(('statuses', statuses)) + if region is not None: - - _query_params.append(("region", region)) - + + _query_params.append(('region', region)) + # process the header parameters # process the form parameters # process the body parameter + # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept(["*/*"]) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + '*/*' + ] + ) + # authentication setting - _auth_settings: List[str] = ["Bearer"] + _auth_settings: List[str] = [ + 'Bearer' + ] return self.api_client.param_serialize( - method="GET", - resource_path="/v1/snapshots", + method='GET', + resource_path='/v1/snapshots', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -1181,9 +1213,12 @@ def _list_snapshots_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth, + _request_auth=_request_auth ) + + + @validate_call def update_snapshot( self, @@ -1193,8 +1228,9 @@ def update_snapshot( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -1228,7 +1264,7 @@ def update_snapshot( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._update_snapshot_serialize( id=id, @@ -1236,20 +1272,21 @@ def update_snapshot( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "UpdateSnapshotReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "UpdateSnapshotReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -1257,6 +1294,7 @@ def update_snapshot( response_types_map=_response_types_map, ).data + @validate_call def update_snapshot_with_http_info( self, @@ -1266,8 +1304,9 @@ def update_snapshot_with_http_info( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -1301,7 +1340,7 @@ def update_snapshot_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._update_snapshot_serialize( id=id, @@ -1309,20 +1348,21 @@ def update_snapshot_with_http_info( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "UpdateSnapshotReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "UpdateSnapshotReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -1330,6 +1370,7 @@ def update_snapshot_with_http_info( response_types_map=_response_types_map, ) + @validate_call def update_snapshot_without_preload_content( self, @@ -1339,8 +1380,9 @@ def update_snapshot_without_preload_content( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -1374,7 +1416,7 @@ def update_snapshot_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._update_snapshot_serialize( id=id, @@ -1382,23 +1424,25 @@ def update_snapshot_without_preload_content( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "UpdateSnapshotReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "UpdateSnapshotReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) return response_data.response + def _update_snapshot_serialize( self, id, @@ -1411,7 +1455,8 @@ def _update_snapshot_serialize( _host = None - _collection_formats: Dict[str, str] = {} + _collection_formats: Dict[str, str] = { + } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -1424,7 +1469,7 @@ def _update_snapshot_serialize( # process the path parameters if id is not None: - _path_params["id"] = id + _path_params['id'] = id # process the query parameters # process the header parameters # process the form parameters @@ -1432,16 +1477,24 @@ def _update_snapshot_serialize( if body is not None: _body_params = body + # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept(["*/*"]) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + '*/*' + ] + ) + # authentication setting - _auth_settings: List[str] = ["Bearer"] + _auth_settings: List[str] = [ + 'Bearer' + ] return self.api_client.param_serialize( - method="POST", - resource_path="/v1/snapshots/{id}", + method='POST', + resource_path='/v1/snapshots/{id}', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -1451,5 +1504,7 @@ def _update_snapshot_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth, + _request_auth=_request_auth ) + + diff --git a/koyeb/api/api/sso_api.py b/koyeb/api/api/sso_api.py index 8b185977..c6ff2937 100644 --- a/koyeb/api/api/sso_api.py +++ b/koyeb/api/api/sso_api.py @@ -1,16 +1,15 @@ -# coding: utf-8 - """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 + import warnings from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt from typing import Any, Dict, List, Optional, Tuple, Union @@ -38,6 +37,7 @@ def __init__(self, api_client=None) -> None: api_client = ApiClient.get_default() self.api_client = api_client + @validate_call def canny_auth( self, @@ -46,8 +46,9 @@ def canny_auth( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -79,27 +80,28 @@ def canny_auth( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._canny_auth_serialize( body=body, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "CannyAuthReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "CannyAuthReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -107,6 +109,7 @@ def canny_auth( response_types_map=_response_types_map, ).data + @validate_call def canny_auth_with_http_info( self, @@ -115,8 +118,9 @@ def canny_auth_with_http_info( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -148,27 +152,28 @@ def canny_auth_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._canny_auth_serialize( body=body, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "CannyAuthReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "CannyAuthReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -176,6 +181,7 @@ def canny_auth_with_http_info( response_types_map=_response_types_map, ) + @validate_call def canny_auth_without_preload_content( self, @@ -184,8 +190,9 @@ def canny_auth_without_preload_content( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -217,30 +224,32 @@ def canny_auth_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._canny_auth_serialize( body=body, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "CannyAuthReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "CannyAuthReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) return response_data.response + def _canny_auth_serialize( self, body, @@ -252,7 +261,8 @@ def _canny_auth_serialize( _host = None - _collection_formats: Dict[str, str] = {} + _collection_formats: Dict[str, str] = { + } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -271,16 +281,24 @@ def _canny_auth_serialize( if body is not None: _body_params = body + # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept(["*/*"]) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + '*/*' + ] + ) + # authentication setting - _auth_settings: List[str] = ["Bearer"] + _auth_settings: List[str] = [ + 'Bearer' + ] return self.api_client.param_serialize( - method="POST", - resource_path="/v1/sso/canny", + method='POST', + resource_path='/v1/sso/canny', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -290,9 +308,12 @@ def _canny_auth_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth, + _request_auth=_request_auth ) + + + @validate_call def discourse_auth( self, @@ -301,8 +322,9 @@ def discourse_auth( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -334,27 +356,28 @@ def discourse_auth( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._discourse_auth_serialize( body=body, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "DiscourseAuthReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "DiscourseAuthReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -362,6 +385,7 @@ def discourse_auth( response_types_map=_response_types_map, ).data + @validate_call def discourse_auth_with_http_info( self, @@ -370,8 +394,9 @@ def discourse_auth_with_http_info( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -403,27 +428,28 @@ def discourse_auth_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._discourse_auth_serialize( body=body, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "DiscourseAuthReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "DiscourseAuthReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -431,6 +457,7 @@ def discourse_auth_with_http_info( response_types_map=_response_types_map, ) + @validate_call def discourse_auth_without_preload_content( self, @@ -439,8 +466,9 @@ def discourse_auth_without_preload_content( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -472,30 +500,32 @@ def discourse_auth_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._discourse_auth_serialize( body=body, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "DiscourseAuthReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "DiscourseAuthReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) return response_data.response + def _discourse_auth_serialize( self, body, @@ -507,7 +537,8 @@ def _discourse_auth_serialize( _host = None - _collection_formats: Dict[str, str] = {} + _collection_formats: Dict[str, str] = { + } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -526,16 +557,24 @@ def _discourse_auth_serialize( if body is not None: _body_params = body + # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept(["*/*"]) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + '*/*' + ] + ) + # authentication setting - _auth_settings: List[str] = ["Bearer"] + _auth_settings: List[str] = [ + 'Bearer' + ] return self.api_client.param_serialize( - method="POST", - resource_path="/v1/sso/discourse", + method='POST', + resource_path='/v1/sso/discourse', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -545,5 +584,7 @@ def _discourse_auth_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth, + _request_auth=_request_auth ) + + diff --git a/koyeb/api/api/subscriptions_api.py b/koyeb/api/api/subscriptions_api.py index 7832e8e5..93784d3b 100644 --- a/koyeb/api/api/subscriptions_api.py +++ b/koyeb/api/api/subscriptions_api.py @@ -1,16 +1,15 @@ -# coding: utf-8 - """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 + import warnings from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt from typing import Any, Dict, List, Optional, Tuple, Union @@ -37,6 +36,7 @@ def __init__(self, api_client=None) -> None: api_client = ApiClient.get_default() self.api_client = api_client + @validate_call def get_subscription( self, @@ -45,8 +45,9 @@ def get_subscription( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -78,27 +79,28 @@ def get_subscription( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._get_subscription_serialize( id=id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "GetSubscriptionReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "GetSubscriptionReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -106,6 +108,7 @@ def get_subscription( response_types_map=_response_types_map, ).data + @validate_call def get_subscription_with_http_info( self, @@ -114,8 +117,9 @@ def get_subscription_with_http_info( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -147,27 +151,28 @@ def get_subscription_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._get_subscription_serialize( id=id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "GetSubscriptionReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "GetSubscriptionReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -175,6 +180,7 @@ def get_subscription_with_http_info( response_types_map=_response_types_map, ) + @validate_call def get_subscription_without_preload_content( self, @@ -183,8 +189,9 @@ def get_subscription_without_preload_content( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -216,30 +223,32 @@ def get_subscription_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._get_subscription_serialize( id=id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "GetSubscriptionReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "GetSubscriptionReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) return response_data.response + def _get_subscription_serialize( self, id, @@ -251,7 +260,8 @@ def _get_subscription_serialize( _host = None - _collection_formats: Dict[str, str] = {} + _collection_formats: Dict[str, str] = { + } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -264,22 +274,30 @@ def _get_subscription_serialize( # process the path parameters if id is not None: - _path_params["id"] = id + _path_params['id'] = id # process the query parameters # process the header parameters # process the form parameters # process the body parameter + # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept(["*/*"]) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + '*/*' + ] + ) + # authentication setting - _auth_settings: List[str] = ["Bearer"] + _auth_settings: List[str] = [ + 'Bearer' + ] return self.api_client.param_serialize( - method="GET", - resource_path="/v1/subscriptions/{id}", + method='GET', + resource_path='/v1/subscriptions/{id}', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -289,5 +307,7 @@ def _get_subscription_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth, + _request_auth=_request_auth ) + + diff --git a/koyeb/api/api/summary_api.py b/koyeb/api/api/summary_api.py index c717d3a5..5ef26e10 100644 --- a/koyeb/api/api/summary_api.py +++ b/koyeb/api/api/summary_api.py @@ -1,16 +1,15 @@ -# coding: utf-8 - """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 + import warnings from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt from typing import Any, Dict, List, Optional, Tuple, Union @@ -37,6 +36,7 @@ def __init__(self, api_client=None) -> None: api_client = ApiClient.get_default() self.api_client = api_client + @validate_call def get_organization_summary( self, @@ -45,8 +45,9 @@ def get_organization_summary( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -78,27 +79,28 @@ def get_organization_summary( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._get_organization_summary_serialize( organization_id=organization_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "GetOrganizationSummaryReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "GetOrganizationSummaryReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -106,6 +108,7 @@ def get_organization_summary( response_types_map=_response_types_map, ).data + @validate_call def get_organization_summary_with_http_info( self, @@ -114,8 +117,9 @@ def get_organization_summary_with_http_info( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -147,27 +151,28 @@ def get_organization_summary_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._get_organization_summary_serialize( organization_id=organization_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "GetOrganizationSummaryReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "GetOrganizationSummaryReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -175,6 +180,7 @@ def get_organization_summary_with_http_info( response_types_map=_response_types_map, ) + @validate_call def get_organization_summary_without_preload_content( self, @@ -183,8 +189,9 @@ def get_organization_summary_without_preload_content( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -216,30 +223,32 @@ def get_organization_summary_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._get_organization_summary_serialize( organization_id=organization_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "GetOrganizationSummaryReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "GetOrganizationSummaryReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) return response_data.response + def _get_organization_summary_serialize( self, organization_id, @@ -251,7 +260,8 @@ def _get_organization_summary_serialize( _host = None - _collection_formats: Dict[str, str] = {} + _collection_formats: Dict[str, str] = { + } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -264,22 +274,30 @@ def _get_organization_summary_serialize( # process the path parameters if organization_id is not None: - _path_params["organization_id"] = organization_id + _path_params['organization_id'] = organization_id # process the query parameters # process the header parameters # process the form parameters # process the body parameter + # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept(["*/*"]) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + '*/*' + ] + ) + # authentication setting - _auth_settings: List[str] = ["Bearer"] + _auth_settings: List[str] = [ + 'Bearer' + ] return self.api_client.param_serialize( - method="GET", - resource_path="/v1/organizations/{organization_id}/summary", + method='GET', + resource_path='/v1/organizations/{organization_id}/summary', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -289,5 +307,7 @@ def _get_organization_summary_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth, + _request_auth=_request_auth ) + + diff --git a/koyeb/api/api/usages_api.py b/koyeb/api/api/usages_api.py index bdc77128..8a38a77c 100644 --- a/koyeb/api/api/usages_api.py +++ b/koyeb/api/api/usages_api.py @@ -1,16 +1,15 @@ -# coding: utf-8 - """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 + import warnings from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt from typing import Any, Dict, List, Optional, Tuple, Union @@ -20,9 +19,7 @@ from pydantic import Field, StrictStr from typing import Optional from typing_extensions import Annotated -from koyeb.api.models.get_organization_usage_details_reply import ( - GetOrganizationUsageDetailsReply, -) +from koyeb.api.models.get_organization_usage_details_reply import GetOrganizationUsageDetailsReply from koyeb.api.models.get_organization_usage_reply import GetOrganizationUsageReply from koyeb.api.api_client import ApiClient, RequestSerialized @@ -42,23 +39,19 @@ def __init__(self, api_client=None) -> None: api_client = ApiClient.get_default() self.api_client = api_client + @validate_call def get_organization_usage( self, - starting_time: Annotated[ - Optional[datetime], - Field(description="The starting time of the period to get data from"), - ] = None, - ending_time: Annotated[ - Optional[datetime], - Field(description="The ending time of the period to get data from"), - ] = None, + starting_time: Annotated[Optional[datetime], Field(description="The starting time of the period to get data from")] = None, + ending_time: Annotated[Optional[datetime], Field(description="The ending time of the period to get data from")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -92,7 +85,7 @@ def get_organization_usage( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._get_organization_usage_serialize( starting_time=starting_time, @@ -100,14 +93,15 @@ def get_organization_usage( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "GetOrganizationUsageReply", + '200': "GetOrganizationUsageReply", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -115,23 +109,19 @@ def get_organization_usage( response_types_map=_response_types_map, ).data + @validate_call def get_organization_usage_with_http_info( self, - starting_time: Annotated[ - Optional[datetime], - Field(description="The starting time of the period to get data from"), - ] = None, - ending_time: Annotated[ - Optional[datetime], - Field(description="The ending time of the period to get data from"), - ] = None, + starting_time: Annotated[Optional[datetime], Field(description="The starting time of the period to get data from")] = None, + ending_time: Annotated[Optional[datetime], Field(description="The ending time of the period to get data from")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -165,7 +155,7 @@ def get_organization_usage_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._get_organization_usage_serialize( starting_time=starting_time, @@ -173,14 +163,15 @@ def get_organization_usage_with_http_info( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "GetOrganizationUsageReply", + '200': "GetOrganizationUsageReply", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -188,23 +179,19 @@ def get_organization_usage_with_http_info( response_types_map=_response_types_map, ) + @validate_call def get_organization_usage_without_preload_content( self, - starting_time: Annotated[ - Optional[datetime], - Field(description="The starting time of the period to get data from"), - ] = None, - ending_time: Annotated[ - Optional[datetime], - Field(description="The ending time of the period to get data from"), - ] = None, + starting_time: Annotated[Optional[datetime], Field(description="The starting time of the period to get data from")] = None, + ending_time: Annotated[Optional[datetime], Field(description="The ending time of the period to get data from")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -238,7 +225,7 @@ def get_organization_usage_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._get_organization_usage_serialize( starting_time=starting_time, @@ -246,17 +233,19 @@ def get_organization_usage_without_preload_content( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "GetOrganizationUsageReply", + '200': "GetOrganizationUsageReply", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) return response_data.response + def _get_organization_usage_serialize( self, starting_time, @@ -269,7 +258,8 @@ def _get_organization_usage_serialize( _host = None - _collection_formats: Dict[str, str] = {} + _collection_formats: Dict[str, str] = { + } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -286,42 +276,50 @@ def _get_organization_usage_serialize( if isinstance(starting_time, datetime): _query_params.append( ( - "starting_time", + 'starting_time', starting_time.strftime( self.api_client.configuration.datetime_format - ), + ) ) ) else: - _query_params.append(("starting_time", starting_time)) - + _query_params.append(('starting_time', starting_time)) + if ending_time is not None: if isinstance(ending_time, datetime): _query_params.append( ( - "ending_time", + 'ending_time', ending_time.strftime( self.api_client.configuration.datetime_format - ), + ) ) ) else: - _query_params.append(("ending_time", ending_time)) - + _query_params.append(('ending_time', ending_time)) + # process the header parameters # process the form parameters # process the body parameter + # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept(["*/*"]) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + '*/*' + ] + ) + # authentication setting - _auth_settings: List[str] = ["Bearer"] + _auth_settings: List[str] = [ + 'Bearer' + ] return self.api_client.param_serialize( - method="GET", - resource_path="/v1/usages", + method='GET', + resource_path='/v1/usages', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -331,46 +329,28 @@ def _get_organization_usage_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth, + _request_auth=_request_auth ) + + + @validate_call def get_organization_usage_details( self, - starting_time: Annotated[ - Optional[datetime], - Field(description="The starting time of the period to get data from"), - ] = None, - ending_time: Annotated[ - Optional[datetime], - Field(description="The ending time of the period to get data from"), - ] = None, - limit: Annotated[ - Optional[StrictStr], - Field(description="(Optional) The number of items to return"), - ] = None, - offset: Annotated[ - Optional[StrictStr], - Field(description="(Optional) The offset in the list of item to return"), - ] = None, - order: Annotated[ - Optional[StrictStr], - Field( - description="(Optional) Sorts the list in the ascending or the descending order" - ), - ] = None, - accept: Annotated[ - Optional[StrictStr], - Field( - description="If defined with the value 'text/csv', a csv file is returned" - ), - ] = None, + starting_time: Annotated[Optional[datetime], Field(description="The starting time of the period to get data from")] = None, + ending_time: Annotated[Optional[datetime], Field(description="The ending time of the period to get data from")] = None, + limit: Annotated[Optional[StrictStr], Field(description="(Optional) The number of items to return")] = None, + offset: Annotated[Optional[StrictStr], Field(description="(Optional) The offset in the list of item to return")] = None, + order: Annotated[Optional[StrictStr], Field(description="(Optional) Sorts the list in the ascending or the descending order")] = None, + accept: Annotated[Optional[StrictStr], Field(description="If defined with the value 'text/csv', a csv file is returned")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -412,7 +392,7 @@ def get_organization_usage_details( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._get_organization_usage_details_serialize( starting_time=starting_time, @@ -424,14 +404,15 @@ def get_organization_usage_details( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "GetOrganizationUsageDetailsReply", + '200': "GetOrganizationUsageDetailsReply", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -439,43 +420,23 @@ def get_organization_usage_details( response_types_map=_response_types_map, ).data + @validate_call def get_organization_usage_details_with_http_info( self, - starting_time: Annotated[ - Optional[datetime], - Field(description="The starting time of the period to get data from"), - ] = None, - ending_time: Annotated[ - Optional[datetime], - Field(description="The ending time of the period to get data from"), - ] = None, - limit: Annotated[ - Optional[StrictStr], - Field(description="(Optional) The number of items to return"), - ] = None, - offset: Annotated[ - Optional[StrictStr], - Field(description="(Optional) The offset in the list of item to return"), - ] = None, - order: Annotated[ - Optional[StrictStr], - Field( - description="(Optional) Sorts the list in the ascending or the descending order" - ), - ] = None, - accept: Annotated[ - Optional[StrictStr], - Field( - description="If defined with the value 'text/csv', a csv file is returned" - ), - ] = None, + starting_time: Annotated[Optional[datetime], Field(description="The starting time of the period to get data from")] = None, + ending_time: Annotated[Optional[datetime], Field(description="The ending time of the period to get data from")] = None, + limit: Annotated[Optional[StrictStr], Field(description="(Optional) The number of items to return")] = None, + offset: Annotated[Optional[StrictStr], Field(description="(Optional) The offset in the list of item to return")] = None, + order: Annotated[Optional[StrictStr], Field(description="(Optional) Sorts the list in the ascending or the descending order")] = None, + accept: Annotated[Optional[StrictStr], Field(description="If defined with the value 'text/csv', a csv file is returned")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -517,7 +478,7 @@ def get_organization_usage_details_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._get_organization_usage_details_serialize( starting_time=starting_time, @@ -529,14 +490,15 @@ def get_organization_usage_details_with_http_info( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "GetOrganizationUsageDetailsReply", + '200': "GetOrganizationUsageDetailsReply", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -544,43 +506,23 @@ def get_organization_usage_details_with_http_info( response_types_map=_response_types_map, ) + @validate_call def get_organization_usage_details_without_preload_content( self, - starting_time: Annotated[ - Optional[datetime], - Field(description="The starting time of the period to get data from"), - ] = None, - ending_time: Annotated[ - Optional[datetime], - Field(description="The ending time of the period to get data from"), - ] = None, - limit: Annotated[ - Optional[StrictStr], - Field(description="(Optional) The number of items to return"), - ] = None, - offset: Annotated[ - Optional[StrictStr], - Field(description="(Optional) The offset in the list of item to return"), - ] = None, - order: Annotated[ - Optional[StrictStr], - Field( - description="(Optional) Sorts the list in the ascending or the descending order" - ), - ] = None, - accept: Annotated[ - Optional[StrictStr], - Field( - description="If defined with the value 'text/csv', a csv file is returned" - ), - ] = None, + starting_time: Annotated[Optional[datetime], Field(description="The starting time of the period to get data from")] = None, + ending_time: Annotated[Optional[datetime], Field(description="The ending time of the period to get data from")] = None, + limit: Annotated[Optional[StrictStr], Field(description="(Optional) The number of items to return")] = None, + offset: Annotated[Optional[StrictStr], Field(description="(Optional) The offset in the list of item to return")] = None, + order: Annotated[Optional[StrictStr], Field(description="(Optional) Sorts the list in the ascending or the descending order")] = None, + accept: Annotated[Optional[StrictStr], Field(description="If defined with the value 'text/csv', a csv file is returned")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -622,7 +564,7 @@ def get_organization_usage_details_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._get_organization_usage_details_serialize( starting_time=starting_time, @@ -634,17 +576,19 @@ def get_organization_usage_details_without_preload_content( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "GetOrganizationUsageDetailsReply", + '200': "GetOrganizationUsageDetailsReply", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) return response_data.response + def _get_organization_usage_details_serialize( self, starting_time, @@ -661,7 +605,8 @@ def _get_organization_usage_details_serialize( _host = None - _collection_formats: Dict[str, str] = {} + _collection_formats: Dict[str, str] = { + } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -678,56 +623,64 @@ def _get_organization_usage_details_serialize( if isinstance(starting_time, datetime): _query_params.append( ( - "starting_time", + 'starting_time', starting_time.strftime( self.api_client.configuration.datetime_format - ), + ) ) ) else: - _query_params.append(("starting_time", starting_time)) - + _query_params.append(('starting_time', starting_time)) + if ending_time is not None: if isinstance(ending_time, datetime): _query_params.append( ( - "ending_time", + 'ending_time', ending_time.strftime( self.api_client.configuration.datetime_format - ), + ) ) ) else: - _query_params.append(("ending_time", ending_time)) - + _query_params.append(('ending_time', ending_time)) + if limit is not None: - - _query_params.append(("limit", limit)) - + + _query_params.append(('limit', limit)) + if offset is not None: - - _query_params.append(("offset", offset)) - + + _query_params.append(('offset', offset)) + if order is not None: - - _query_params.append(("order", order)) - + + _query_params.append(('order', order)) + # process the header parameters if accept is not None: - _header_params["Accept"] = accept + _header_params['Accept'] = accept # process the form parameters # process the body parameter + # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept(["*/*"]) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + '*/*' + ] + ) + # authentication setting - _auth_settings: List[str] = ["Bearer"] + _auth_settings: List[str] = [ + 'Bearer' + ] return self.api_client.param_serialize( - method="GET", - resource_path="/v1/usages/details", + method='GET', + resource_path='/v1/usages/details', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -737,5 +690,7 @@ def _get_organization_usage_details_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth, + _request_auth=_request_auth ) + + diff --git a/koyeb/api/api/users_api.py b/koyeb/api/api/users_api.py index 3ce8edcf..6f4101a8 100644 --- a/koyeb/api/api/users_api.py +++ b/koyeb/api/api/users_api.py @@ -1,16 +1,15 @@ -# coding: utf-8 - """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 + import warnings from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt from typing import Any, Dict, List, Optional, Tuple, Union @@ -37,6 +36,7 @@ def __init__(self, api_client=None) -> None: api_client = ApiClient.get_default() self.api_client = api_client + @validate_call def delete_user( self, @@ -45,8 +45,9 @@ def delete_user( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -78,27 +79,28 @@ def delete_user( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._delete_user_serialize( id=id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "DeleteUserReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "DeleteUserReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -106,6 +108,7 @@ def delete_user( response_types_map=_response_types_map, ).data + @validate_call def delete_user_with_http_info( self, @@ -114,8 +117,9 @@ def delete_user_with_http_info( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -147,27 +151,28 @@ def delete_user_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._delete_user_serialize( id=id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "DeleteUserReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "DeleteUserReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -175,6 +180,7 @@ def delete_user_with_http_info( response_types_map=_response_types_map, ) + @validate_call def delete_user_without_preload_content( self, @@ -183,8 +189,9 @@ def delete_user_without_preload_content( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -216,30 +223,32 @@ def delete_user_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._delete_user_serialize( id=id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "DeleteUserReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "DeleteUserReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) return response_data.response + def _delete_user_serialize( self, id, @@ -251,7 +260,8 @@ def _delete_user_serialize( _host = None - _collection_formats: Dict[str, str] = {} + _collection_formats: Dict[str, str] = { + } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -264,22 +274,30 @@ def _delete_user_serialize( # process the path parameters if id is not None: - _path_params["id"] = id + _path_params['id'] = id # process the query parameters # process the header parameters # process the form parameters # process the body parameter + # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept(["*/*"]) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + '*/*' + ] + ) + # authentication setting - _auth_settings: List[str] = ["Bearer"] + _auth_settings: List[str] = [ + 'Bearer' + ] return self.api_client.param_serialize( - method="DELETE", - resource_path="/v1/users/{id}", + method='DELETE', + resource_path='/v1/users/{id}', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -289,9 +307,12 @@ def _delete_user_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth, + _request_auth=_request_auth ) + + + @validate_call def delete_user_v2( self, @@ -300,8 +321,9 @@ def delete_user_v2( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -333,27 +355,28 @@ def delete_user_v2( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._delete_user_v2_serialize( id=id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "DeleteUserReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "DeleteUserReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -361,6 +384,7 @@ def delete_user_v2( response_types_map=_response_types_map, ).data + @validate_call def delete_user_v2_with_http_info( self, @@ -369,8 +393,9 @@ def delete_user_v2_with_http_info( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -402,27 +427,28 @@ def delete_user_v2_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._delete_user_v2_serialize( id=id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "DeleteUserReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "DeleteUserReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) response_data.read() return self.api_client.response_deserialize( @@ -430,6 +456,7 @@ def delete_user_v2_with_http_info( response_types_map=_response_types_map, ) + @validate_call def delete_user_v2_without_preload_content( self, @@ -438,8 +465,9 @@ def delete_user_v2_without_preload_content( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -471,30 +499,32 @@ def delete_user_v2_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._delete_user_v2_serialize( id=id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "DeleteUserReply", - "400": "ErrorWithFields", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - "503": "Error", + '200': "DeleteUserReply", + '400': "ErrorWithFields", + '401': "Error", + '403': "Error", + '404': "Error", + '500': "Error", + '503': "Error", } response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) return response_data.response + def _delete_user_v2_serialize( self, id, @@ -506,7 +536,8 @@ def _delete_user_v2_serialize( _host = None - _collection_formats: Dict[str, str] = {} + _collection_formats: Dict[str, str] = { + } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -519,22 +550,30 @@ def _delete_user_v2_serialize( # process the path parameters if id is not None: - _path_params["id"] = id + _path_params['id'] = id # process the query parameters # process the header parameters # process the form parameters # process the body parameter + # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept(["*/*"]) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + '*/*' + ] + ) + # authentication setting - _auth_settings: List[str] = ["Bearer"] + _auth_settings: List[str] = [ + 'Bearer' + ] return self.api_client.param_serialize( - method="DELETE", - resource_path="/v2/users/{id}", + method='DELETE', + resource_path='/v2/users/{id}', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -544,5 +583,7 @@ def _delete_user_v2_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth, + _request_auth=_request_auth ) + + diff --git a/koyeb/api/api_client.py b/koyeb/api/api_client.py index 598e726e..1d46542e 100644 --- a/koyeb/api/api_client.py +++ b/koyeb/api/api_client.py @@ -1,17 +1,16 @@ -# coding: utf-8 - """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 + import datetime from dateutil.parser import parse from enum import Enum @@ -38,12 +37,11 @@ UnauthorizedException, ForbiddenException, NotFoundException, - ServiceException, + ServiceException ) RequestSerialized = Tuple[str, str, Dict[str, str], Optional[str], List[str]] - class ApiClient: """Generic API client for OpenAPI client library builds. @@ -62,20 +60,24 @@ class ApiClient: PRIMITIVE_TYPES = (float, bool, bytes, str, int) NATIVE_TYPES_MAPPING = { - "int": int, - "long": int, # TODO remove as only py3 is supported? - "float": float, - "str": str, - "bool": bool, - "date": datetime.date, - "datetime": datetime.datetime, - "decimal": decimal.Decimal, - "object": object, + 'int': int, + 'long': int, # TODO remove as only py3 is supported? + 'float': float, + 'str': str, + 'bool': bool, + 'date': datetime.date, + 'datetime': datetime.datetime, + 'decimal': decimal.Decimal, + 'object': object, } _pool = None def __init__( - self, configuration=None, header_name=None, header_value=None, cookie=None + self, + configuration=None, + header_name=None, + header_value=None, + cookie=None ) -> None: # use default configuration if none is provided if configuration is None: @@ -88,7 +90,7 @@ def __init__( self.default_headers[header_name] = header_value self.cookie = cookie # Set default User-Agent. - self.user_agent = "OpenAPI-Generator/1.3.3/python" + self.user_agent = 'OpenAPI-Generator/1.3.3/python' self.client_side_validation = configuration.client_side_validation def __enter__(self): @@ -100,15 +102,16 @@ def __exit__(self, exc_type, exc_value, traceback): @property def user_agent(self): """User agent for this API client""" - return self.default_headers["User-Agent"] + return self.default_headers['User-Agent'] @user_agent.setter def user_agent(self, value): - self.default_headers["User-Agent"] = value + self.default_headers['User-Agent'] = value def set_default_header(self, header_name, header_value): self.default_headers[header_name] = header_value + _default = None @classmethod @@ -144,12 +147,12 @@ def param_serialize( header_params=None, body=None, post_params=None, - files=None, - auth_settings=None, + files=None, auth_settings=None, collection_formats=None, _host=None, - _request_auth=None, + _request_auth=None ) -> RequestSerialized: + """Builds the HTTP request params needed by the request. :param method: Method to call. :param resource_path: Path to method endpoint. @@ -178,28 +181,35 @@ def param_serialize( header_params = header_params or {} header_params.update(self.default_headers) if self.cookie: - header_params["Cookie"] = self.cookie + header_params['Cookie'] = self.cookie if header_params: header_params = self.sanitize_for_serialization(header_params) header_params = dict( - self.parameters_to_tuples(header_params, collection_formats) + self.parameters_to_tuples(header_params,collection_formats) ) # path parameters if path_params: path_params = self.sanitize_for_serialization(path_params) - path_params = self.parameters_to_tuples(path_params, collection_formats) + path_params = self.parameters_to_tuples( + path_params, + collection_formats + ) for k, v in path_params: # specified safe chars, encode everything resource_path = resource_path.replace( - "{%s}" % k, quote(str(v), safe=config.safe_chars_for_path_param) + '{%s}' % k, + quote(str(v), safe=config.safe_chars_for_path_param) ) # post parameters if post_params or files: post_params = post_params if post_params else [] post_params = self.sanitize_for_serialization(post_params) - post_params = self.parameters_to_tuples(post_params, collection_formats) + post_params = self.parameters_to_tuples( + post_params, + collection_formats + ) if files: post_params.extend(self.files_parameters(files)) @@ -211,7 +221,7 @@ def param_serialize( resource_path, method, body, - request_auth=_request_auth, + request_auth=_request_auth ) # body @@ -228,11 +238,15 @@ def param_serialize( # query parameters if query_params: query_params = self.sanitize_for_serialization(query_params) - url_query = self.parameters_to_url_query(query_params, collection_formats) + url_query = self.parameters_to_url_query( + query_params, + collection_formats + ) url += "?" + url_query return method, url, header_params, body, post_params + def call_api( self, method, @@ -240,7 +254,7 @@ def call_api( header_params=None, body=None, post_params=None, - _request_timeout=None, + _request_timeout=None ) -> rest.RESTResponse: """Makes the HTTP request (synchronous) :param method: Method to call. @@ -257,12 +271,10 @@ def call_api( try: # perform request and return response response_data = self.rest_client.request( - method, - url, + method, url, headers=header_params, - body=body, - post_params=post_params, - _request_timeout=_request_timeout, + body=body, post_params=post_params, + _request_timeout=_request_timeout ) except ApiException as e: @@ -273,7 +285,7 @@ def call_api( def response_deserialize( self, response_data: rest.RESTResponse, - response_types_map: Optional[Dict[str, ApiResponseT]] = None, + response_types_map: Optional[Dict[str, ApiResponseT]]=None ) -> ApiResponse[ApiResponseT]: """Deserializes response into an object. :param response_data: RESTResponse object to be deserialized. @@ -285,34 +297,26 @@ def response_deserialize( assert response_data.data is not None, msg response_type = response_types_map.get(str(response_data.status), None) - if ( - not response_type - and isinstance(response_data.status, int) - and 100 <= response_data.status <= 599 - ): + if not response_type and isinstance(response_data.status, int) and 100 <= response_data.status <= 599: # if not found, look for '1XX', '2XX', etc. - response_type = response_types_map.get( - str(response_data.status)[0] + "XX", None - ) + response_type = response_types_map.get(str(response_data.status)[0] + "XX", None) # deserialize response data response_text = None return_data = None try: - if response_type == "bytearray": + if response_type in ("bytearray", "bytes"): return_data = response_data.data elif response_type == "file": return_data = self.__deserialize_file(response_data) elif response_type is not None: match = None - content_type = response_data.headers.get("content-type") + content_type = response_data.headers.get('content-type') if content_type is not None: match = re.search(r"charset=([a-zA-Z\-\d]+)[\s;]?", content_type) encoding = match.group(1) if match else "utf-8" response_text = response_data.data.decode(encoding) - return_data = self.deserialize( - response_text, response_type, content_type - ) + return_data = self.deserialize(response_text, response_type, content_type) finally: if not 200 <= response_data.status <= 299: raise ApiException.from_response( @@ -322,10 +326,10 @@ def response_deserialize( ) return ApiResponse( - status_code=response_data.status, - data=return_data, - headers=response_data.headers, - raw_data=response_data.data, + status_code = response_data.status, + data = return_data, + headers = response_data.headers, + raw_data = response_data.data ) def sanitize_for_serialization(self, obj): @@ -355,9 +359,13 @@ def sanitize_for_serialization(self, obj): elif isinstance(obj, uuid.UUID): return str(obj) elif isinstance(obj, list): - return [self.sanitize_for_serialization(sub_obj) for sub_obj in obj] + return [ + self.sanitize_for_serialization(sub_obj) for sub_obj in obj + ] elif isinstance(obj, tuple): - return tuple(self.sanitize_for_serialization(sub_obj) for sub_obj in obj) + return tuple( + self.sanitize_for_serialization(sub_obj) for sub_obj in obj + ) elif isinstance(obj, (datetime.datetime, datetime.date)): return obj.isoformat() elif isinstance(obj, decimal.Decimal): @@ -371,7 +379,7 @@ def sanitize_for_serialization(self, obj): # and attributes which value is not None. # Convert attribute name to json key in # model definition for request. - if hasattr(obj, "to_dict") and callable(getattr(obj, "to_dict")): + if hasattr(obj, 'to_dict') and callable(getattr(obj, 'to_dict')): obj_dict = obj.to_dict() else: obj_dict = obj.__dict__ @@ -381,12 +389,11 @@ def sanitize_for_serialization(self, obj): return self.sanitize_for_serialization(obj_dict) return { - key: self.sanitize_for_serialization(val) for key, val in obj_dict.items() + key: self.sanitize_for_serialization(val) + for key, val in obj_dict.items() } - def deserialize( - self, response_text: str, response_type: str, content_type: Optional[str] - ): + def deserialize(self, response_text: str, response_type: str, content_type: Optional[str]): """Deserializes response into an object. :param response: RESTResponse object to be deserialized. @@ -403,20 +410,17 @@ def deserialize( data = json.loads(response_text) except ValueError: data = response_text - elif re.match( - r"^application/(json|[\w!#$&.+\-^_]+\+json)\s*(;|$)", - content_type, - re.IGNORECASE, - ): + elif re.match(r'^application/(json|[\w!#$&.+\-^_]+\+json)\s*(;|$)', content_type, re.IGNORECASE): if response_text == "": data = "" else: data = json.loads(response_text) - elif re.match(r"^text\/[a-z.+-]+\s*(;|$)", content_type, re.IGNORECASE): + elif re.match(r'^text\/[a-z.+-]+\s*(;|$)', content_type, re.IGNORECASE): data = response_text else: raise ApiException( - status=0, reason="Unsupported content type: {0}".format(content_type) + status=0, + reason="Unsupported content type: {0}".format(content_type) ) return self.__deserialize(data, response_type) @@ -433,17 +437,19 @@ def __deserialize(self, data, klass): return None if isinstance(klass, str): - if klass.startswith("List["): - m = re.match(r"List\[(.*)]", klass) + if klass.startswith('List['): + m = re.match(r'List\[(.*)]', klass) assert m is not None, "Malformed List type definition" sub_kls = m.group(1) - return [self.__deserialize(sub_data, sub_kls) for sub_data in data] + return [self.__deserialize(sub_data, sub_kls) + for sub_data in data] - if klass.startswith("Dict["): - m = re.match(r"Dict\[([^,]*), (.*)]", klass) + if klass.startswith('Dict['): + m = re.match(r'Dict\[([^,]*), (.*)]', klass) assert m is not None, "Malformed Dict type definition" sub_kls = m.group(2) - return {k: self.__deserialize(v, sub_kls) for k, v in data.items()} + return {k: self.__deserialize(v, sub_kls) + for k, v in data.items()} # convert str to class if klass in self.NATIVE_TYPES_MAPPING: @@ -479,18 +485,19 @@ def parameters_to_tuples(self, params, collection_formats): for k, v in params.items() if isinstance(params, dict) else params: if k in collection_formats: collection_format = collection_formats[k] - if collection_format == "multi": + if collection_format == 'multi': new_params.extend((k, value) for value in v) else: - if collection_format == "ssv": - delimiter = " " - elif collection_format == "tsv": - delimiter = "\t" - elif collection_format == "pipes": - delimiter = "|" + if collection_format == 'ssv': + delimiter = ' ' + elif collection_format == 'tsv': + delimiter = '\t' + elif collection_format == 'pipes': + delimiter = '|' else: # csv is the default - delimiter = "," - new_params.append((k, delimiter.join(str(value) for value in v))) + delimiter = ',' + new_params.append( + (k, delimiter.join(str(value) for value in v))) else: new_params.append((k, v)) return new_params @@ -515,17 +522,17 @@ def parameters_to_url_query(self, params, collection_formats): if k in collection_formats: collection_format = collection_formats[k] - if collection_format == "multi": + if collection_format == 'multi': new_params.extend((k, quote(str(value))) for value in v) else: - if collection_format == "ssv": - delimiter = " " - elif collection_format == "tsv": - delimiter = "\t" - elif collection_format == "pipes": - delimiter = "|" + if collection_format == 'ssv': + delimiter = ' ' + elif collection_format == 'tsv': + delimiter = '\t' + elif collection_format == 'pipes': + delimiter = '|' else: # csv is the default - delimiter = "," + delimiter = ',' new_params.append( (k, delimiter.join(quote(str(value)) for value in v)) ) @@ -546,7 +553,7 @@ def files_parameters( params = [] for k, v in files.items(): if isinstance(v, str): - with open(v, "rb") as f: + with open(v, 'rb') as f: filename = os.path.basename(f.name) filedata = f.read() elif isinstance(v, bytes): @@ -560,8 +567,13 @@ def files_parameters( continue else: raise ValueError("Unsupported file value") - mimetype = mimetypes.guess_type(filename)[0] or "application/octet-stream" - params.append(tuple([k, tuple([filename, filedata, mimetype])])) + mimetype = ( + mimetypes.guess_type(filename)[0] + or 'application/octet-stream' + ) + params.append( + tuple([k, tuple([filename, filedata, mimetype])]) + ) return params def select_header_accept(self, accepts: List[str]) -> Optional[str]: @@ -574,7 +586,7 @@ def select_header_accept(self, accepts: List[str]) -> Optional[str]: return None for accept in accepts: - if re.search("json", accept, re.IGNORECASE): + if re.search('json', accept, re.IGNORECASE): return accept return accepts[0] @@ -589,7 +601,7 @@ def select_header_content_type(self, content_types): return None for content_type in content_types: - if re.search("json", content_type, re.IGNORECASE): + if re.search('json', content_type, re.IGNORECASE): return content_type return content_types[0] @@ -602,7 +614,7 @@ def update_params_for_auth( resource_path, method, body, - request_auth=None, + request_auth=None ) -> None: """Updates header and query params based on authentication setting. @@ -621,18 +633,34 @@ def update_params_for_auth( if request_auth: self._apply_auth_params( - headers, queries, resource_path, method, body, request_auth + headers, + queries, + resource_path, + method, + body, + request_auth ) else: for auth in auth_settings: auth_setting = self.configuration.auth_settings().get(auth) if auth_setting: self._apply_auth_params( - headers, queries, resource_path, method, body, auth_setting + headers, + queries, + resource_path, + method, + body, + auth_setting ) def _apply_auth_params( - self, headers, queries, resource_path, method, body, auth_setting + self, + headers, + queries, + resource_path, + method, + body, + auth_setting ) -> None: """Updates the request parameters based on a single auth_setting @@ -644,15 +672,17 @@ def _apply_auth_params( The object type is the return value of sanitize_for_serialization(). :param auth_setting: auth settings for the endpoint """ - if auth_setting["in"] == "cookie": - headers["Cookie"] = auth_setting["value"] - elif auth_setting["in"] == "header": - if auth_setting["type"] != "http-signature": - headers[auth_setting["key"]] = auth_setting["value"] - elif auth_setting["in"] == "query": - queries.append((auth_setting["key"], auth_setting["value"])) + if auth_setting['in'] == 'cookie': + headers['Cookie'] = auth_setting['value'] + elif auth_setting['in'] == 'header': + if auth_setting['type'] != 'http-signature': + headers[auth_setting['key']] = auth_setting['value'] + elif auth_setting['in'] == 'query': + queries.append((auth_setting['key'], auth_setting['value'])) else: - raise ApiValueError("Authentication token must be in `query` or `header`") + raise ApiValueError( + 'Authentication token must be in `query` or `header`' + ) def __deserialize_file(self, response): """Deserializes body to file @@ -672,9 +702,14 @@ def __deserialize_file(self, response): content_disposition = response.headers.get("Content-Disposition") if content_disposition: - m = re.search(r'filename=[\'"]?([^\'"\s]+)[\'"]?', content_disposition) + m = re.search( + r'filename=[\'"]?([^\'"\s]+)[\'"]?', + content_disposition + ) assert m is not None, "Unexpected 'content-disposition' header value" - filename = m.group(1) + filename = os.path.basename(m.group(1)) # Strip any directory traversal + if filename in ("", ".", ".."): # fall back to tmp filename + filename = os.path.basename(path) path = os.path.join(os.path.dirname(path), filename) with open(path, "wb") as f: @@ -716,7 +751,8 @@ def __deserialize_date(self, string): return string except ValueError: raise rest.ApiException( - status=0, reason="Failed to parse `{0}` as date object".format(string) + status=0, + reason="Failed to parse `{0}` as date object".format(string) ) def __deserialize_datetime(self, string): @@ -734,7 +770,10 @@ def __deserialize_datetime(self, string): except ValueError: raise rest.ApiException( status=0, - reason=("Failed to parse `{0}` as datetime object".format(string)), + reason=( + "Failed to parse `{0}` as datetime object" + .format(string) + ) ) def __deserialize_enum(self, data, klass): @@ -748,7 +787,11 @@ def __deserialize_enum(self, data, klass): return klass(data) except ValueError: raise rest.ApiException( - status=0, reason=("Failed to parse `{0}` as `{1}`".format(data, klass)) + status=0, + reason=( + "Failed to parse `{0}` as `{1}`" + .format(data, klass) + ) ) def __deserialize_model(self, data, klass): diff --git a/koyeb/api/api_response.py b/koyeb/api/api_response.py index 1ce13729..9bc7c11f 100644 --- a/koyeb/api/api_response.py +++ b/koyeb/api/api_response.py @@ -6,7 +6,6 @@ T = TypeVar("T") - class ApiResponse(BaseModel, Generic[T]): """ API response object @@ -17,4 +16,6 @@ class ApiResponse(BaseModel, Generic[T]): data: T = Field(description="Deserialized data given the data type") raw_data: StrictBytes = Field(description="Raw data (HTTP response body)") - model_config = {"arbitrary_types_allowed": True} + model_config = { + "arbitrary_types_allowed": True + } diff --git a/koyeb/api/configuration.py b/koyeb/api/configuration.py index 8dca8055..f911ed97 100644 --- a/koyeb/api/configuration.py +++ b/koyeb/api/configuration.py @@ -1,14 +1,12 @@ -# coding: utf-8 - """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -25,16 +23,9 @@ JSON_SCHEMA_VALIDATION_KEYWORDS = { - "multipleOf", - "maximum", - "exclusiveMaximum", - "minimum", - "exclusiveMinimum", - "maxLength", - "minLength", - "pattern", - "maxItems", - "minItems", + 'multipleOf', 'maximum', 'exclusiveMaximum', + 'minimum', 'exclusiveMinimum', 'maxLength', + 'minLength', 'pattern', 'maxItems', 'minItems' } ServerVariablesT = Dict[str, str] @@ -141,84 +132,108 @@ class HostSetting(TypedDict): class Configuration: """This class contains various settings of the API client. - :param host: Base url. - :param ignore_operation_servers - Boolean to ignore operation servers for the API client. - Config will use `host` as the base url regardless of the operation servers. - :param api_key: Dict to store API key(s). - Each entry in the dict specifies an API key. - The dict key is the name of the security scheme in the OAS specification. - The dict value is the API key secret. - :param api_key_prefix: Dict to store API prefix (e.g. Bearer). - The dict key is the name of the security scheme in the OAS specification. - The dict value is an API key prefix when generating the auth data. - :param username: Username for HTTP basic authentication. - :param password: Password for HTTP basic authentication. - :param access_token: Access token. - :param server_index: Index to servers configuration. - :param server_variables: Mapping with string values to replace variables in - templated server configuration. The validation of enums is performed for - variables with defined enum values before. - :param server_operation_index: Mapping from operation ID to an index to server - configuration. - :param server_operation_variables: Mapping from operation ID to a mapping with - string values to replace variables in templated server configuration. - The validation of enums is performed for variables with defined enum - values before. - :param ssl_ca_cert: str - the path to a file of concatenated CA certificates - in PEM format. - :param retries: Number of retries for API requests. - :param ca_cert_data: verify the peer using concatenated CA certificate data - in PEM (str) or DER (bytes) format. - :param cert_file: the path to a client certificate file, for mTLS. - :param key_file: the path to a client key file, for mTLS. - - :Example: - - API Key Authentication Example. - Given the following security scheme in the OpenAPI specification: - components: - securitySchemes: - cookieAuth: # name for the security scheme - type: apiKey - in: cookie - name: JSESSIONID # cookie name - - You can programmatically set the cookie: - - conf = koyeb.api.Configuration( - api_key={'cookieAuth': 'abc123'} - api_key_prefix={'cookieAuth': 'JSESSIONID'} - ) - - The following cookie will be added to the HTTP request: - Cookie: JSESSIONID abc123 + :param host: Base url. + :param ignore_operation_servers + Boolean to ignore operation servers for the API client. + Config will use `host` as the base url regardless of the operation servers. + :param api_key: Dict to store API key(s). + Each entry in the dict specifies an API key. + The dict key is the name of the security scheme in the OAS specification. + The dict value is the API key secret. + :param api_key_prefix: Dict to store API prefix (e.g. Bearer). + The dict key is the name of the security scheme in the OAS specification. + The dict value is an API key prefix when generating the auth data. + :param username: Username for HTTP basic authentication. + :param password: Password for HTTP basic authentication. + :param access_token: Access token. + :param server_index: Index to servers configuration. + :param server_variables: Mapping with string values to replace variables in + templated server configuration. The validation of enums is performed for + variables with defined enum values before. + :param server_operation_index: Mapping from operation ID to an index to server + configuration. + :param server_operation_variables: Mapping from operation ID to a mapping with + string values to replace variables in templated server configuration. + The validation of enums is performed for variables with defined enum + values before. + :param verify_ssl: bool - Set this to false to skip verifying SSL certificate + when calling API from https server. + :param ssl_ca_cert: str - the path to a file of concatenated CA certificates + in PEM format. + :param retries: int | urllib3.util.retry.Retry - Retry configuration. + :param ca_cert_data: verify the peer using concatenated CA certificate data + in PEM (str) or DER (bytes) format. + :param cert_file: the path to a client certificate file, for mTLS. + :param key_file: the path to a client key file, for mTLS. + :param assert_hostname: Set this to True/False to enable/disable SSL hostname verification. + :param tls_server_name: SSL/TLS Server Name Indication (SNI). Set this to the SNI value expected by the server. + :param connection_pool_maxsize: Connection pool max size. None in the constructor is coerced to 100 for async and cpu_count * 5 for sync. + :param proxy: Proxy URL. + :param proxy_headers: Proxy headers. + :param safe_chars_for_path_param: Safe characters for path parameter encoding. + :param client_side_validation: Enable client-side validation. Default True. + :param socket_options: Options to pass down to the underlying urllib3 socket. + :param datetime_format: Datetime format string for serialization. + :param date_format: Date format string for serialization. + + :Example: + + API Key Authentication Example. + Given the following security scheme in the OpenAPI specification: + components: + securitySchemes: + cookieAuth: # name for the security scheme + type: apiKey + in: cookie + name: JSESSIONID # cookie name + + You can programmatically set the cookie: + +conf = koyeb.api.Configuration( + api_key={'cookieAuth': 'abc123'} + api_key_prefix={'cookieAuth': 'JSESSIONID'} +) + + The following cookie will be added to the HTTP request: + Cookie: JSESSIONID abc123 """ _default: ClassVar[Optional[Self]] = None def __init__( self, - host: Optional[str] = None, - api_key: Optional[Dict[str, str]] = None, - api_key_prefix: Optional[Dict[str, str]] = None, - username: Optional[str] = None, - password: Optional[str] = None, - access_token: Optional[str] = None, - server_index: Optional[int] = None, - server_variables: Optional[ServerVariablesT] = None, - server_operation_index: Optional[Dict[int, int]] = None, - server_operation_variables: Optional[Dict[int, ServerVariablesT]] = None, - ignore_operation_servers: bool = False, - ssl_ca_cert: Optional[str] = None, - retries: Optional[int] = None, + host: Optional[str]=None, + api_key: Optional[Dict[str, str]]=None, + api_key_prefix: Optional[Dict[str, str]]=None, + username: Optional[str]=None, + password: Optional[str]=None, + access_token: Optional[str]=None, + server_index: Optional[int]=None, + server_variables: Optional[ServerVariablesT]=None, + server_operation_index: Optional[Dict[int, int]]=None, + server_operation_variables: Optional[Dict[int, ServerVariablesT]]=None, + ignore_operation_servers: bool=False, + ssl_ca_cert: Optional[str]=None, + retries: Optional[Union[int, Any]] = None, ca_cert_data: Optional[Union[str, bytes]] = None, - cert_file: Optional[str] = None, - key_file: Optional[str] = None, + cert_file: Optional[str]=None, + key_file: Optional[str]=None, + verify_ssl: bool=True, + assert_hostname: Optional[bool]=None, + tls_server_name: Optional[str]=None, + connection_pool_maxsize: Optional[int]=None, + proxy: Optional[str]=None, + proxy_headers: Optional[Any]=None, + safe_chars_for_path_param: str='', + client_side_validation: bool=True, + socket_options: Optional[Any]=None, + datetime_format: str="%Y-%m-%dT%H:%M:%S.%f%z", + date_format: str="%Y-%m-%d", *, debug: Optional[bool] = None, ) -> None: - """Constructor""" + """Constructor + """ self._base_path = "https://app.koyeb.com" if host is None else host """Default Base url """ @@ -264,7 +279,7 @@ def __init__( """ self.logger["package_logger"] = logging.getLogger("koyeb.api") self.logger["urllib3_logger"] = logging.getLogger("urllib3") - self.logger_format = "%(asctime)s %(levelname)s %(message)s" + self.logger_format = '%(asctime)s %(levelname)s %(message)s' """Log format """ self.logger_stream_handler = None @@ -283,7 +298,7 @@ def __init__( """Debug switch """ - self.verify_ssl = True + self.verify_ssl = verify_ssl """SSL/TLS verification Set this to false to skip verifying SSL certificate when calling API from https server. @@ -301,55 +316,52 @@ def __init__( self.key_file = key_file """client key file """ - self.assert_hostname = None + self.assert_hostname = assert_hostname """Set this to True/False to enable/disable SSL hostname verification. """ - self.tls_server_name = None + self.tls_server_name = tls_server_name """SSL/TLS Server Name Indication (SNI) Set this to the SNI value expected by the server. """ - self.connection_pool_maxsize = multiprocessing.cpu_count() * 5 + self.connection_pool_maxsize = connection_pool_maxsize if connection_pool_maxsize is not None else multiprocessing.cpu_count() * 5 """urllib3 connection pool's maximum number of connections saved - per pool. urllib3 uses 1 connection as default value, but this is - not the best value when you are making a lot of possibly parallel - requests to the same host, which is often the case here. - cpu_count * 5 is used as default value to increase performance. + per pool. None in the constructor is coerced to cpu_count * 5. """ - self.proxy: Optional[str] = None + self.proxy = proxy """Proxy URL """ - self.proxy_headers = None + self.proxy_headers = proxy_headers """Proxy headers """ - self.safe_chars_for_path_param = "" + self.safe_chars_for_path_param = safe_chars_for_path_param """Safe chars for path_param """ self.retries = retries - """Adding retries to override urllib3 default value 3 + """Retry configuration """ # Enable client side validation - self.client_side_validation = True + self.client_side_validation = client_side_validation - self.socket_options = None + self.socket_options = socket_options """Options to pass down to the underlying urllib3 socket """ - self.datetime_format = "%Y-%m-%dT%H:%M:%S.%f%z" + self.datetime_format = datetime_format """datetime format """ - self.date_format = "%Y-%m-%d" + self.date_format = date_format """date format """ - def __deepcopy__(self, memo: Dict[int, Any]) -> Self: + def __deepcopy__(self, memo: Dict[int, Any]) -> Self: cls = self.__class__ result = cls.__new__(cls) memo[id(self)] = result for k, v in self.__dict__.items(): - if k not in ("logger", "logger_file_handler"): + if k not in ('logger', 'logger_file_handler'): setattr(result, k, copy.deepcopy(v, memo)) # shallow copy of loggers result.logger = copy.copy(self.logger) @@ -481,9 +493,7 @@ def logger_format(self, value: str) -> None: self.__logger_format = value self.logger_formatter = logging.Formatter(self.__logger_format) - def get_api_key_with_prefix( - self, identifier: str, alias: Optional[str] = None - ) -> Optional[str]: + def get_api_key_with_prefix(self, identifier: str, alias: Optional[str]=None) -> Optional[str]: """Gets API key (with prefix if set). :param identifier: The identifier of apiKey. @@ -492,9 +502,7 @@ def get_api_key_with_prefix( """ if self.refresh_api_key_hook is not None: self.refresh_api_key_hook(self) - key = self.api_key.get( - identifier, self.api_key.get(alias) if alias is not None else None - ) + key = self.api_key.get(identifier, self.api_key.get(alias) if alias is not None else None) if key: prefix = self.api_key_prefix.get(identifier) if prefix: @@ -516,23 +524,23 @@ def get_basic_auth_token(self) -> Optional[str]: if self.password is not None: password = self.password - return urllib3.util.make_headers(basic_auth=username + ":" + password).get( - "authorization" - ) + return urllib3.util.make_headers( + basic_auth=username + ':' + password + ).get('authorization') - def auth_settings(self) -> AuthSettings: + def auth_settings(self)-> AuthSettings: """Gets Auth Settings dict for api client. :return: The Auth Settings information dict. """ auth: AuthSettings = {} - if "Bearer" in self.api_key: - auth["Bearer"] = { - "type": "api_key", - "in": "header", - "key": "Authorization", - "value": self.get_api_key_with_prefix( - "Bearer", + if 'Bearer' in self.api_key: + auth['Bearer'] = { + 'type': 'api_key', + 'in': 'header', + 'key': 'Authorization', + 'value': self.get_api_key_with_prefix( + 'Bearer', ), } return auth @@ -542,13 +550,12 @@ def to_debug_report(self) -> str: :return: The report for debugging. """ - return ( - "Python SDK Debug Report:\n" - "OS: {env}\n" - "Python Version: {pyversion}\n" - "Version of the API: 1.0.0\n" - "SDK Package Version: 1.3.3".format(env=sys.platform, pyversion=sys.version) - ) + return "Python SDK Debug Report:\n"\ + "OS: {env}\n"\ + "Python Version: {pyversion}\n"\ + "Version of the API: 1.0.0\n"\ + "SDK Package Version: 1.3.3".\ + format(env=sys.platform, pyversion=sys.version) def get_host_settings(self) -> List[HostSetting]: """Gets an array of host settings @@ -557,16 +564,16 @@ def get_host_settings(self) -> List[HostSetting]: """ return [ { - "url": "https://app.koyeb.com", - "description": "No description provided", + 'url': "https://app.koyeb.com", + 'description': "No description provided", } ] def get_host_from_settings( self, index: Optional[int], - variables: Optional[ServerVariablesT] = None, - servers: Optional[List[HostSetting]] = None, + variables: Optional[ServerVariablesT]=None, + servers: Optional[List[HostSetting]]=None, ) -> str: """Gets host URL based on the index and variables :param index: array index of the host settings @@ -585,26 +592,23 @@ def get_host_from_settings( except IndexError: raise ValueError( "Invalid index {0} when selecting the host settings. " - "Must be less than {1}".format(index, len(servers)) - ) + "Must be less than {1}".format(index, len(servers))) - url = server["url"] + url = server['url'] # go through variables and replace placeholders - for variable_name, variable in server.get("variables", {}).items(): - used_value = variables.get(variable_name, variable["default_value"]) - - if ( - "enum_values" in variable - and variable["enum_values"] - and used_value not in variable["enum_values"] - ): + for variable_name, variable in server.get('variables', {}).items(): + used_value = variables.get( + variable_name, variable['default_value']) + + if 'enum_values' in variable \ + and variable['enum_values'] \ + and used_value not in variable['enum_values']: raise ValueError( "The variable `{0}` in the host URL has invalid value " "{1}. Must be {2}.".format( - variable_name, variables[variable_name], variable["enum_values"] - ) - ) + variable_name, variables[variable_name], + variable['enum_values'])) url = url.replace("{" + variable_name + "}", used_value) @@ -613,9 +617,7 @@ def get_host_from_settings( @property def host(self) -> str: """Return generated host.""" - return self.get_host_from_settings( - self.server_index, variables=self.server_variables - ) + return self.get_host_from_settings(self.server_index, variables=self.server_variables) @host.setter def host(self, value: str) -> None: diff --git a/koyeb/api/docs/AppsApi.md b/koyeb/api/docs/AppsApi.md index 3ebe940d..1d849dd6 100644 --- a/koyeb/api/docs/AppsApi.md +++ b/koyeb/api/docs/AppsApi.md @@ -362,7 +362,7 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **list_apps** -> ListAppsReply list_apps(limit=limit, offset=offset, name=name) +> ListAppsReply list_apps(limit=limit, offset=offset, name=name, project_id=project_id) List App @@ -400,10 +400,11 @@ with koyeb.api.ApiClient(configuration) as api_client: limit = 'limit_example' # str | (Optional) The number of items to return (optional) offset = 'offset_example' # str | (Optional) The offset in the list of item to return (optional) name = 'name_example' # str | (Optional) A filter for name (optional) + project_id = 'project_id_example' # str | (Optional) A filter for the project ID (optional) try: # List App - api_response = api_instance.list_apps(limit=limit, offset=offset, name=name) + api_response = api_instance.list_apps(limit=limit, offset=offset, name=name, project_id=project_id) print("The response of AppsApi->list_apps:\n") pprint(api_response) except Exception as e: @@ -420,6 +421,7 @@ Name | Type | Description | Notes **limit** | **str**| (Optional) The number of items to return | [optional] **offset** | **str**| (Optional) The offset in the list of item to return | [optional] **name** | **str**| (Optional) A filter for name | [optional] + **project_id** | **str**| (Optional) A filter for the project ID | [optional] ### Return type diff --git a/koyeb/api/docs/BasicAuthPolicy.md b/koyeb/api/docs/BasicAuthPolicy.md new file mode 100644 index 00000000..2e7c2395 --- /dev/null +++ b/koyeb/api/docs/BasicAuthPolicy.md @@ -0,0 +1,30 @@ +# BasicAuthPolicy + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**username** | **str** | | [optional] +**password** | **str** | | [optional] + +## Example + +```python +from koyeb.api.models.basic_auth_policy import BasicAuthPolicy + +# TODO update the JSON string below +json = "{}" +# create an instance of BasicAuthPolicy from a JSON string +basic_auth_policy_instance = BasicAuthPolicy.from_json(json) +# print the JSON string representation of the object +print(BasicAuthPolicy.to_json()) + +# convert the object into a dict +basic_auth_policy_dict = basic_auth_policy_instance.to_dict() +# create an instance of BasicAuthPolicy from a dict +basic_auth_policy_from_dict = BasicAuthPolicy.from_dict(basic_auth_policy_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/koyeb/api/docs/CheckCouponReply.md b/koyeb/api/docs/CheckCouponReply.md new file mode 100644 index 00000000..ff5064a6 --- /dev/null +++ b/koyeb/api/docs/CheckCouponReply.md @@ -0,0 +1,32 @@ +# CheckCouponReply + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **str** | | [optional] +**percent_off** | **float** | | [optional] +**amount_off** | **str** | | [optional] +**currency** | **str** | | [optional] + +## Example + +```python +from koyeb.api.models.check_coupon_reply import CheckCouponReply + +# TODO update the JSON string below +json = "{}" +# create an instance of CheckCouponReply from a JSON string +check_coupon_reply_instance = CheckCouponReply.from_json(json) +# print the JSON string representation of the object +print(CheckCouponReply.to_json()) + +# convert the object into a dict +check_coupon_reply_dict = check_coupon_reply_instance.to_dict() +# create an instance of CheckCouponReply from a dict +check_coupon_reply_from_dict = CheckCouponReply.from_dict(check_coupon_reply_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/koyeb/api/docs/CouponsApi.md b/koyeb/api/docs/CouponsApi.md index 9a4de30c..beba1742 100644 --- a/koyeb/api/docs/CouponsApi.md +++ b/koyeb/api/docs/CouponsApi.md @@ -4,9 +4,96 @@ All URIs are relative to *https://app.koyeb.com* Method | HTTP request | Description ------------- | ------------- | ------------- +[**check_coupon**](CouponsApi.md#check_coupon) | **GET** /v1/coupons/{code} | Check Coupon [**redeem_coupon**](CouponsApi.md#redeem_coupon) | **POST** /v1/coupons | Redeem Coupon +# **check_coupon** +> CheckCouponReply check_coupon(code) + +Check Coupon + +This API allows to check if a given coupon is valid. It is heavily rate-limited. + +### Example + +* Api Key Authentication (Bearer): + +```python +import koyeb.api +from koyeb.api.models.check_coupon_reply import CheckCouponReply +from koyeb.api.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://app.koyeb.com +# See configuration.py for a list of all supported configuration parameters. +configuration = koyeb.api.Configuration( + host = "https://app.koyeb.com" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +with koyeb.api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = koyeb.api.CouponsApi(api_client) + code = 'code_example' # str | + + try: + # Check Coupon + api_response = api_instance.check_coupon(code) + print("The response of CouponsApi->check_coupon:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling CouponsApi->check_coupon: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **code** | **str**| | + +### Return type + +[**CheckCouponReply**](CheckCouponReply.md) + +### Authorization + +[Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: */* + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | A successful response. | - | +**400** | Validation error | - | +**401** | Returned when the token is not valid. | - | +**403** | Returned when the user does not have permission to access the resource. | - | +**404** | Returned when the resource does not exist. | - | +**500** | Returned in case of server error. | - | +**503** | Service is unavailable. | - | +**0** | An unexpected error response. | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + # **redeem_coupon** > object redeem_coupon(body) diff --git a/koyeb/api/docs/CreateApp.md b/koyeb/api/docs/CreateApp.md index cf0ed00f..75c8a41c 100644 --- a/koyeb/api/docs/CreateApp.md +++ b/koyeb/api/docs/CreateApp.md @@ -7,6 +7,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **name** | **str** | | [optional] **life_cycle** | [**AppLifeCycle**](AppLifeCycle.md) | | [optional] +**project_id** | **str** | | [optional] ## Example diff --git a/koyeb/api/docs/CreateArchive.md b/koyeb/api/docs/CreateArchive.md index a8aab2d1..b3d475f1 100644 --- a/koyeb/api/docs/CreateArchive.md +++ b/koyeb/api/docs/CreateArchive.md @@ -6,6 +6,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **size** | **str** | How much space to provision for the archive, in bytes. | [optional] +**project_id** | **str** | | [optional] ## Example diff --git a/koyeb/api/docs/CreateDomain.md b/koyeb/api/docs/CreateDomain.md index d4ee6716..28316d78 100644 --- a/koyeb/api/docs/CreateDomain.md +++ b/koyeb/api/docs/CreateDomain.md @@ -10,6 +10,7 @@ Name | Type | Description | Notes **app_id** | **str** | | [optional] **cloudflare** | **object** | | [optional] **koyeb** | [**DomainLoadBalancerKoyeb**](DomainLoadBalancerKoyeb.md) | | [optional] +**project_id** | **str** | | [optional] ## Example diff --git a/koyeb/api/docs/CreatePersistentVolumeRequest.md b/koyeb/api/docs/CreatePersistentVolumeRequest.md index 4a681a52..f632c63f 100644 --- a/koyeb/api/docs/CreatePersistentVolumeRequest.md +++ b/koyeb/api/docs/CreatePersistentVolumeRequest.md @@ -11,6 +11,7 @@ Name | Type | Description | Notes **read_only** | **bool** | | [optional] **max_size** | **int** | | [optional] **snapshot_id** | **str** | | [optional] +**project_id** | **str** | | [optional] ## Example diff --git a/koyeb/api/docs/CreateProject.md b/koyeb/api/docs/CreateProject.md new file mode 100644 index 00000000..3d978606 --- /dev/null +++ b/koyeb/api/docs/CreateProject.md @@ -0,0 +1,30 @@ +# CreateProject + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **str** | | [optional] +**description** | **str** | | [optional] + +## Example + +```python +from koyeb.api.models.create_project import CreateProject + +# TODO update the JSON string below +json = "{}" +# create an instance of CreateProject from a JSON string +create_project_instance = CreateProject.from_json(json) +# print the JSON string representation of the object +print(CreateProject.to_json()) + +# convert the object into a dict +create_project_dict = create_project_instance.to_dict() +# create an instance of CreateProject from a dict +create_project_from_dict = CreateProject.from_dict(create_project_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/koyeb/api/docs/CreateProjectReply.md b/koyeb/api/docs/CreateProjectReply.md new file mode 100644 index 00000000..8f2819f8 --- /dev/null +++ b/koyeb/api/docs/CreateProjectReply.md @@ -0,0 +1,29 @@ +# CreateProjectReply + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**project** | [**Project**](Project.md) | | [optional] + +## Example + +```python +from koyeb.api.models.create_project_reply import CreateProjectReply + +# TODO update the JSON string below +json = "{}" +# create an instance of CreateProjectReply from a JSON string +create_project_reply_instance = CreateProjectReply.from_json(json) +# print the JSON string representation of the object +print(CreateProjectReply.to_json()) + +# convert the object into a dict +create_project_reply_dict = create_project_reply_instance.to_dict() +# create an instance of CreateProjectReply from a dict +create_project_reply_from_dict = CreateProjectReply.from_dict(create_project_reply_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/koyeb/api/docs/CreateSecret.md b/koyeb/api/docs/CreateSecret.md index dceb69b2..9016836c 100644 --- a/koyeb/api/docs/CreateSecret.md +++ b/koyeb/api/docs/CreateSecret.md @@ -15,6 +15,7 @@ Name | Type | Description | Notes **gitlab_registry** | [**GitLabRegistryConfiguration**](GitLabRegistryConfiguration.md) | | [optional] **gcp_container_registry** | [**GCPContainerRegistryConfiguration**](GCPContainerRegistryConfiguration.md) | | [optional] **azure_container_registry** | [**AzureContainerRegistryConfiguration**](AzureContainerRegistryConfiguration.md) | | [optional] +**project_id** | **str** | | [optional] ## Example diff --git a/koyeb/api/docs/CreateService.md b/koyeb/api/docs/CreateService.md index d803ca03..fc96580c 100644 --- a/koyeb/api/docs/CreateService.md +++ b/koyeb/api/docs/CreateService.md @@ -8,6 +8,7 @@ Name | Type | Description | Notes **app_id** | **str** | | [optional] **definition** | [**DeploymentDefinition**](DeploymentDefinition.md) | | [optional] **life_cycle** | [**ServiceLifeCycle**](ServiceLifeCycle.md) | | [optional] +**project_id** | **str** | | [optional] ## Example diff --git a/koyeb/api/docs/CreateSnapshotRequest.md b/koyeb/api/docs/CreateSnapshotRequest.md index 473999ce..f37363fc 100644 --- a/koyeb/api/docs/CreateSnapshotRequest.md +++ b/koyeb/api/docs/CreateSnapshotRequest.md @@ -7,6 +7,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **parent_volume_id** | **str** | | [optional] **name** | **str** | | [optional] +**project_id** | **str** | | [optional] ## Example diff --git a/koyeb/api/docs/DeploymentMetadata.md b/koyeb/api/docs/DeploymentMetadata.md index 74302a25..c54dc970 100644 --- a/koyeb/api/docs/DeploymentMetadata.md +++ b/koyeb/api/docs/DeploymentMetadata.md @@ -10,6 +10,7 @@ Name | Type | Description | Notes **git** | [**GitDeploymentMetadata**](GitDeploymentMetadata.md) | | [optional] **archive** | [**ArchiveDeploymentMetadata**](ArchiveDeploymentMetadata.md) | | [optional] **proxy_ports** | [**List[DeploymentProxyPortMetadata]**](DeploymentProxyPortMetadata.md) | | [optional] +**sandbox** | [**SandboxMetadata**](SandboxMetadata.md) | | [optional] ## Example diff --git a/koyeb/api/docs/DeploymentRoute.md b/koyeb/api/docs/DeploymentRoute.md index 85b084ef..543c54fa 100644 --- a/koyeb/api/docs/DeploymentRoute.md +++ b/koyeb/api/docs/DeploymentRoute.md @@ -7,6 +7,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **port** | **int** | | [optional] **path** | **str** | | [optional] +**security_policies** | [**SecurityPolicies**](SecurityPolicies.md) | | [optional] ## Example diff --git a/koyeb/api/docs/DeploymentStrategyType.md b/koyeb/api/docs/DeploymentStrategyType.md index 56de9212..05fb2aaf 100644 --- a/koyeb/api/docs/DeploymentStrategyType.md +++ b/koyeb/api/docs/DeploymentStrategyType.md @@ -1,11 +1,13 @@ # DeploymentStrategyType - - DEPLOYMENT_STRATEGY_TYPE_INVALID: Invalid / Zero value. - DEPLOYMENT_STRATEGY_TYPE_CANARY: Use canary strategy. - DEPLOYMENT_STRATEGY_TYPE_ROLLING: Use rolling strategy. - DEPLOYMENT_STRATEGY_TYPE_BLUE_GREEN: Use blue green strategy. - DEPLOYMENT_STRATEGY_TYPE_IMMEDIATE: Use immediate strategy. + - DEPLOYMENT_STRATEGY_TYPE_INVALID: DEPRECATED: Use DEPLOYMENT_STRATEGY_TYPE_DEFAULT instead. - DEPLOYMENT_STRATEGY_TYPE_DEFAULT: Default/unspecified strategy (resolves to platform default, currently ROLLING). - DEPLOYMENT_STRATEGY_TYPE_CANARY: Use canary strategy. - DEPLOYMENT_STRATEGY_TYPE_ROLLING: Use rolling strategy. - DEPLOYMENT_STRATEGY_TYPE_BLUE_GREEN: Use blue green strategy. - DEPLOYMENT_STRATEGY_TYPE_IMMEDIATE: Use immediate strategy. ## Enum * `DEPLOYMENT_STRATEGY_TYPE_INVALID` (value: `'DEPLOYMENT_STRATEGY_TYPE_INVALID'`) +* `DEPLOYMENT_STRATEGY_TYPE_DEFAULT` (value: `'DEPLOYMENT_STRATEGY_TYPE_DEFAULT'`) + * `DEPLOYMENT_STRATEGY_TYPE_CANARY` (value: `'DEPLOYMENT_STRATEGY_TYPE_CANARY'`) * `DEPLOYMENT_STRATEGY_TYPE_ROLLING` (value: `'DEPLOYMENT_STRATEGY_TYPE_ROLLING'`) diff --git a/koyeb/api/docs/Domain.md b/koyeb/api/docs/Domain.md index ea07fdfa..9e685e05 100644 --- a/koyeb/api/docs/Domain.md +++ b/koyeb/api/docs/Domain.md @@ -20,6 +20,7 @@ Name | Type | Description | Notes **version** | **str** | | [optional] **cloudflare** | **object** | | [optional] **koyeb** | [**DomainLoadBalancerKoyeb**](DomainLoadBalancerKoyeb.md) | | [optional] +**project_id** | **str** | The project ID this domain belongs to. Empty if the domain is organization-level. | [optional] ## Example diff --git a/koyeb/api/docs/DomainsApi.md b/koyeb/api/docs/DomainsApi.md index c499179e..1ae9fd39 100644 --- a/koyeb/api/docs/DomainsApi.md +++ b/koyeb/api/docs/DomainsApi.md @@ -265,7 +265,7 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **list_domains** -> ListDomainsReply list_domains(limit=limit, offset=offset, types=types, statuses=statuses, app_ids=app_ids, name=name) +> ListDomainsReply list_domains(limit=limit, offset=offset, types=types, statuses=statuses, app_ids=app_ids, name=name, project_id=project_id) List Domains @@ -306,10 +306,11 @@ with koyeb.api.ApiClient(configuration) as api_client: statuses = ['statuses_example'] # List[str] | (Optional) A filter for statuses (optional) app_ids = ['app_ids_example'] # List[str] | (Optional) A filter for apps (optional) name = 'name_example' # str | (Optional) A filter for name (optional) + project_id = 'project_id_example' # str | (Optional) A filter for the project ID (optional) try: # List Domains - api_response = api_instance.list_domains(limit=limit, offset=offset, types=types, statuses=statuses, app_ids=app_ids, name=name) + api_response = api_instance.list_domains(limit=limit, offset=offset, types=types, statuses=statuses, app_ids=app_ids, name=name, project_id=project_id) print("The response of DomainsApi->list_domains:\n") pprint(api_response) except Exception as e: @@ -329,6 +330,7 @@ Name | Type | Description | Notes **statuses** | [**List[str]**](str.md)| (Optional) A filter for statuses | [optional] **app_ids** | [**List[str]**](str.md)| (Optional) A filter for apps | [optional] **name** | **str**| (Optional) A filter for name | [optional] + **project_id** | **str**| (Optional) A filter for the project ID | [optional] ### Return type diff --git a/koyeb/api/docs/ExecCommandIO.md b/koyeb/api/docs/ExecCommandIO.md index 8396d646..e1c826ec 100644 --- a/koyeb/api/docs/ExecCommandIO.md +++ b/koyeb/api/docs/ExecCommandIO.md @@ -5,7 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**data** | **bytearray** | Data is base64 encoded | [optional] +**data** | **bytes** | Data is base64 encoded | [optional] **close** | **bool** | Indicate last data frame | [optional] ## Example diff --git a/koyeb/api/docs/GetProjectReply.md b/koyeb/api/docs/GetProjectReply.md new file mode 100644 index 00000000..9fa95873 --- /dev/null +++ b/koyeb/api/docs/GetProjectReply.md @@ -0,0 +1,29 @@ +# GetProjectReply + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**project** | [**Project**](Project.md) | | [optional] + +## Example + +```python +from koyeb.api.models.get_project_reply import GetProjectReply + +# TODO update the JSON string below +json = "{}" +# create an instance of GetProjectReply from a JSON string +get_project_reply_instance = GetProjectReply.from_json(json) +# print the JSON string representation of the object +print(GetProjectReply.to_json()) + +# convert the object into a dict +get_project_reply_dict = get_project_reply_instance.to_dict() +# create an instance of GetProjectReply from a dict +get_project_reply_from_dict = GetProjectReply.from_dict(get_project_reply_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/koyeb/api/docs/GetServiceScalingReply.md b/koyeb/api/docs/GetServiceScalingReply.md new file mode 100644 index 00000000..12d7f931 --- /dev/null +++ b/koyeb/api/docs/GetServiceScalingReply.md @@ -0,0 +1,29 @@ +# GetServiceScalingReply + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**scalings** | [**List[ManualServiceScaling]**](ManualServiceScaling.md) | | [optional] + +## Example + +```python +from koyeb.api.models.get_service_scaling_reply import GetServiceScalingReply + +# TODO update the JSON string below +json = "{}" +# create an instance of GetServiceScalingReply from a JSON string +get_service_scaling_reply_instance = GetServiceScalingReply.from_json(json) +# print the JSON string representation of the object +print(GetServiceScalingReply.to_json()) + +# convert the object into a dict +get_service_scaling_reply_dict = get_service_scaling_reply_instance.to_dict() +# create an instance of GetServiceScalingReply from a dict +get_service_scaling_reply_from_dict = GetServiceScalingReply.from_dict(get_service_scaling_reply_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/koyeb/api/docs/InstancesApi.md b/koyeb/api/docs/InstancesApi.md index 2bc0db5d..b9854571 100644 --- a/koyeb/api/docs/InstancesApi.md +++ b/koyeb/api/docs/InstancesApi.md @@ -52,7 +52,7 @@ with koyeb.api.ApiClient(configuration) as api_client: body_command = ['body_command_example'] # List[str] | Command to exec. Mandatory in the first frame sent (optional) body_tty_size_height = 56 # int | (optional) body_tty_size_width = 56 # int | (optional) - body_stdin_data = None # bytearray | Data is base64 encoded (optional) + body_stdin_data = None # bytes | Data is base64 encoded (optional) body_stdin_close = True # bool | Indicate last data frame (optional) body_disable_tty = True # bool | Disable TTY. It's enough to specify it in the first frame (optional) id_type = INVALID # str | When specified, it is used to determine if the kind of resource the id refers to. If missing, defaults to the instance id. (optional) (default to INVALID) @@ -77,7 +77,7 @@ Name | Type | Description | Notes **body_command** | [**List[str]**](str.md)| Command to exec. Mandatory in the first frame sent | [optional] **body_tty_size_height** | **int**| | [optional] **body_tty_size_width** | **int**| | [optional] - **body_stdin_data** | **bytearray**| Data is base64 encoded | [optional] + **body_stdin_data** | **bytes**| Data is base64 encoded | [optional] **body_stdin_close** | **bool**| Indicate last data frame | [optional] **body_disable_tty** | **bool**| Disable TTY. It's enough to specify it in the first frame | [optional] **id_type** | **str**| When specified, it is used to determine if the kind of resource the id refers to. If missing, defaults to the instance id. | [optional] [default to INVALID] diff --git a/koyeb/api/docs/LifecycleQuotas.md b/koyeb/api/docs/LifecycleQuotas.md new file mode 100644 index 00000000..7455a7a1 --- /dev/null +++ b/koyeb/api/docs/LifecycleQuotas.md @@ -0,0 +1,32 @@ +# LifecycleQuotas + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**delete_after_sleep_min** | **int** | | [optional] +**delete_after_sleep_max** | **int** | | [optional] +**delete_after_create_min** | **int** | | [optional] +**delete_after_create_max** | **int** | | [optional] + +## Example + +```python +from koyeb.api.models.lifecycle_quotas import LifecycleQuotas + +# TODO update the JSON string below +json = "{}" +# create an instance of LifecycleQuotas from a JSON string +lifecycle_quotas_instance = LifecycleQuotas.from_json(json) +# print the JSON string representation of the object +print(LifecycleQuotas.to_json()) + +# convert the object into a dict +lifecycle_quotas_dict = lifecycle_quotas_instance.to_dict() +# create an instance of LifecycleQuotas from a dict +lifecycle_quotas_from_dict = LifecycleQuotas.from_dict(lifecycle_quotas_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/koyeb/api/docs/ListProjectsReply.md b/koyeb/api/docs/ListProjectsReply.md new file mode 100644 index 00000000..0b6dee55 --- /dev/null +++ b/koyeb/api/docs/ListProjectsReply.md @@ -0,0 +1,31 @@ +# ListProjectsReply + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**projects** | [**List[Project]**](Project.md) | | [optional] +**limit** | **int** | | [optional] +**offset** | **int** | | [optional] + +## Example + +```python +from koyeb.api.models.list_projects_reply import ListProjectsReply + +# TODO update the JSON string below +json = "{}" +# create an instance of ListProjectsReply from a JSON string +list_projects_reply_instance = ListProjectsReply.from_json(json) +# print the JSON string representation of the object +print(ListProjectsReply.to_json()) + +# convert the object into a dict +list_projects_reply_dict = list_projects_reply_instance.to_dict() +# create an instance of ListProjectsReply from a dict +list_projects_reply_from_dict = ListProjectsReply.from_dict(list_projects_reply_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/koyeb/api/docs/ManualServiceScaling.md b/koyeb/api/docs/ManualServiceScaling.md new file mode 100644 index 00000000..55096362 --- /dev/null +++ b/koyeb/api/docs/ManualServiceScaling.md @@ -0,0 +1,30 @@ +# ManualServiceScaling + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**scopes** | **List[str]** | | [optional] +**instances** | **int** | | [optional] + +## Example + +```python +from koyeb.api.models.manual_service_scaling import ManualServiceScaling + +# TODO update the JSON string below +json = "{}" +# create an instance of ManualServiceScaling from a JSON string +manual_service_scaling_instance = ManualServiceScaling.from_json(json) +# print the JSON string representation of the object +print(ManualServiceScaling.to_json()) + +# convert the object into a dict +manual_service_scaling_dict = manual_service_scaling_instance.to_dict() +# create an instance of ManualServiceScaling from a dict +manual_service_scaling_from_dict = ManualServiceScaling.from_dict(manual_service_scaling_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/koyeb/api/docs/Organization.md b/koyeb/api/docs/Organization.md index 5ddaf0fe..d8f77295 100644 --- a/koyeb/api/docs/Organization.md +++ b/koyeb/api/docs/Organization.md @@ -36,6 +36,7 @@ Name | Type | Description | Notes **trial_starts_at** | **datetime** | | [optional] **trial_ends_at** | **datetime** | | [optional] **email_domain_allowlist** | **List[str]** | | [optional] +**default_project_id** | **str** | | [optional] ## Example diff --git a/koyeb/api/docs/OrganizationApi.md b/koyeb/api/docs/OrganizationApi.md index 3c966511..79e4a7ac 100644 --- a/koyeb/api/docs/OrganizationApi.md +++ b/koyeb/api/docs/OrganizationApi.md @@ -20,7 +20,8 @@ Method | HTTP request | Description [**update_budget**](OrganizationApi.md#update_budget) | **PUT** /v1/organizations/{organization_id}/budget | Update Budget [**update_organization**](OrganizationApi.md#update_organization) | **PUT** /v1/organizations/{id} | Update Organization [**update_organization2**](OrganizationApi.md#update_organization2) | **PATCH** /v1/organizations/{id} | Update Organization -[**update_organization_name**](OrganizationApi.md#update_organization_name) | **PUT** /v1/organizations/{id}/name | Update Organization +[**update_organization_default_project**](OrganizationApi.md#update_organization_default_project) | **PUT** /v1/organizations/{id}/default_project | Update Organization's default project +[**update_organization_name**](OrganizationApi.md#update_organization_name) | **PUT** /v1/organizations/{id}/name | Update Organization Name [**update_organization_plan**](OrganizationApi.md#update_organization_plan) | **POST** /v1/organizations/{id}/plan | Update Organization plan [**upsert_signup_qualification**](OrganizationApi.md#upsert_signup_qualification) | **POST** /v1/organizations/{id}/signup_qualification | Upsert Organization's signup qualification @@ -1411,10 +1412,97 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **update_organization_default_project** +> UpdateOrganizationDefaultProjectReply update_organization_default_project(id, body) + +Update Organization's default project + +### Example + +* Api Key Authentication (Bearer): + +```python +import koyeb.api +from koyeb.api.models.update_organization_default_project_reply import UpdateOrganizationDefaultProjectReply +from koyeb.api.models.update_organization_default_project_request import UpdateOrganizationDefaultProjectRequest +from koyeb.api.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://app.koyeb.com +# See configuration.py for a list of all supported configuration parameters. +configuration = koyeb.api.Configuration( + host = "https://app.koyeb.com" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +with koyeb.api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = koyeb.api.OrganizationApi(api_client) + id = 'id_example' # str | + body = koyeb.api.UpdateOrganizationDefaultProjectRequest() # UpdateOrganizationDefaultProjectRequest | + + try: + # Update Organization's default project + api_response = api_instance.update_organization_default_project(id, body) + print("The response of OrganizationApi->update_organization_default_project:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling OrganizationApi->update_organization_default_project: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| | + **body** | [**UpdateOrganizationDefaultProjectRequest**](UpdateOrganizationDefaultProjectRequest.md)| | + +### Return type + +[**UpdateOrganizationDefaultProjectReply**](UpdateOrganizationDefaultProjectReply.md) + +### Authorization + +[Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: */* + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | A successful response. | - | +**400** | Validation error | - | +**401** | Returned when the token is not valid. | - | +**403** | Returned when the user does not have permission to access the resource. | - | +**404** | Returned when the resource does not exist. | - | +**500** | Returned in case of server error. | - | +**503** | Service is unavailable. | - | +**0** | An unexpected error response. | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + # **update_organization_name** > UpdateOrganizationNameReply update_organization_name(id, body) -Update Organization +Update Organization Name ### Example @@ -1452,7 +1540,7 @@ with koyeb.api.ApiClient(configuration) as api_client: body = koyeb.api.UpdateOrganizationNameRequest() # UpdateOrganizationNameRequest | try: - # Update Organization + # Update Organization Name api_response = api_instance.update_organization_name(id, body) print("The response of OrganizationApi->update_organization_name:\n") pprint(api_response) diff --git a/koyeb/api/docs/PersistentVolumeStatus.md b/koyeb/api/docs/PersistentVolumeStatus.md index 02a4f1db..68d92622 100644 --- a/koyeb/api/docs/PersistentVolumeStatus.md +++ b/koyeb/api/docs/PersistentVolumeStatus.md @@ -13,6 +13,8 @@ * `PERSISTENT_VOLUME_STATUS_DELETED` (value: `'PERSISTENT_VOLUME_STATUS_DELETED'`) +* `PERSISTENT_VOLUME_STATUS_ARCHIVING` (value: `'PERSISTENT_VOLUME_STATUS_ARCHIVING'`) + [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/koyeb/api/docs/PersistentVolumesApi.md b/koyeb/api/docs/PersistentVolumesApi.md index 6797c509..dfb1d803 100644 --- a/koyeb/api/docs/PersistentVolumesApi.md +++ b/koyeb/api/docs/PersistentVolumesApi.md @@ -358,7 +358,7 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **list_persistent_volumes** -> ListPersistentVolumesReply list_persistent_volumes(limit=limit, offset=offset, service_id=service_id, region=region, name=name) +> ListPersistentVolumesReply list_persistent_volumes(limit=limit, offset=offset, service_id=service_id, region=region, name=name, project_id=project_id) List all PersistentVolumes @@ -398,10 +398,11 @@ with koyeb.api.ApiClient(configuration) as api_client: service_id = 'service_id_example' # str | (Optional) A filter for the service id (optional) region = 'region_example' # str | (Optional) A filter for the region (optional) name = 'name_example' # str | (Optional) A filter for the name (optional) + project_id = 'project_id_example' # str | (Optional) A filter for the project ID (optional) try: # List all PersistentVolumes - api_response = api_instance.list_persistent_volumes(limit=limit, offset=offset, service_id=service_id, region=region, name=name) + api_response = api_instance.list_persistent_volumes(limit=limit, offset=offset, service_id=service_id, region=region, name=name, project_id=project_id) print("The response of PersistentVolumesApi->list_persistent_volumes:\n") pprint(api_response) except Exception as e: @@ -420,6 +421,7 @@ Name | Type | Description | Notes **service_id** | **str**| (Optional) A filter for the service id | [optional] **region** | **str**| (Optional) A filter for the region | [optional] **name** | **str**| (Optional) A filter for the name | [optional] + **project_id** | **str**| (Optional) A filter for the project ID | [optional] ### Return type diff --git a/koyeb/api/docs/Project.md b/koyeb/api/docs/Project.md new file mode 100644 index 00000000..1f58aaaa --- /dev/null +++ b/koyeb/api/docs/Project.md @@ -0,0 +1,35 @@ +# Project + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **str** | | [optional] +**name** | **str** | | [optional] +**description** | **str** | | [optional] +**organization_id** | **str** | | [optional] +**updated_at** | **datetime** | | [optional] +**created_at** | **datetime** | | [optional] +**service_count** | **str** | | [optional] + +## Example + +```python +from koyeb.api.models.project import Project + +# TODO update the JSON string below +json = "{}" +# create an instance of Project from a JSON string +project_instance = Project.from_json(json) +# print the JSON string representation of the object +print(Project.to_json()) + +# convert the object into a dict +project_dict = project_instance.to_dict() +# create an instance of Project from a dict +project_from_dict = Project.from_dict(project_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/koyeb/api/docs/ProjectsApi.md b/koyeb/api/docs/ProjectsApi.md new file mode 100644 index 00000000..545f227d --- /dev/null +++ b/koyeb/api/docs/ProjectsApi.md @@ -0,0 +1,532 @@ +# koyeb.api.ProjectsApi + +All URIs are relative to *https://app.koyeb.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**create_project**](ProjectsApi.md#create_project) | **POST** /v1/projects | Create project +[**delete_project**](ProjectsApi.md#delete_project) | **DELETE** /v1/projects/{id} | Delete project +[**get_project**](ProjectsApi.md#get_project) | **GET** /v1/projects/{id} | Get project +[**list_projects**](ProjectsApi.md#list_projects) | **GET** /v1/projects | List projects +[**update_project**](ProjectsApi.md#update_project) | **PUT** /v1/projects/{id} | Update project +[**update_project2**](ProjectsApi.md#update_project2) | **PATCH** /v1/projects/{id} | Update project + + +# **create_project** +> CreateProjectReply create_project(project) + +Create project + +### Example + +* Api Key Authentication (Bearer): + +```python +import koyeb.api +from koyeb.api.models.create_project import CreateProject +from koyeb.api.models.create_project_reply import CreateProjectReply +from koyeb.api.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://app.koyeb.com +# See configuration.py for a list of all supported configuration parameters. +configuration = koyeb.api.Configuration( + host = "https://app.koyeb.com" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +with koyeb.api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = koyeb.api.ProjectsApi(api_client) + project = koyeb.api.CreateProject() # CreateProject | + + try: + # Create project + api_response = api_instance.create_project(project) + print("The response of ProjectsApi->create_project:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling ProjectsApi->create_project: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **project** | [**CreateProject**](CreateProject.md)| | + +### Return type + +[**CreateProjectReply**](CreateProjectReply.md) + +### Authorization + +[Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: */* + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | A successful response. | - | +**400** | Validation error | - | +**401** | Returned when the token is not valid. | - | +**403** | Returned when the user does not have permission to access the resource. | - | +**404** | Returned when the resource does not exist. | - | +**500** | Returned in case of server error. | - | +**503** | Service is unavailable. | - | +**0** | An unexpected error response. | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **delete_project** +> object delete_project(id) + +Delete project + +### Example + +* Api Key Authentication (Bearer): + +```python +import koyeb.api +from koyeb.api.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://app.koyeb.com +# See configuration.py for a list of all supported configuration parameters. +configuration = koyeb.api.Configuration( + host = "https://app.koyeb.com" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +with koyeb.api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = koyeb.api.ProjectsApi(api_client) + id = 'id_example' # str | + + try: + # Delete project + api_response = api_instance.delete_project(id) + print("The response of ProjectsApi->delete_project:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling ProjectsApi->delete_project: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| | + +### Return type + +**object** + +### Authorization + +[Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: */* + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | A successful response. | - | +**400** | Validation error | - | +**401** | Returned when the token is not valid. | - | +**403** | Returned when the user does not have permission to access the resource. | - | +**404** | Returned when the resource does not exist. | - | +**500** | Returned in case of server error. | - | +**503** | Service is unavailable. | - | +**0** | An unexpected error response. | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **get_project** +> GetProjectReply get_project(id) + +Get project + +### Example + +* Api Key Authentication (Bearer): + +```python +import koyeb.api +from koyeb.api.models.get_project_reply import GetProjectReply +from koyeb.api.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://app.koyeb.com +# See configuration.py for a list of all supported configuration parameters. +configuration = koyeb.api.Configuration( + host = "https://app.koyeb.com" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +with koyeb.api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = koyeb.api.ProjectsApi(api_client) + id = 'id_example' # str | + + try: + # Get project + api_response = api_instance.get_project(id) + print("The response of ProjectsApi->get_project:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling ProjectsApi->get_project: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| | + +### Return type + +[**GetProjectReply**](GetProjectReply.md) + +### Authorization + +[Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: */* + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | A successful response. | - | +**400** | Validation error | - | +**401** | Returned when the token is not valid. | - | +**403** | Returned when the user does not have permission to access the resource. | - | +**404** | Returned when the resource does not exist. | - | +**500** | Returned in case of server error. | - | +**503** | Service is unavailable. | - | +**0** | An unexpected error response. | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **list_projects** +> ListProjectsReply list_projects(limit=limit, offset=offset, name=name) + +List projects + +### Example + +* Api Key Authentication (Bearer): + +```python +import koyeb.api +from koyeb.api.models.list_projects_reply import ListProjectsReply +from koyeb.api.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://app.koyeb.com +# See configuration.py for a list of all supported configuration parameters. +configuration = koyeb.api.Configuration( + host = "https://app.koyeb.com" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +with koyeb.api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = koyeb.api.ProjectsApi(api_client) + limit = 'limit_example' # str | (Optional) The number of items to return (optional) + offset = 'offset_example' # str | (Optional) The offset in the list of item to return (optional) + name = 'name_example' # str | (Optional) Filter by project name (optional) + + try: + # List projects + api_response = api_instance.list_projects(limit=limit, offset=offset, name=name) + print("The response of ProjectsApi->list_projects:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling ProjectsApi->list_projects: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **limit** | **str**| (Optional) The number of items to return | [optional] + **offset** | **str**| (Optional) The offset in the list of item to return | [optional] + **name** | **str**| (Optional) Filter by project name | [optional] + +### Return type + +[**ListProjectsReply**](ListProjectsReply.md) + +### Authorization + +[Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: */* + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | A successful response. | - | +**400** | Validation error | - | +**401** | Returned when the token is not valid. | - | +**403** | Returned when the user does not have permission to access the resource. | - | +**404** | Returned when the resource does not exist. | - | +**500** | Returned in case of server error. | - | +**503** | Service is unavailable. | - | +**0** | An unexpected error response. | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **update_project** +> UpdateProjectReply update_project(id, project, update_mask=update_mask) + +Update project + +### Example + +* Api Key Authentication (Bearer): + +```python +import koyeb.api +from koyeb.api.models.project import Project +from koyeb.api.models.update_project_reply import UpdateProjectReply +from koyeb.api.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://app.koyeb.com +# See configuration.py for a list of all supported configuration parameters. +configuration = koyeb.api.Configuration( + host = "https://app.koyeb.com" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +with koyeb.api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = koyeb.api.ProjectsApi(api_client) + id = 'id_example' # str | + project = koyeb.api.Project() # Project | + update_mask = 'update_mask_example' # str | (optional) + + try: + # Update project + api_response = api_instance.update_project(id, project, update_mask=update_mask) + print("The response of ProjectsApi->update_project:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling ProjectsApi->update_project: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| | + **project** | [**Project**](Project.md)| | + **update_mask** | **str**| | [optional] + +### Return type + +[**UpdateProjectReply**](UpdateProjectReply.md) + +### Authorization + +[Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: */* + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | A successful response. | - | +**400** | Validation error | - | +**401** | Returned when the token is not valid. | - | +**403** | Returned when the user does not have permission to access the resource. | - | +**404** | Returned when the resource does not exist. | - | +**500** | Returned in case of server error. | - | +**503** | Service is unavailable. | - | +**0** | An unexpected error response. | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **update_project2** +> UpdateProjectReply update_project2(id, project, update_mask=update_mask) + +Update project + +### Example + +* Api Key Authentication (Bearer): + +```python +import koyeb.api +from koyeb.api.models.project import Project +from koyeb.api.models.update_project_reply import UpdateProjectReply +from koyeb.api.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://app.koyeb.com +# See configuration.py for a list of all supported configuration parameters. +configuration = koyeb.api.Configuration( + host = "https://app.koyeb.com" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +with koyeb.api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = koyeb.api.ProjectsApi(api_client) + id = 'id_example' # str | + project = koyeb.api.Project() # Project | + update_mask = 'update_mask_example' # str | (optional) + + try: + # Update project + api_response = api_instance.update_project2(id, project, update_mask=update_mask) + print("The response of ProjectsApi->update_project2:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling ProjectsApi->update_project2: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| | + **project** | [**Project**](Project.md)| | + **update_mask** | **str**| | [optional] + +### Return type + +[**UpdateProjectReply**](UpdateProjectReply.md) + +### Authorization + +[Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: */* + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | A successful response. | - | +**400** | Validation error | - | +**401** | Returned when the token is not valid. | - | +**403** | Returned when the user does not have permission to access the resource. | - | +**404** | Returned when the resource does not exist. | - | +**500** | Returned in case of server error. | - | +**503** | Service is unavailable. | - | +**0** | An unexpected error response. | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/koyeb/api/docs/Quotas.md b/koyeb/api/docs/Quotas.md index 245622cf..f1a284fb 100644 --- a/koyeb/api/docs/Quotas.md +++ b/koyeb/api/docs/Quotas.md @@ -25,6 +25,8 @@ Name | Type | Description | Notes **scale_to_zero** | [**ScaleToZeroQuotas**](ScaleToZeroQuotas.md) | | [optional] **archives** | **str** | | [optional] **archive_max_size_mb** | **str** | | [optional] +**lifecycle** | [**LifecycleQuotas**](LifecycleQuotas.md) | | [optional] +**max_projects** | **str** | | [optional] ## Example diff --git a/koyeb/api/docs/Route.md b/koyeb/api/docs/Route.md index 165a73ce..71112245 100644 --- a/koyeb/api/docs/Route.md +++ b/koyeb/api/docs/Route.md @@ -7,6 +7,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **port** | **int** | | [optional] **path** | **str** | | [optional] +**security_policies** | [**SecurityPolicies**](SecurityPolicies.md) | | [optional] ## Example diff --git a/koyeb/api/docs/SandboxMetadata.md b/koyeb/api/docs/SandboxMetadata.md new file mode 100644 index 00000000..43fff91a --- /dev/null +++ b/koyeb/api/docs/SandboxMetadata.md @@ -0,0 +1,30 @@ +# SandboxMetadata + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**public_url** | **str** | | [optional] +**routing_key** | **str** | | [optional] + +## Example + +```python +from koyeb.api.models.sandbox_metadata import SandboxMetadata + +# TODO update the JSON string below +json = "{}" +# create an instance of SandboxMetadata from a JSON string +sandbox_metadata_instance = SandboxMetadata.from_json(json) +# print the JSON string representation of the object +print(SandboxMetadata.to_json()) + +# convert the object into a dict +sandbox_metadata_dict = sandbox_metadata_instance.to_dict() +# create an instance of SandboxMetadata from a dict +sandbox_metadata_from_dict = SandboxMetadata.from_dict(sandbox_metadata_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/koyeb/api/docs/Secret.md b/koyeb/api/docs/Secret.md index d9724865..c74a4803 100644 --- a/koyeb/api/docs/Secret.md +++ b/koyeb/api/docs/Secret.md @@ -11,6 +11,7 @@ Name | Type | Description | Notes **type** | [**SecretType**](SecretType.md) | | [optional] [default to SecretType.SIMPLE] **updated_at** | **datetime** | | [optional] **created_at** | **datetime** | | [optional] +**project_id** | **str** | The project ID this secret belongs to. Empty if the secret is organization-level. | [optional] **value** | **str** | | [optional] **docker_hub_registry** | [**DockerHubRegistryConfiguration**](DockerHubRegistryConfiguration.md) | | [optional] **private_registry** | [**PrivateRegistryConfiguration**](PrivateRegistryConfiguration.md) | | [optional] diff --git a/koyeb/api/docs/SecretsApi.md b/koyeb/api/docs/SecretsApi.md index cb997ae5..3798d5fc 100644 --- a/koyeb/api/docs/SecretsApi.md +++ b/koyeb/api/docs/SecretsApi.md @@ -266,7 +266,7 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **list_secrets** -> ListSecretsReply list_secrets(name=name, limit=limit, offset=offset, types=types) +> ListSecretsReply list_secrets(name=name, limit=limit, offset=offset, types=types, project_id=project_id) List Secrets @@ -305,10 +305,11 @@ with koyeb.api.ApiClient(configuration) as api_client: limit = 'limit_example' # str | (optional) offset = 'offset_example' # str | (optional) types = ['types_example'] # List[str] | Filter by secret types (optional) + project_id = 'project_id_example' # str | (Optional) A filter for the project ID (optional) try: # List Secrets - api_response = api_instance.list_secrets(name=name, limit=limit, offset=offset, types=types) + api_response = api_instance.list_secrets(name=name, limit=limit, offset=offset, types=types, project_id=project_id) print("The response of SecretsApi->list_secrets:\n") pprint(api_response) except Exception as e: @@ -326,6 +327,7 @@ Name | Type | Description | Notes **limit** | **str**| | [optional] **offset** | **str**| | [optional] **types** | [**List[str]**](str.md)| Filter by secret types | [optional] + **project_id** | **str**| (Optional) A filter for the project ID | [optional] ### Return type diff --git a/koyeb/api/docs/SecurityPolicies.md b/koyeb/api/docs/SecurityPolicies.md new file mode 100644 index 00000000..2dcdaebf --- /dev/null +++ b/koyeb/api/docs/SecurityPolicies.md @@ -0,0 +1,30 @@ +# SecurityPolicies + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**basic_auths** | [**List[BasicAuthPolicy]**](BasicAuthPolicy.md) | | [optional] +**api_keys** | **List[str]** | | [optional] + +## Example + +```python +from koyeb.api.models.security_policies import SecurityPolicies + +# TODO update the JSON string below +json = "{}" +# create an instance of SecurityPolicies from a JSON string +security_policies_instance = SecurityPolicies.from_json(json) +# print the JSON string representation of the object +print(SecurityPolicies.to_json()) + +# convert the object into a dict +security_policies_dict = security_policies_instance.to_dict() +# create an instance of SecurityPolicies from a dict +security_policies_from_dict = SecurityPolicies.from_dict(security_policies_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/koyeb/api/docs/ServicesApi.md b/koyeb/api/docs/ServicesApi.md index 1d10d33b..fab3f40b 100644 --- a/koyeb/api/docs/ServicesApi.md +++ b/koyeb/api/docs/ServicesApi.md @@ -7,7 +7,9 @@ Method | HTTP request | Description [**autocomplete**](ServicesApi.md#autocomplete) | **POST** /v1/services-autocomplete | Autocomplete definition [**create_service**](ServicesApi.md#create_service) | **POST** /v1/services | Create Service [**delete_service**](ServicesApi.md#delete_service) | **DELETE** /v1/services/{id} | Delete Service +[**delete_service_scaling**](ServicesApi.md#delete_service_scaling) | **DELETE** /v1/services/{id}/scale | Delete Service Scaling [**get_service**](ServicesApi.md#get_service) | **GET** /v1/services/{id} | Get Service +[**get_service_scaling**](ServicesApi.md#get_service_scaling) | **GET** /v1/services/{id}/scale | Get Service Scaling [**list_service_events**](ServicesApi.md#list_service_events) | **GET** /v1/service_events | List Service events [**list_services**](ServicesApi.md#list_services) | **GET** /v1/services | List Services [**pause_service**](ServicesApi.md#pause_service) | **POST** /v1/services/{id}/pause | Pause Service @@ -15,6 +17,7 @@ Method | HTTP request | Description [**resume_service**](ServicesApi.md#resume_service) | **POST** /v1/services/{id}/resume | Resume Service [**update_service**](ServicesApi.md#update_service) | **PUT** /v1/services/{id} | Update Service [**update_service2**](ServicesApi.md#update_service2) | **PATCH** /v1/services/{id} | Update Service +[**update_service_scaling**](ServicesApi.md#update_service_scaling) | **PUT** /v1/services/{id}/scale | Update Service Scaling # **autocomplete** @@ -276,6 +279,92 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **delete_service_scaling** +> object delete_service_scaling(id) + +Delete Service Scaling + +Deletes the manual scaling configuration for a service, reverting to +the scaling defined in the deployment definition. + +### Example + +* Api Key Authentication (Bearer): + +```python +import koyeb.api +from koyeb.api.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://app.koyeb.com +# See configuration.py for a list of all supported configuration parameters. +configuration = koyeb.api.Configuration( + host = "https://app.koyeb.com" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +with koyeb.api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = koyeb.api.ServicesApi(api_client) + id = 'id_example' # str | The id of the service + + try: + # Delete Service Scaling + api_response = api_instance.delete_service_scaling(id) + print("The response of ServicesApi->delete_service_scaling:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling ServicesApi->delete_service_scaling: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| The id of the service | + +### Return type + +**object** + +### Authorization + +[Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: */* + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | A successful response. | - | +**400** | Validation error | - | +**401** | Returned when the token is not valid. | - | +**403** | Returned when the user does not have permission to access the resource. | - | +**404** | Returned when the resource does not exist. | - | +**500** | Returned in case of server error. | - | +**503** | Service is unavailable. | - | +**0** | An unexpected error response. | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + # **get_service** > GetServiceReply get_service(id) @@ -360,6 +449,92 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **get_service_scaling** +> GetServiceScalingReply get_service_scaling(id) + +Get Service Scaling + +Returns the current scaling configuration for a service + +### Example + +* Api Key Authentication (Bearer): + +```python +import koyeb.api +from koyeb.api.models.get_service_scaling_reply import GetServiceScalingReply +from koyeb.api.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://app.koyeb.com +# See configuration.py for a list of all supported configuration parameters. +configuration = koyeb.api.Configuration( + host = "https://app.koyeb.com" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +with koyeb.api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = koyeb.api.ServicesApi(api_client) + id = 'id_example' # str | The id of the service + + try: + # Get Service Scaling + api_response = api_instance.get_service_scaling(id) + print("The response of ServicesApi->get_service_scaling:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling ServicesApi->get_service_scaling: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| The id of the service | + +### Return type + +[**GetServiceScalingReply**](GetServiceScalingReply.md) + +### Authorization + +[Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: */* + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | A successful response. | - | +**400** | Validation error | - | +**401** | Returned when the token is not valid. | - | +**403** | Returned when the user does not have permission to access the resource. | - | +**404** | Returned when the resource does not exist. | - | +**500** | Returned in case of server error. | - | +**503** | Service is unavailable. | - | +**0** | An unexpected error response. | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + # **list_service_events** > ListServiceEventsReply list_service_events(service_id=service_id, types=types, limit=limit, offset=offset, order=order) @@ -453,7 +628,7 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **list_services** -> ListServicesReply list_services(app_id=app_id, limit=limit, offset=offset, name=name, types=types, statuses=statuses) +> ListServicesReply list_services(app_id=app_id, limit=limit, offset=offset, name=name, types=types, statuses=statuses, regions=regions, project_id=project_id) List Services @@ -494,10 +669,12 @@ with koyeb.api.ApiClient(configuration) as api_client: name = 'name_example' # str | (Optional) A filter for name (optional) types = ['types_example'] # List[str] | (Optional) Filter on service types (optional) statuses = ['statuses_example'] # List[str] | (Optional) Filter on service statuses (optional) + regions = ['regions_example'] # List[str] | (Optional) Filter on regions (optional) + project_id = 'project_id_example' # str | (Optional) A filter for the project ID (optional) try: # List Services - api_response = api_instance.list_services(app_id=app_id, limit=limit, offset=offset, name=name, types=types, statuses=statuses) + api_response = api_instance.list_services(app_id=app_id, limit=limit, offset=offset, name=name, types=types, statuses=statuses, regions=regions, project_id=project_id) print("The response of ServicesApi->list_services:\n") pprint(api_response) except Exception as e: @@ -517,6 +694,8 @@ Name | Type | Description | Notes **name** | **str**| (Optional) A filter for name | [optional] **types** | [**List[str]**](str.md)| (Optional) Filter on service types | [optional] **statuses** | [**List[str]**](str.md)| (Optional) Filter on service statuses | [optional] + **regions** | [**List[str]**](str.md)| (Optional) Filter on regions | [optional] + **project_id** | **str**| (Optional) A filter for the project ID | [optional] ### Return type @@ -814,7 +993,7 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **update_service** -> UpdateServiceReply update_service(id, service, dry_run=dry_run) +> UpdateServiceReply update_service(id, service, update_mask=update_mask, dry_run=dry_run) Update Service @@ -852,11 +1031,12 @@ with koyeb.api.ApiClient(configuration) as api_client: api_instance = koyeb.api.ServicesApi(api_client) id = 'id_example' # str | The id of the entity to update service = koyeb.api.UpdateService() # UpdateService | + update_mask = 'update_mask_example' # str | (optional) dry_run = True # bool | If set, run validation and check that the service exists (optional) try: # Update Service - api_response = api_instance.update_service(id, service, dry_run=dry_run) + api_response = api_instance.update_service(id, service, update_mask=update_mask, dry_run=dry_run) print("The response of ServicesApi->update_service:\n") pprint(api_response) except Exception as e: @@ -872,6 +1052,7 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **str**| The id of the entity to update | **service** | [**UpdateService**](UpdateService.md)| | + **update_mask** | **str**| | [optional] **dry_run** | **bool**| If set, run validation and check that the service exists | [optional] ### Return type @@ -903,7 +1084,7 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **update_service2** -> UpdateServiceReply update_service2(id, service, dry_run=dry_run) +> UpdateServiceReply update_service2(id, service, update_mask=update_mask, dry_run=dry_run) Update Service @@ -941,11 +1122,12 @@ with koyeb.api.ApiClient(configuration) as api_client: api_instance = koyeb.api.ServicesApi(api_client) id = 'id_example' # str | The id of the entity to update service = koyeb.api.UpdateService() # UpdateService | + update_mask = 'update_mask_example' # str | (optional) dry_run = True # bool | If set, run validation and check that the service exists (optional) try: # Update Service - api_response = api_instance.update_service2(id, service, dry_run=dry_run) + api_response = api_instance.update_service2(id, service, update_mask=update_mask, dry_run=dry_run) print("The response of ServicesApi->update_service2:\n") pprint(api_response) except Exception as e: @@ -961,6 +1143,7 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **str**| The id of the entity to update | **service** | [**UpdateService**](UpdateService.md)| | + **update_mask** | **str**| | [optional] **dry_run** | **bool**| If set, run validation and check that the service exists | [optional] ### Return type @@ -991,3 +1174,91 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **update_service_scaling** +> object update_service_scaling(id, body) + +Update Service Scaling + +Stores or updates the scaling configuration for a service to use manual scaling + +### Example + +* Api Key Authentication (Bearer): + +```python +import koyeb.api +from koyeb.api.models.update_service_scaling_request import UpdateServiceScalingRequest +from koyeb.api.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://app.koyeb.com +# See configuration.py for a list of all supported configuration parameters. +configuration = koyeb.api.Configuration( + host = "https://app.koyeb.com" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +with koyeb.api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = koyeb.api.ServicesApi(api_client) + id = 'id_example' # str | The id of the service to scale + body = koyeb.api.UpdateServiceScalingRequest() # UpdateServiceScalingRequest | + + try: + # Update Service Scaling + api_response = api_instance.update_service_scaling(id, body) + print("The response of ServicesApi->update_service_scaling:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling ServicesApi->update_service_scaling: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| The id of the service to scale | + **body** | [**UpdateServiceScalingRequest**](UpdateServiceScalingRequest.md)| | + +### Return type + +**object** + +### Authorization + +[Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: */* + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | A successful response. | - | +**400** | Validation error | - | +**401** | Returned when the token is not valid. | - | +**403** | Returned when the user does not have permission to access the resource. | - | +**404** | Returned when the resource does not exist. | - | +**500** | Returned in case of server error. | - | +**503** | Service is unavailable. | - | +**0** | An unexpected error response. | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/koyeb/api/docs/UpdateOrganizationDefaultProjectReply.md b/koyeb/api/docs/UpdateOrganizationDefaultProjectReply.md new file mode 100644 index 00000000..5adc42f1 --- /dev/null +++ b/koyeb/api/docs/UpdateOrganizationDefaultProjectReply.md @@ -0,0 +1,29 @@ +# UpdateOrganizationDefaultProjectReply + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**organization** | [**Organization**](Organization.md) | | [optional] + +## Example + +```python +from koyeb.api.models.update_organization_default_project_reply import UpdateOrganizationDefaultProjectReply + +# TODO update the JSON string below +json = "{}" +# create an instance of UpdateOrganizationDefaultProjectReply from a JSON string +update_organization_default_project_reply_instance = UpdateOrganizationDefaultProjectReply.from_json(json) +# print the JSON string representation of the object +print(UpdateOrganizationDefaultProjectReply.to_json()) + +# convert the object into a dict +update_organization_default_project_reply_dict = update_organization_default_project_reply_instance.to_dict() +# create an instance of UpdateOrganizationDefaultProjectReply from a dict +update_organization_default_project_reply_from_dict = UpdateOrganizationDefaultProjectReply.from_dict(update_organization_default_project_reply_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/koyeb/api/docs/UpdateOrganizationDefaultProjectRequest.md b/koyeb/api/docs/UpdateOrganizationDefaultProjectRequest.md new file mode 100644 index 00000000..4f083786 --- /dev/null +++ b/koyeb/api/docs/UpdateOrganizationDefaultProjectRequest.md @@ -0,0 +1,29 @@ +# UpdateOrganizationDefaultProjectRequest + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**default_project_id** | **str** | | [optional] + +## Example + +```python +from koyeb.api.models.update_organization_default_project_request import UpdateOrganizationDefaultProjectRequest + +# TODO update the JSON string below +json = "{}" +# create an instance of UpdateOrganizationDefaultProjectRequest from a JSON string +update_organization_default_project_request_instance = UpdateOrganizationDefaultProjectRequest.from_json(json) +# print the JSON string representation of the object +print(UpdateOrganizationDefaultProjectRequest.to_json()) + +# convert the object into a dict +update_organization_default_project_request_dict = update_organization_default_project_request_instance.to_dict() +# create an instance of UpdateOrganizationDefaultProjectRequest from a dict +update_organization_default_project_request_from_dict = UpdateOrganizationDefaultProjectRequest.from_dict(update_organization_default_project_request_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/koyeb/api/docs/UpdateOrganizationPlanRequest.md b/koyeb/api/docs/UpdateOrganizationPlanRequest.md index 7da949df..677dfb40 100644 --- a/koyeb/api/docs/UpdateOrganizationPlanRequest.md +++ b/koyeb/api/docs/UpdateOrganizationPlanRequest.md @@ -6,6 +6,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **plan** | [**Plan**](Plan.md) | | [optional] [default to Plan.HOBBY] +**coupon_code** | **str** | | [optional] ## Example diff --git a/koyeb/api/docs/UpdateProjectReply.md b/koyeb/api/docs/UpdateProjectReply.md new file mode 100644 index 00000000..74017e79 --- /dev/null +++ b/koyeb/api/docs/UpdateProjectReply.md @@ -0,0 +1,29 @@ +# UpdateProjectReply + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**project** | [**Project**](Project.md) | | [optional] + +## Example + +```python +from koyeb.api.models.update_project_reply import UpdateProjectReply + +# TODO update the JSON string below +json = "{}" +# create an instance of UpdateProjectReply from a JSON string +update_project_reply_instance = UpdateProjectReply.from_json(json) +# print the JSON string representation of the object +print(UpdateProjectReply.to_json()) + +# convert the object into a dict +update_project_reply_dict = update_project_reply_instance.to_dict() +# create an instance of UpdateProjectReply from a dict +update_project_reply_from_dict = UpdateProjectReply.from_dict(update_project_reply_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/koyeb/api/docs/UpdateServiceScalingRequest.md b/koyeb/api/docs/UpdateServiceScalingRequest.md new file mode 100644 index 00000000..e095d7ea --- /dev/null +++ b/koyeb/api/docs/UpdateServiceScalingRequest.md @@ -0,0 +1,29 @@ +# UpdateServiceScalingRequest + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**scalings** | [**List[ManualServiceScaling]**](ManualServiceScaling.md) | | [optional] + +## Example + +```python +from koyeb.api.models.update_service_scaling_request import UpdateServiceScalingRequest + +# TODO update the JSON string below +json = "{}" +# create an instance of UpdateServiceScalingRequest from a JSON string +update_service_scaling_request_instance = UpdateServiceScalingRequest.from_json(json) +# print the JSON string representation of the object +print(UpdateServiceScalingRequest.to_json()) + +# convert the object into a dict +update_service_scaling_request_dict = update_service_scaling_request_instance.to_dict() +# create an instance of UpdateServiceScalingRequest from a dict +update_service_scaling_request_from_dict = UpdateServiceScalingRequest.from_dict(update_service_scaling_request_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/koyeb/api/exceptions.py b/koyeb/api/exceptions.py index a2d85cf1..1caa226e 100644 --- a/koyeb/api/exceptions.py +++ b/koyeb/api/exceptions.py @@ -1,29 +1,26 @@ -# coding: utf-8 - """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 + from typing import Any, Optional from typing_extensions import Self - class OpenApiException(Exception): """The base exception class for all OpenAPIExceptions""" class ApiTypeError(OpenApiException, TypeError): - def __init__( - self, msg, path_to_item=None, valid_classes=None, key_type=None - ) -> None: - """Raises an exception for TypeErrors + def __init__(self, msg, path_to_item=None, valid_classes=None, + key_type=None) -> None: + """ Raises an exception for TypeErrors Args: msg (str): the exception message @@ -106,9 +103,9 @@ def __init__(self, msg, path_to_item=None) -> None: class ApiException(OpenApiException): def __init__( - self, - status=None, - reason=None, + self, + status=None, + reason=None, http_resp=None, *, body: Optional[str] = None, @@ -127,17 +124,17 @@ def __init__( self.reason = http_resp.reason if self.body is None: try: - self.body = http_resp.data.decode("utf-8") + self.body = http_resp.data.decode('utf-8') except Exception: pass self.headers = http_resp.headers @classmethod def from_response( - cls, - *, - http_resp, - body: Optional[str], + cls, + *, + http_resp, + body: Optional[str], data: Optional[Any], ) -> Self: if http_resp.status == 400: @@ -157,9 +154,7 @@ def from_response( raise ConflictException(http_resp=http_resp, body=body, data=data) if http_resp.status == 422: - raise UnprocessableEntityException( - http_resp=http_resp, body=body, data=data - ) + raise UnprocessableEntityException(http_resp=http_resp, body=body, data=data) if 500 <= http_resp.status <= 599: raise ServiceException(http_resp=http_resp, body=body, data=data) @@ -167,9 +162,11 @@ def from_response( def __str__(self): """Custom error messages for exception""" - error_message = "({0})\n" "Reason: {1}\n".format(self.status, self.reason) + error_message = "({0})\n"\ + "Reason: {1}\n".format(self.status, self.reason) if self.headers: - error_message += "HTTP response headers: {0}\n".format(self.headers) + error_message += "HTTP response headers: {0}\n".format( + self.headers) if self.body: error_message += "HTTP response body: {0}\n".format(self.body) @@ -202,13 +199,11 @@ class ServiceException(ApiException): class ConflictException(ApiException): """Exception for HTTP 409 Conflict.""" - pass class UnprocessableEntityException(ApiException): """Exception for HTTP 422 Unprocessable Entity.""" - pass diff --git a/koyeb/api/models/__init__.py b/koyeb/api/models/__init__.py index 087d0502..afb9bf76 100644 --- a/koyeb/api/models/__init__.py +++ b/koyeb/api/models/__init__.py @@ -2,20 +2,18 @@ # flake8: noqa """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 # import models into model package -from koyeb.api.models.accept_organization_invitation_reply import ( - AcceptOrganizationInvitationReply, -) +from koyeb.api.models.accept_organization_invitation_reply import AcceptOrganizationInvitationReply from koyeb.api.models.action import Action from koyeb.api.models.activity import Activity from koyeb.api.models.activity_list import ActivityList @@ -34,9 +32,8 @@ from koyeb.api.models.autocomplete_reply import AutocompleteReply from koyeb.api.models.autocomplete_request import AutocompleteRequest from koyeb.api.models.availability_level import AvailabilityLevel -from koyeb.api.models.azure_container_registry_configuration import ( - AzureContainerRegistryConfiguration, -) +from koyeb.api.models.azure_container_registry_configuration import AzureContainerRegistryConfiguration +from koyeb.api.models.basic_auth_policy import BasicAuthPolicy from koyeb.api.models.budget import Budget from koyeb.api.models.buildpack_builder import BuildpackBuilder from koyeb.api.models.canny_auth_reply import CannyAuthReply @@ -44,14 +41,11 @@ from koyeb.api.models.catalog_instance import CatalogInstance from koyeb.api.models.catalog_instance_list_item import CatalogInstanceListItem from koyeb.api.models.catalog_usage import CatalogUsage -from koyeb.api.models.clear_idenfy_verification_result_request import ( - ClearIdenfyVerificationResultRequest, -) +from koyeb.api.models.check_coupon_reply import CheckCouponReply +from koyeb.api.models.clear_idenfy_verification_result_request import ClearIdenfyVerificationResultRequest from koyeb.api.models.compose_reply import ComposeReply from koyeb.api.models.config_file import ConfigFile -from koyeb.api.models.confirm_payment_authorization_reply import ( - ConfirmPaymentAuthorizationReply, -) +from koyeb.api.models.confirm_payment_authorization_reply import ConfirmPaymentAuthorizationReply from koyeb.api.models.create_access_token_reply import CreateAccessTokenReply from koyeb.api.models.create_access_token_request import CreateAccessTokenRequest from koyeb.api.models.create_account_request import CreateAccountRequest @@ -65,21 +59,15 @@ from koyeb.api.models.create_credential_reply import CreateCredentialReply from koyeb.api.models.create_domain import CreateDomain from koyeb.api.models.create_domain_reply import CreateDomainReply -from koyeb.api.models.create_organization_invitation_reply import ( - CreateOrganizationInvitationReply, -) -from koyeb.api.models.create_organization_invitation_request import ( - CreateOrganizationInvitationRequest, -) +from koyeb.api.models.create_organization_invitation_reply import CreateOrganizationInvitationReply +from koyeb.api.models.create_organization_invitation_request import CreateOrganizationInvitationRequest from koyeb.api.models.create_organization_reply import CreateOrganizationReply from koyeb.api.models.create_organization_request import CreateOrganizationRequest -from koyeb.api.models.create_payment_authorization_reply import ( - CreatePaymentAuthorizationReply, -) +from koyeb.api.models.create_payment_authorization_reply import CreatePaymentAuthorizationReply from koyeb.api.models.create_persistent_volume_reply import CreatePersistentVolumeReply -from koyeb.api.models.create_persistent_volume_request import ( - CreatePersistentVolumeRequest, -) +from koyeb.api.models.create_persistent_volume_request import CreatePersistentVolumeRequest +from koyeb.api.models.create_project import CreateProject +from koyeb.api.models.create_project_reply import CreateProjectReply from koyeb.api.models.create_secret import CreateSecret from koyeb.api.models.create_secret_reply import CreateSecretReply from koyeb.api.models.create_service import CreateService @@ -96,14 +84,10 @@ from koyeb.api.models.database_usage_details import DatabaseUsageDetails from koyeb.api.models.datacenter_list_item import DatacenterListItem from koyeb.api.models.deactivate_organization_reply import DeactivateOrganizationReply -from koyeb.api.models.deactivate_organization_request import ( - DeactivateOrganizationRequest, -) +from koyeb.api.models.deactivate_organization_request import DeactivateOrganizationRequest from koyeb.api.models.declare_stage_progress_request import DeclareStageProgressRequest from koyeb.api.models.declare_step_progress_request import DeclareStepProgressRequest -from koyeb.api.models.decline_organization_invitation_reply import ( - DeclineOrganizationInvitationReply, -) +from koyeb.api.models.decline_organization_invitation_reply import DeclineOrganizationInvitationReply from koyeb.api.models.delete_organization_reply import DeleteOrganizationReply from koyeb.api.models.delete_persistent_volume_reply import DeletePersistentVolumeReply from koyeb.api.models.delete_snapshot_reply import DeleteSnapshotReply @@ -118,65 +102,37 @@ from koyeb.api.models.deployment_instance_type import DeploymentInstanceType from koyeb.api.models.deployment_list_item import DeploymentListItem from koyeb.api.models.deployment_metadata import DeploymentMetadata -from koyeb.api.models.deployment_neon_postgres_database_info import ( - DeploymentNeonPostgresDatabaseInfo, -) -from koyeb.api.models.deployment_neon_postgres_database_info_role import ( - DeploymentNeonPostgresDatabaseInfoRole, -) +from koyeb.api.models.deployment_neon_postgres_database_info import DeploymentNeonPostgresDatabaseInfo +from koyeb.api.models.deployment_neon_postgres_database_info_role import DeploymentNeonPostgresDatabaseInfoRole from koyeb.api.models.deployment_port import DeploymentPort from koyeb.api.models.deployment_provisioning_info import DeploymentProvisioningInfo -from koyeb.api.models.deployment_provisioning_info_stage import ( - DeploymentProvisioningInfoStage, -) -from koyeb.api.models.deployment_provisioning_info_stage_build_attempt import ( - DeploymentProvisioningInfoStageBuildAttempt, -) -from koyeb.api.models.deployment_provisioning_info_stage_build_attempt_build_step import ( - DeploymentProvisioningInfoStageBuildAttemptBuildStep, -) -from koyeb.api.models.deployment_provisioning_info_stage_status import ( - DeploymentProvisioningInfoStageStatus, -) +from koyeb.api.models.deployment_provisioning_info_stage import DeploymentProvisioningInfoStage +from koyeb.api.models.deployment_provisioning_info_stage_build_attempt import DeploymentProvisioningInfoStageBuildAttempt +from koyeb.api.models.deployment_provisioning_info_stage_build_attempt_build_step import DeploymentProvisioningInfoStageBuildAttemptBuildStep +from koyeb.api.models.deployment_provisioning_info_stage_status import DeploymentProvisioningInfoStageStatus from koyeb.api.models.deployment_proxy_port import DeploymentProxyPort from koyeb.api.models.deployment_proxy_port_metadata import DeploymentProxyPortMetadata from koyeb.api.models.deployment_role import DeploymentRole from koyeb.api.models.deployment_route import DeploymentRoute from koyeb.api.models.deployment_scaling import DeploymentScaling from koyeb.api.models.deployment_scaling_target import DeploymentScalingTarget -from koyeb.api.models.deployment_scaling_target_average_cpu import ( - DeploymentScalingTargetAverageCPU, -) -from koyeb.api.models.deployment_scaling_target_average_mem import ( - DeploymentScalingTargetAverageMem, -) -from koyeb.api.models.deployment_scaling_target_concurrent_requests import ( - DeploymentScalingTargetConcurrentRequests, -) -from koyeb.api.models.deployment_scaling_target_requests_per_second import ( - DeploymentScalingTargetRequestsPerSecond, -) -from koyeb.api.models.deployment_scaling_target_requests_response_time import ( - DeploymentScalingTargetRequestsResponseTime, -) -from koyeb.api.models.deployment_scaling_target_sleep_idle_delay import ( - DeploymentScalingTargetSleepIdleDelay, -) +from koyeb.api.models.deployment_scaling_target_average_cpu import DeploymentScalingTargetAverageCPU +from koyeb.api.models.deployment_scaling_target_average_mem import DeploymentScalingTargetAverageMem +from koyeb.api.models.deployment_scaling_target_concurrent_requests import DeploymentScalingTargetConcurrentRequests +from koyeb.api.models.deployment_scaling_target_requests_per_second import DeploymentScalingTargetRequestsPerSecond +from koyeb.api.models.deployment_scaling_target_requests_response_time import DeploymentScalingTargetRequestsResponseTime +from koyeb.api.models.deployment_scaling_target_sleep_idle_delay import DeploymentScalingTargetSleepIdleDelay from koyeb.api.models.deployment_status import DeploymentStatus from koyeb.api.models.deployment_strategy import DeploymentStrategy from koyeb.api.models.deployment_strategy_type import DeploymentStrategyType from koyeb.api.models.deployment_volume import DeploymentVolume from koyeb.api.models.desired_deployment import DesiredDeployment from koyeb.api.models.desired_deployment_group import DesiredDeploymentGroup -from koyeb.api.models.digital_ocean_registry_configuration import ( - DigitalOceanRegistryConfiguration, -) +from koyeb.api.models.digital_ocean_registry_configuration import DigitalOceanRegistryConfiguration from koyeb.api.models.discourse_auth_reply import DiscourseAuthReply from koyeb.api.models.discourse_auth_request import DiscourseAuthRequest from koyeb.api.models.docker_builder import DockerBuilder -from koyeb.api.models.docker_hub_registry_configuration import ( - DockerHubRegistryConfiguration, -) +from koyeb.api.models.docker_hub_registry_configuration import DockerHubRegistryConfiguration from koyeb.api.models.docker_source import DockerSource from koyeb.api.models.domain import Domain from koyeb.api.models.domain_load_balancer_koyeb import DomainLoadBalancerKoyeb @@ -192,21 +148,15 @@ from koyeb.api.models.exec_command_reply import ExecCommandReply from koyeb.api.models.exec_command_request_body import ExecCommandRequestBody from koyeb.api.models.exec_command_request_id_type import ExecCommandRequestIdType -from koyeb.api.models.exec_command_request_terminal_size import ( - ExecCommandRequestTerminalSize, -) -from koyeb.api.models.gcp_container_registry_configuration import ( - GCPContainerRegistryConfiguration, -) +from koyeb.api.models.exec_command_request_terminal_size import ExecCommandRequestTerminalSize +from koyeb.api.models.gcp_container_registry_configuration import GCPContainerRegistryConfiguration from koyeb.api.models.get_app_reply import GetAppReply from koyeb.api.models.get_budget_reply import GetBudgetReply from koyeb.api.models.get_catalog_instance_reply import GetCatalogInstanceReply from koyeb.api.models.get_credential_reply import GetCredentialReply from koyeb.api.models.get_deployment_reply import GetDeploymentReply from koyeb.api.models.get_deployment_scaling_reply import GetDeploymentScalingReply -from koyeb.api.models.get_deployment_scaling_reply_item import ( - GetDeploymentScalingReplyItem, -) +from koyeb.api.models.get_deployment_scaling_reply_item import GetDeploymentScalingReplyItem from koyeb.api.models.get_domain_reply import GetDomainReply from koyeb.api.models.get_github_installation_reply import GetGithubInstallationReply from koyeb.api.models.get_idenfy_token_reply import GetIdenfyTokenReply @@ -215,27 +165,23 @@ from koyeb.api.models.get_metrics_reply import GetMetricsReply from koyeb.api.models.get_metrics_reply_metric import GetMetricsReplyMetric from koyeb.api.models.get_o_auth_options_reply import GetOAuthOptionsReply -from koyeb.api.models.get_organization_invitation_reply import ( - GetOrganizationInvitationReply, -) +from koyeb.api.models.get_organization_invitation_reply import GetOrganizationInvitationReply from koyeb.api.models.get_organization_reply import GetOrganizationReply from koyeb.api.models.get_organization_summary_reply import GetOrganizationSummaryReply -from koyeb.api.models.get_organization_usage_details_reply import ( - GetOrganizationUsageDetailsReply, -) +from koyeb.api.models.get_organization_usage_details_reply import GetOrganizationUsageDetailsReply from koyeb.api.models.get_organization_usage_reply import GetOrganizationUsageReply from koyeb.api.models.get_payment_method_reply import GetPaymentMethodReply from koyeb.api.models.get_persistent_volume_reply import GetPersistentVolumeReply +from koyeb.api.models.get_project_reply import GetProjectReply from koyeb.api.models.get_quotas_reply import GetQuotasReply from koyeb.api.models.get_region_reply import GetRegionReply from koyeb.api.models.get_regional_deployment_reply import GetRegionalDeploymentReply from koyeb.api.models.get_secret_reply import GetSecretReply from koyeb.api.models.get_service_reply import GetServiceReply +from koyeb.api.models.get_service_scaling_reply import GetServiceScalingReply from koyeb.api.models.get_snapshot_reply import GetSnapshotReply from koyeb.api.models.get_subscription_reply import GetSubscriptionReply -from koyeb.api.models.get_user_organization_invitation_reply import ( - GetUserOrganizationInvitationReply, -) +from koyeb.api.models.get_user_organization_invitation_reply import GetUserOrganizationInvitationReply from koyeb.api.models.get_user_settings_reply import GetUserSettingsReply from koyeb.api.models.git_deployment_metadata import GitDeploymentMetadata from koyeb.api.models.git_env_deployment_metadata import GitEnvDeploymentMetadata @@ -260,14 +206,10 @@ from koyeb.api.models.invite_user_request import InviteUserRequest from koyeb.api.models.kgitproxy_branch import KgitproxyBranch from koyeb.api.models.kgitproxy_git_hub_repository import KgitproxyGitHubRepository -from koyeb.api.models.kgitproxy_github_installation_status import ( - KgitproxyGithubInstallationStatus, -) +from koyeb.api.models.kgitproxy_github_installation_status import KgitproxyGithubInstallationStatus from koyeb.api.models.kgitproxy_indexing_status import KgitproxyIndexingStatus from koyeb.api.models.kgitproxy_list_branches_reply import KgitproxyListBranchesReply -from koyeb.api.models.kgitproxy_list_repositories_reply import ( - KgitproxyListRepositoriesReply, -) +from koyeb.api.models.kgitproxy_list_repositories_reply import KgitproxyListRepositoriesReply from koyeb.api.models.kgitproxy_repository import KgitproxyRepository from koyeb.api.models.kgitproxy_repository_provider import KgitproxyRepositoryProvider from koyeb.api.models.ksearch_app import KsearchApp @@ -278,6 +220,7 @@ from koyeb.api.models.ksearch_search_reply import KsearchSearchReply from koyeb.api.models.ksearch_service import KsearchService from koyeb.api.models.ksearch_user import KsearchUser +from koyeb.api.models.lifecycle_quotas import LifecycleQuotas from koyeb.api.models.list_app_events_reply import ListAppEventsReply from koyeb.api.models.list_apps_reply import ListAppsReply from koyeb.api.models.list_catalog_instances_reply import ListCatalogInstancesReply @@ -288,32 +231,21 @@ from koyeb.api.models.list_domains_reply import ListDomainsReply from koyeb.api.models.list_instance_events_reply import ListInstanceEventsReply from koyeb.api.models.list_instances_reply import ListInstancesReply -from koyeb.api.models.list_organization_invitations_reply import ( - ListOrganizationInvitationsReply, -) -from koyeb.api.models.list_organization_members_reply import ( - ListOrganizationMembersReply, -) +from koyeb.api.models.list_organization_invitations_reply import ListOrganizationInvitationsReply +from koyeb.api.models.list_organization_members_reply import ListOrganizationMembersReply from koyeb.api.models.list_payment_methods_reply import ListPaymentMethodsReply -from koyeb.api.models.list_persistent_volume_events_reply import ( - ListPersistentVolumeEventsReply, -) +from koyeb.api.models.list_persistent_volume_events_reply import ListPersistentVolumeEventsReply from koyeb.api.models.list_persistent_volumes_reply import ListPersistentVolumesReply -from koyeb.api.models.list_regional_deployment_events_reply import ( - ListRegionalDeploymentEventsReply, -) -from koyeb.api.models.list_regional_deployments_reply import ( - ListRegionalDeploymentsReply, -) +from koyeb.api.models.list_projects_reply import ListProjectsReply +from koyeb.api.models.list_regional_deployment_events_reply import ListRegionalDeploymentEventsReply +from koyeb.api.models.list_regional_deployments_reply import ListRegionalDeploymentsReply from koyeb.api.models.list_regions_reply import ListRegionsReply from koyeb.api.models.list_secrets_reply import ListSecretsReply from koyeb.api.models.list_service_events_reply import ListServiceEventsReply from koyeb.api.models.list_services_reply import ListServicesReply from koyeb.api.models.list_snapshots_reply import ListSnapshotsReply from koyeb.api.models.list_usage_reply import ListUsageReply -from koyeb.api.models.list_user_organization_invitations_reply import ( - ListUserOrganizationInvitationsReply, -) +from koyeb.api.models.list_user_organization_invitations_reply import ListUserOrganizationInvitationsReply from koyeb.api.models.list_user_organizations_reply import ListUserOrganizationsReply from koyeb.api.models.log_entry import LogEntry from koyeb.api.models.login_method_reply import LoginMethodReply @@ -321,24 +253,17 @@ from koyeb.api.models.login_reply import LoginReply from koyeb.api.models.login_request import LoginRequest from koyeb.api.models.manage_reply import ManageReply +from koyeb.api.models.manual_service_scaling import ManualServiceScaling from koyeb.api.models.members_summary import MembersSummary from koyeb.api.models.metric_name import MetricName from koyeb.api.models.neon_postgres_database import NeonPostgresDatabase -from koyeb.api.models.neon_postgres_database_deployment_metadata import ( - NeonPostgresDatabaseDeploymentMetadata, -) -from koyeb.api.models.neon_postgres_database_neon_database import ( - NeonPostgresDatabaseNeonDatabase, -) -from koyeb.api.models.neon_postgres_database_neon_role import ( - NeonPostgresDatabaseNeonRole, -) +from koyeb.api.models.neon_postgres_database_deployment_metadata import NeonPostgresDatabaseDeploymentMetadata +from koyeb.api.models.neon_postgres_database_neon_database import NeonPostgresDatabaseNeonDatabase +from koyeb.api.models.neon_postgres_database_neon_role import NeonPostgresDatabaseNeonRole from koyeb.api.models.neon_postgres_summary import NeonPostgresSummary from koyeb.api.models.next_invoice_reply import NextInvoiceReply from koyeb.api.models.next_invoice_reply_discount import NextInvoiceReplyDiscount -from koyeb.api.models.next_invoice_reply_discount_type import ( - NextInvoiceReplyDiscountType, -) +from koyeb.api.models.next_invoice_reply_discount_type import NextInvoiceReplyDiscountType from koyeb.api.models.next_invoice_reply_line import NextInvoiceReplyLine from koyeb.api.models.next_invoice_reply_line_period import NextInvoiceReplyLinePeriod from koyeb.api.models.next_invoice_reply_line_price import NextInvoiceReplyLinePrice @@ -349,9 +274,7 @@ from koyeb.api.models.o_auth_provider import OAuthProvider from koyeb.api.models.object import Object from koyeb.api.models.organization import Organization -from koyeb.api.models.organization_deactivation_reason import ( - OrganizationDeactivationReason, -) +from koyeb.api.models.organization_deactivation_reason import OrganizationDeactivationReason from koyeb.api.models.organization_detailed_status import OrganizationDetailedStatus from koyeb.api.models.organization_invitation import OrganizationInvitation from koyeb.api.models.organization_invitation_status import OrganizationInvitationStatus @@ -363,15 +286,14 @@ from koyeb.api.models.payment_method_status import PaymentMethodStatus from koyeb.api.models.period_usage import PeriodUsage from koyeb.api.models.persistent_volume import PersistentVolume -from koyeb.api.models.persistent_volume_backing_store import ( - PersistentVolumeBackingStore, -) +from koyeb.api.models.persistent_volume_backing_store import PersistentVolumeBackingStore from koyeb.api.models.persistent_volume_event import PersistentVolumeEvent from koyeb.api.models.persistent_volume_quotas import PersistentVolumeQuotas from koyeb.api.models.persistent_volume_status import PersistentVolumeStatus from koyeb.api.models.plan import Plan from koyeb.api.models.port import Port from koyeb.api.models.private_registry_configuration import PrivateRegistryConfiguration +from koyeb.api.models.project import Project from koyeb.api.models.proxy_port_protocol import ProxyPortProtocol from koyeb.api.models.public_organization import PublicOrganization from koyeb.api.models.public_user import PublicUser @@ -388,35 +310,27 @@ from koyeb.api.models.region_usage import RegionUsage from koyeb.api.models.regional_deployment import RegionalDeployment from koyeb.api.models.regional_deployment_definition import RegionalDeploymentDefinition -from koyeb.api.models.regional_deployment_definition_type import ( - RegionalDeploymentDefinitionType, -) +from koyeb.api.models.regional_deployment_definition_type import RegionalDeploymentDefinitionType from koyeb.api.models.regional_deployment_event import RegionalDeploymentEvent from koyeb.api.models.regional_deployment_list_item import RegionalDeploymentListItem from koyeb.api.models.regional_deployment_role import RegionalDeploymentRole from koyeb.api.models.regional_deployment_status import RegionalDeploymentStatus from koyeb.api.models.regional_deployment_volume import RegionalDeploymentVolume -from koyeb.api.models.remove_organization_member_reply import ( - RemoveOrganizationMemberReply, -) -from koyeb.api.models.resend_organization_invitation_reply import ( - ResendOrganizationInvitationReply, -) +from koyeb.api.models.remove_organization_member_reply import RemoveOrganizationMemberReply +from koyeb.api.models.resend_organization_invitation_reply import ResendOrganizationInvitationReply from koyeb.api.models.reset_password_request import ResetPasswordRequest from koyeb.api.models.reveal_secret_reply import RevealSecretReply -from koyeb.api.models.review_organization_capacity_reply import ( - ReviewOrganizationCapacityReply, -) -from koyeb.api.models.review_organization_capacity_request import ( - ReviewOrganizationCapacityRequest, -) +from koyeb.api.models.review_organization_capacity_reply import ReviewOrganizationCapacityReply +from koyeb.api.models.review_organization_capacity_request import ReviewOrganizationCapacityRequest from koyeb.api.models.route import Route from koyeb.api.models.sample import Sample +from koyeb.api.models.sandbox_metadata import SandboxMetadata from koyeb.api.models.scale_to_zero_quotas import ScaleToZeroQuotas from koyeb.api.models.scaling import Scaling from koyeb.api.models.secret import Secret from koyeb.api.models.secret_type import SecretType from koyeb.api.models.secrets_summary import SecretsSummary +from koyeb.api.models.security_policies import SecurityPolicies from koyeb.api.models.service import Service from koyeb.api.models.service_event import ServiceEvent from koyeb.api.models.service_life_cycle import ServiceLifeCycle @@ -429,31 +343,19 @@ from koyeb.api.models.snapshot import Snapshot from koyeb.api.models.snapshot_status import SnapshotStatus from koyeb.api.models.snapshot_type import SnapshotType -from koyeb.api.models.stream_result_of_exec_command_reply import ( - StreamResultOfExecCommandReply, -) +from koyeb.api.models.stream_result_of_exec_command_reply import StreamResultOfExecCommandReply from koyeb.api.models.stream_result_of_log_entry import StreamResultOfLogEntry from koyeb.api.models.subscription import Subscription from koyeb.api.models.subscription_payment_failure import SubscriptionPaymentFailure -from koyeb.api.models.subscription_payment_failure_stripe_sdk import ( - SubscriptionPaymentFailureStripeSDK, -) +from koyeb.api.models.subscription_payment_failure_stripe_sdk import SubscriptionPaymentFailureStripeSDK from koyeb.api.models.subscription_status import SubscriptionStatus from koyeb.api.models.tcp_health_check import TCPHealthCheck from koyeb.api.models.token import Token from koyeb.api.models.trigger_deployment_metadata import TriggerDeploymentMetadata -from koyeb.api.models.trigger_deployment_metadata_actor_type import ( - TriggerDeploymentMetadataActorType, -) -from koyeb.api.models.trigger_deployment_metadata_trigger_type import ( - TriggerDeploymentMetadataTriggerType, -) -from koyeb.api.models.trigger_git_deployment_metadata import ( - TriggerGitDeploymentMetadata, -) -from koyeb.api.models.trigger_git_deployment_metadata_provider import ( - TriggerGitDeploymentMetadataProvider, -) +from koyeb.api.models.trigger_deployment_metadata_actor_type import TriggerDeploymentMetadataActorType +from koyeb.api.models.trigger_deployment_metadata_trigger_type import TriggerDeploymentMetadataTriggerType +from koyeb.api.models.trigger_git_deployment_metadata import TriggerGitDeploymentMetadata +from koyeb.api.models.trigger_git_deployment_metadata_provider import TriggerGitDeploymentMetadataProvider from koyeb.api.models.update_app import UpdateApp from koyeb.api.models.update_app_reply import UpdateAppReply from koyeb.api.models.update_budget_reply import UpdateBudgetReply @@ -461,36 +363,28 @@ from koyeb.api.models.update_credential_reply import UpdateCredentialReply from koyeb.api.models.update_domain import UpdateDomain from koyeb.api.models.update_domain_reply import UpdateDomainReply +from koyeb.api.models.update_organization_default_project_reply import UpdateOrganizationDefaultProjectReply +from koyeb.api.models.update_organization_default_project_request import UpdateOrganizationDefaultProjectRequest from koyeb.api.models.update_organization_name_reply import UpdateOrganizationNameReply -from koyeb.api.models.update_organization_name_request import ( - UpdateOrganizationNameRequest, -) +from koyeb.api.models.update_organization_name_request import UpdateOrganizationNameRequest from koyeb.api.models.update_organization_plan_reply import UpdateOrganizationPlanReply -from koyeb.api.models.update_organization_plan_request import ( - UpdateOrganizationPlanRequest, -) +from koyeb.api.models.update_organization_plan_request import UpdateOrganizationPlanRequest from koyeb.api.models.update_organization_reply import UpdateOrganizationReply from koyeb.api.models.update_password_request import UpdatePasswordRequest from koyeb.api.models.update_persistent_volume_reply import UpdatePersistentVolumeReply -from koyeb.api.models.update_persistent_volume_request import ( - UpdatePersistentVolumeRequest, -) +from koyeb.api.models.update_persistent_volume_request import UpdatePersistentVolumeRequest +from koyeb.api.models.update_project_reply import UpdateProjectReply from koyeb.api.models.update_secret_reply import UpdateSecretReply from koyeb.api.models.update_service import UpdateService from koyeb.api.models.update_service_reply import UpdateServiceReply +from koyeb.api.models.update_service_scaling_request import UpdateServiceScalingRequest from koyeb.api.models.update_snapshot_reply import UpdateSnapshotReply from koyeb.api.models.update_snapshot_request import UpdateSnapshotRequest -from koyeb.api.models.update_user_request_user_update_body import ( - UpdateUserRequestUserUpdateBody, -) +from koyeb.api.models.update_user_request_user_update_body import UpdateUserRequestUserUpdateBody from koyeb.api.models.update_user_settings_reply import UpdateUserSettingsReply from koyeb.api.models.update_user_settings_request import UpdateUserSettingsRequest -from koyeb.api.models.upsert_signup_qualification_reply import ( - UpsertSignupQualificationReply, -) -from koyeb.api.models.upsert_signup_qualification_request import ( - UpsertSignupQualificationRequest, -) +from koyeb.api.models.upsert_signup_qualification_reply import UpsertSignupQualificationReply +from koyeb.api.models.upsert_signup_qualification_request import UpsertSignupQualificationRequest from koyeb.api.models.usage import Usage from koyeb.api.models.usage_details import UsageDetails from koyeb.api.models.user import User @@ -499,6 +393,5 @@ from koyeb.api.models.user_role_role import UserRoleRole from koyeb.api.models.user_settings import UserSettings from koyeb.api.models.verify_docker_image_reply import VerifyDockerImageReply -from koyeb.api.models.verify_docker_image_reply_err_code import ( - VerifyDockerImageReplyErrCode, -) +from koyeb.api.models.verify_docker_image_reply_err_code import VerifyDockerImageReplyErrCode + diff --git a/koyeb/api/models/accept_organization_invitation_reply.py b/koyeb/api/models/accept_organization_invitation_reply.py index 251bacea..b56cc686 100644 --- a/koyeb/api/models/accept_organization_invitation_reply.py +++ b/koyeb/api/models/accept_organization_invitation_reply.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -22,30 +22,30 @@ from koyeb.api.models.organization_invitation import OrganizationInvitation from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class AcceptOrganizationInvitationReply(BaseModel): """ AcceptOrganizationInvitationReply - """ # noqa: E501 - + """ # noqa: E501 invitation: Optional[OrganizationInvitation] = None __properties: ClassVar[List[str]] = ["invitation"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -62,7 +62,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -71,7 +72,7 @@ def to_dict(self) -> Dict[str, Any]: ) # override the default output from pydantic by calling `to_dict()` of invitation if self.invitation: - _dict["invitation"] = self.invitation.to_dict() + _dict['invitation'] = self.invitation.to_dict() return _dict @classmethod @@ -83,13 +84,9 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "invitation": ( - OrganizationInvitation.from_dict(obj["invitation"]) - if obj.get("invitation") is not None - else None - ) - } - ) + _obj = cls.model_validate({ + "invitation": OrganizationInvitation.from_dict(obj["invitation"]) if obj.get("invitation") is not None else None + }) return _obj + + diff --git a/koyeb/api/models/action.py b/koyeb/api/models/action.py index e0131ae6..2c83db3f 100644 --- a/koyeb/api/models/action.py +++ b/koyeb/api/models/action.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -26,11 +26,13 @@ class Action(str, Enum): """ allowed enum values """ - SIGNIN = "signin" - SIGNUP = "signup" - REGISTER = "register" + SIGNIN = 'signin' + SIGNUP = 'signup' + REGISTER = 'register' @classmethod def from_json(cls, json_str: str) -> Self: """Create an instance of Action from a JSON string""" return cls(json.loads(json_str)) + + diff --git a/koyeb/api/models/activity.py b/koyeb/api/models/activity.py index 6a67e010..310d123c 100644 --- a/koyeb/api/models/activity.py +++ b/koyeb/api/models/activity.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -23,42 +23,35 @@ from koyeb.api.models.object import Object from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class Activity(BaseModel): """ Activity - """ # noqa: E501 - + """ # noqa: E501 id: Optional[StrictStr] = None actor: Optional[Object] = None object: Optional[Object] = None verb: Optional[StrictStr] = None metadata: Optional[Dict[str, Any]] = None created_at: Optional[datetime] = None - __properties: ClassVar[List[str]] = [ - "id", - "actor", - "object", - "verb", - "metadata", - "created_at", - ] + __properties: ClassVar[List[str]] = ["id", "actor", "object", "verb", "metadata", "created_at"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -75,7 +68,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -84,10 +78,10 @@ def to_dict(self) -> Dict[str, Any]: ) # override the default output from pydantic by calling `to_dict()` of actor if self.actor: - _dict["actor"] = self.actor.to_dict() + _dict['actor'] = self.actor.to_dict() # override the default output from pydantic by calling `to_dict()` of object if self.object: - _dict["object"] = self.object.to_dict() + _dict['object'] = self.object.to_dict() return _dict @classmethod @@ -99,22 +93,14 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "id": obj.get("id"), - "actor": ( - Object.from_dict(obj["actor"]) - if obj.get("actor") is not None - else None - ), - "object": ( - Object.from_dict(obj["object"]) - if obj.get("object") is not None - else None - ), - "verb": obj.get("verb"), - "metadata": obj.get("metadata"), - "created_at": obj.get("created_at"), - } - ) + _obj = cls.model_validate({ + "id": obj.get("id"), + "actor": Object.from_dict(obj["actor"]) if obj.get("actor") is not None else None, + "object": Object.from_dict(obj["object"]) if obj.get("object") is not None else None, + "verb": obj.get("verb"), + "metadata": obj.get("metadata"), + "created_at": obj.get("created_at") + }) return _obj + + diff --git a/koyeb/api/models/activity_list.py b/koyeb/api/models/activity_list.py index fe0d1582..d2b756cd 100644 --- a/koyeb/api/models/activity_list.py +++ b/koyeb/api/models/activity_list.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -22,13 +22,12 @@ from koyeb.api.models.activity import Activity from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class ActivityList(BaseModel): """ ActivityList - """ # noqa: E501 - + """ # noqa: E501 activities: Optional[List[Activity]] = None limit: Optional[StrictInt] = None offset: Optional[StrictInt] = None @@ -36,19 +35,20 @@ class ActivityList(BaseModel): __properties: ClassVar[List[str]] = ["activities", "limit", "offset", "has_next"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -65,7 +65,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -78,7 +79,7 @@ def to_dict(self) -> Dict[str, Any]: for _item_activities in self.activities: if _item_activities: _items.append(_item_activities.to_dict()) - _dict["activities"] = _items + _dict['activities'] = _items return _dict @classmethod @@ -90,16 +91,12 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "activities": ( - [Activity.from_dict(_item) for _item in obj["activities"]] - if obj.get("activities") is not None - else None - ), - "limit": obj.get("limit"), - "offset": obj.get("offset"), - "has_next": obj.get("has_next"), - } - ) + _obj = cls.model_validate({ + "activities": [Activity.from_dict(_item) for _item in obj["activities"]] if obj.get("activities") is not None else None, + "limit": obj.get("limit"), + "offset": obj.get("offset"), + "has_next": obj.get("has_next") + }) return _obj + + diff --git a/koyeb/api/models/app.py b/koyeb/api/models/app.py index 34ca7b05..030cfc24 100644 --- a/koyeb/api/models/app.py +++ b/koyeb/api/models/app.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -25,13 +25,12 @@ from koyeb.api.models.domain import Domain from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class App(BaseModel): """ App - """ # noqa: E501 - + """ # noqa: E501 id: Optional[StrictStr] = None name: Optional[StrictStr] = None organization_id: Optional[StrictStr] = None @@ -47,38 +46,23 @@ class App(BaseModel): version: Optional[StrictStr] = None domains: Optional[List[Domain]] = None life_cycle: Optional[AppLifeCycle] = None - __properties: ClassVar[List[str]] = [ - "id", - "name", - "organization_id", - "created_at", - "updated_at", - "started_at", - "succeeded_at", - "paused_at", - "resumed_at", - "terminated_at", - "status", - "messages", - "version", - "domains", - "life_cycle", - ] + __properties: ClassVar[List[str]] = ["id", "name", "organization_id", "created_at", "updated_at", "started_at", "succeeded_at", "paused_at", "resumed_at", "terminated_at", "status", "messages", "version", "domains", "life_cycle"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -95,7 +79,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -108,10 +93,10 @@ def to_dict(self) -> Dict[str, Any]: for _item_domains in self.domains: if _item_domains: _items.append(_item_domains.to_dict()) - _dict["domains"] = _items + _dict['domains'] = _items # override the default output from pydantic by calling `to_dict()` of life_cycle if self.life_cycle: - _dict["life_cycle"] = self.life_cycle.to_dict() + _dict['life_cycle'] = self.life_cycle.to_dict() return _dict @classmethod @@ -123,35 +108,23 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "id": obj.get("id"), - "name": obj.get("name"), - "organization_id": obj.get("organization_id"), - "created_at": obj.get("created_at"), - "updated_at": obj.get("updated_at"), - "started_at": obj.get("started_at"), - "succeeded_at": obj.get("succeeded_at"), - "paused_at": obj.get("paused_at"), - "resumed_at": obj.get("resumed_at"), - "terminated_at": obj.get("terminated_at"), - "status": ( - obj.get("status") - if obj.get("status") is not None - else AppStatus.STARTING - ), - "messages": obj.get("messages"), - "version": obj.get("version"), - "domains": ( - [Domain.from_dict(_item) for _item in obj["domains"]] - if obj.get("domains") is not None - else None - ), - "life_cycle": ( - AppLifeCycle.from_dict(obj["life_cycle"]) - if obj.get("life_cycle") is not None - else None - ), - } - ) + _obj = cls.model_validate({ + "id": obj.get("id"), + "name": obj.get("name"), + "organization_id": obj.get("organization_id"), + "created_at": obj.get("created_at"), + "updated_at": obj.get("updated_at"), + "started_at": obj.get("started_at"), + "succeeded_at": obj.get("succeeded_at"), + "paused_at": obj.get("paused_at"), + "resumed_at": obj.get("resumed_at"), + "terminated_at": obj.get("terminated_at"), + "status": obj.get("status") if obj.get("status") is not None else AppStatus.STARTING, + "messages": obj.get("messages"), + "version": obj.get("version"), + "domains": [Domain.from_dict(_item) for _item in obj["domains"]] if obj.get("domains") is not None else None, + "life_cycle": AppLifeCycle.from_dict(obj["life_cycle"]) if obj.get("life_cycle") is not None else None + }) return _obj + + diff --git a/koyeb/api/models/app_event.py b/koyeb/api/models/app_event.py index 6e8108f6..3337861a 100644 --- a/koyeb/api/models/app_event.py +++ b/koyeb/api/models/app_event.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -22,13 +22,12 @@ from typing import Any, ClassVar, Dict, List, Optional from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class AppEvent(BaseModel): """ AppEvent - """ # noqa: E501 - + """ # noqa: E501 id: Optional[StrictStr] = None when: Optional[datetime] = None organization_id: Optional[StrictStr] = None @@ -36,30 +35,23 @@ class AppEvent(BaseModel): type: Optional[StrictStr] = None message: Optional[StrictStr] = None metadata: Optional[Dict[str, Any]] = None - __properties: ClassVar[List[str]] = [ - "id", - "when", - "organization_id", - "app_id", - "type", - "message", - "metadata", - ] + __properties: ClassVar[List[str]] = ["id", "when", "organization_id", "app_id", "type", "message", "metadata"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -76,7 +68,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -94,15 +87,15 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "id": obj.get("id"), - "when": obj.get("when"), - "organization_id": obj.get("organization_id"), - "app_id": obj.get("app_id"), - "type": obj.get("type"), - "message": obj.get("message"), - "metadata": obj.get("metadata"), - } - ) + _obj = cls.model_validate({ + "id": obj.get("id"), + "when": obj.get("when"), + "organization_id": obj.get("organization_id"), + "app_id": obj.get("app_id"), + "type": obj.get("type"), + "message": obj.get("message"), + "metadata": obj.get("metadata") + }) return _obj + + diff --git a/koyeb/api/models/app_life_cycle.py b/koyeb/api/models/app_life_cycle.py index d4f8966f..f5a8b149 100644 --- a/koyeb/api/models/app_life_cycle.py +++ b/koyeb/api/models/app_life_cycle.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -21,30 +21,30 @@ from typing import Any, ClassVar, Dict, List, Optional from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class AppLifeCycle(BaseModel): """ AppLifeCycle - """ # noqa: E501 - + """ # noqa: E501 delete_when_empty: Optional[StrictBool] = None __properties: ClassVar[List[str]] = ["delete_when_empty"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -61,7 +61,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -79,5 +80,9 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({"delete_when_empty": obj.get("delete_when_empty")}) + _obj = cls.model_validate({ + "delete_when_empty": obj.get("delete_when_empty") + }) return _obj + + diff --git a/koyeb/api/models/app_list_item.py b/koyeb/api/models/app_list_item.py index e274bed1..79157da0 100644 --- a/koyeb/api/models/app_list_item.py +++ b/koyeb/api/models/app_list_item.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -24,13 +24,12 @@ from koyeb.api.models.domain import Domain from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class AppListItem(BaseModel): """ AppListItem - """ # noqa: E501 - + """ # noqa: E501 id: Optional[StrictStr] = None name: Optional[StrictStr] = None organization_id: Optional[StrictStr] = None @@ -39,31 +38,23 @@ class AppListItem(BaseModel): domains: Optional[List[Domain]] = None status: Optional[AppStatus] = AppStatus.STARTING messages: Optional[List[StrictStr]] = None - __properties: ClassVar[List[str]] = [ - "id", - "name", - "organization_id", - "updated_at", - "created_at", - "domains", - "status", - "messages", - ] + __properties: ClassVar[List[str]] = ["id", "name", "organization_id", "updated_at", "created_at", "domains", "status", "messages"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -80,7 +71,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -93,7 +85,7 @@ def to_dict(self) -> Dict[str, Any]: for _item_domains in self.domains: if _item_domains: _items.append(_item_domains.to_dict()) - _dict["domains"] = _items + _dict['domains'] = _items return _dict @classmethod @@ -105,24 +97,16 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "id": obj.get("id"), - "name": obj.get("name"), - "organization_id": obj.get("organization_id"), - "updated_at": obj.get("updated_at"), - "created_at": obj.get("created_at"), - "domains": ( - [Domain.from_dict(_item) for _item in obj["domains"]] - if obj.get("domains") is not None - else None - ), - "status": ( - obj.get("status") - if obj.get("status") is not None - else AppStatus.STARTING - ), - "messages": obj.get("messages"), - } - ) + _obj = cls.model_validate({ + "id": obj.get("id"), + "name": obj.get("name"), + "organization_id": obj.get("organization_id"), + "updated_at": obj.get("updated_at"), + "created_at": obj.get("created_at"), + "domains": [Domain.from_dict(_item) for _item in obj["domains"]] if obj.get("domains") is not None else None, + "status": obj.get("status") if obj.get("status") is not None else AppStatus.STARTING, + "messages": obj.get("messages") + }) return _obj + + diff --git a/koyeb/api/models/app_status.py b/koyeb/api/models/app_status.py index d2c01e49..3135ab25 100644 --- a/koyeb/api/models/app_status.py +++ b/koyeb/api/models/app_status.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -26,17 +26,19 @@ class AppStatus(str, Enum): """ allowed enum values """ - STARTING = "STARTING" - HEALTHY = "HEALTHY" - DEGRADED = "DEGRADED" - UNHEALTHY = "UNHEALTHY" - DELETING = "DELETING" - DELETED = "DELETED" - PAUSING = "PAUSING" - PAUSED = "PAUSED" - RESUMING = "RESUMING" + STARTING = 'STARTING' + HEALTHY = 'HEALTHY' + DEGRADED = 'DEGRADED' + UNHEALTHY = 'UNHEALTHY' + DELETING = 'DELETING' + DELETED = 'DELETED' + PAUSING = 'PAUSING' + PAUSED = 'PAUSED' + RESUMING = 'RESUMING' @classmethod def from_json(cls, json_str: str) -> Self: """Create an instance of AppStatus from a JSON string""" return cls(json.loads(json_str)) + + diff --git a/koyeb/api/models/app_usage.py b/koyeb/api/models/app_usage.py index 91b1eac0..3850b283 100644 --- a/koyeb/api/models/app_usage.py +++ b/koyeb/api/models/app_usage.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -23,13 +23,12 @@ from koyeb.api.models.service_usage import ServiceUsage from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class AppUsage(BaseModel): """ AppUsage - """ # noqa: E501 - + """ # noqa: E501 app_id: Optional[StrictStr] = None app_name: Optional[StrictStr] = None services: Optional[List[ServiceUsage]] = None @@ -37,19 +36,20 @@ class AppUsage(BaseModel): __properties: ClassVar[List[str]] = ["app_id", "app_name", "services", "databases"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -66,7 +66,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -79,14 +80,14 @@ def to_dict(self) -> Dict[str, Any]: for _item_services in self.services: if _item_services: _items.append(_item_services.to_dict()) - _dict["services"] = _items + _dict['services'] = _items # override the default output from pydantic by calling `to_dict()` of each item in databases (list) _items = [] if self.databases: for _item_databases in self.databases: if _item_databases: _items.append(_item_databases.to_dict()) - _dict["databases"] = _items + _dict['databases'] = _items return _dict @classmethod @@ -98,20 +99,12 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "app_id": obj.get("app_id"), - "app_name": obj.get("app_name"), - "services": ( - [ServiceUsage.from_dict(_item) for _item in obj["services"]] - if obj.get("services") is not None - else None - ), - "databases": ( - [DatabaseUsage.from_dict(_item) for _item in obj["databases"]] - if obj.get("databases") is not None - else None - ), - } - ) + _obj = cls.model_validate({ + "app_id": obj.get("app_id"), + "app_name": obj.get("app_name"), + "services": [ServiceUsage.from_dict(_item) for _item in obj["services"]] if obj.get("services") is not None else None, + "databases": [DatabaseUsage.from_dict(_item) for _item in obj["databases"]] if obj.get("databases") is not None else None + }) return _obj + + diff --git a/koyeb/api/models/apps_summary.py b/koyeb/api/models/apps_summary.py index b8d9d482..711af28f 100644 --- a/koyeb/api/models/apps_summary.py +++ b/koyeb/api/models/apps_summary.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -21,31 +21,31 @@ from typing import Any, ClassVar, Dict, List, Optional from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class AppsSummary(BaseModel): """ AppsSummary - """ # noqa: E501 - + """ # noqa: E501 total: Optional[StrictStr] = None by_status: Optional[Dict[str, StrictStr]] = None __properties: ClassVar[List[str]] = ["total", "by_status"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -62,7 +62,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -80,7 +81,10 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - {"total": obj.get("total"), "by_status": obj.get("by_status")} - ) + _obj = cls.model_validate({ + "total": obj.get("total"), + "by_status": obj.get("by_status") + }) return _obj + + diff --git a/koyeb/api/models/archive.py b/koyeb/api/models/archive.py index f46cb023..0ff4272d 100644 --- a/koyeb/api/models/archive.py +++ b/koyeb/api/models/archive.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -22,57 +22,35 @@ from typing import Any, ClassVar, Dict, List, Optional from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class Archive(BaseModel): """ Archive - """ # noqa: E501 - - id: Optional[StrictStr] = Field( - default=None, - description="The archive id, that can be referenced when creating or updating a service.", - ) - organization_id: Optional[StrictStr] = Field( - default=None, description="Organization owning the archive." - ) - upload_url: Optional[StrictStr] = Field( - default=None, - description="The URL where to upload the archive. This URL is signed and can only be used to upload the archive until `valid_until`.", - ) - size: Optional[StrictStr] = Field( - default=None, description="The provisioned space for the archive." - ) - created_at: Optional[datetime] = Field( - default=None, description="Date of creation of the archive." - ) - deleted_at: Optional[datetime] = Field( - default=None, - description="This field is automatically set by Koyeb when the archive is garbage collected.", - ) - __properties: ClassVar[List[str]] = [ - "id", - "organization_id", - "upload_url", - "size", - "created_at", - "deleted_at", - ] + """ # noqa: E501 + id: Optional[StrictStr] = Field(default=None, description="The archive id, that can be referenced when creating or updating a service.") + organization_id: Optional[StrictStr] = Field(default=None, description="Organization owning the archive.") + upload_url: Optional[StrictStr] = Field(default=None, description="The URL where to upload the archive. This URL is signed and can only be used to upload the archive until `valid_until`.") + size: Optional[StrictStr] = Field(default=None, description="The provisioned space for the archive.") + created_at: Optional[datetime] = Field(default=None, description="Date of creation of the archive.") + deleted_at: Optional[datetime] = Field(default=None, description="This field is automatically set by Koyeb when the archive is garbage collected.") + __properties: ClassVar[List[str]] = ["id", "organization_id", "upload_url", "size", "created_at", "deleted_at"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -89,7 +67,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -107,14 +86,14 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "id": obj.get("id"), - "organization_id": obj.get("organization_id"), - "upload_url": obj.get("upload_url"), - "size": obj.get("size"), - "created_at": obj.get("created_at"), - "deleted_at": obj.get("deleted_at"), - } - ) + _obj = cls.model_validate({ + "id": obj.get("id"), + "organization_id": obj.get("organization_id"), + "upload_url": obj.get("upload_url"), + "size": obj.get("size"), + "created_at": obj.get("created_at"), + "deleted_at": obj.get("deleted_at") + }) return _obj + + diff --git a/koyeb/api/models/archive_deployment_metadata.py b/koyeb/api/models/archive_deployment_metadata.py index 4e0fd41f..a0e92d47 100644 --- a/koyeb/api/models/archive_deployment_metadata.py +++ b/koyeb/api/models/archive_deployment_metadata.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -21,30 +21,30 @@ from typing import Any, ClassVar, Dict, List, Optional from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class ArchiveDeploymentMetadata(BaseModel): """ ArchiveDeploymentMetadata - """ # noqa: E501 - + """ # noqa: E501 last_provisioned_deployment_id: Optional[StrictStr] = None __properties: ClassVar[List[str]] = ["last_provisioned_deployment_id"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -61,7 +61,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -79,11 +80,9 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "last_provisioned_deployment_id": obj.get( - "last_provisioned_deployment_id" - ) - } - ) + _obj = cls.model_validate({ + "last_provisioned_deployment_id": obj.get("last_provisioned_deployment_id") + }) return _obj + + diff --git a/koyeb/api/models/archive_source.py b/koyeb/api/models/archive_source.py index 2d5f29c9..4eca733c 100644 --- a/koyeb/api/models/archive_source.py +++ b/koyeb/api/models/archive_source.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -23,32 +23,32 @@ from koyeb.api.models.docker_builder import DockerBuilder from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class ArchiveSource(BaseModel): """ ArchiveSource - """ # noqa: E501 - + """ # noqa: E501 id: Optional[StrictStr] = None buildpack: Optional[BuildpackBuilder] = None docker: Optional[DockerBuilder] = None __properties: ClassVar[List[str]] = ["id", "buildpack", "docker"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -65,7 +65,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -74,10 +75,10 @@ def to_dict(self) -> Dict[str, Any]: ) # override the default output from pydantic by calling `to_dict()` of buildpack if self.buildpack: - _dict["buildpack"] = self.buildpack.to_dict() + _dict['buildpack'] = self.buildpack.to_dict() # override the default output from pydantic by calling `to_dict()` of docker if self.docker: - _dict["docker"] = self.docker.to_dict() + _dict['docker'] = self.docker.to_dict() return _dict @classmethod @@ -89,19 +90,11 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "id": obj.get("id"), - "buildpack": ( - BuildpackBuilder.from_dict(obj["buildpack"]) - if obj.get("buildpack") is not None - else None - ), - "docker": ( - DockerBuilder.from_dict(obj["docker"]) - if obj.get("docker") is not None - else None - ), - } - ) + _obj = cls.model_validate({ + "id": obj.get("id"), + "buildpack": BuildpackBuilder.from_dict(obj["buildpack"]) if obj.get("buildpack") is not None else None, + "docker": DockerBuilder.from_dict(obj["docker"]) if obj.get("docker") is not None else None + }) return _obj + + diff --git a/koyeb/api/models/auto_release.py b/koyeb/api/models/auto_release.py index 6ae5cef9..b61e45f3 100644 --- a/koyeb/api/models/auto_release.py +++ b/koyeb/api/models/auto_release.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -22,30 +22,30 @@ from koyeb.api.models.auto_release_group import AutoReleaseGroup from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class AutoRelease(BaseModel): """ AutoRelease - """ # noqa: E501 - + """ # noqa: E501 groups: Optional[List[AutoReleaseGroup]] = None __properties: ClassVar[List[str]] = ["groups"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -62,7 +62,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -75,7 +76,7 @@ def to_dict(self) -> Dict[str, Any]: for _item_groups in self.groups: if _item_groups: _items.append(_item_groups.to_dict()) - _dict["groups"] = _items + _dict['groups'] = _items return _dict @classmethod @@ -87,13 +88,9 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "groups": ( - [AutoReleaseGroup.from_dict(_item) for _item in obj["groups"]] - if obj.get("groups") is not None - else None - ) - } - ) + _obj = cls.model_validate({ + "groups": [AutoReleaseGroup.from_dict(_item) for _item in obj["groups"]] if obj.get("groups") is not None else None + }) return _obj + + diff --git a/koyeb/api/models/auto_release_group.py b/koyeb/api/models/auto_release_group.py index 357dc05c..ec0bb0b4 100644 --- a/koyeb/api/models/auto_release_group.py +++ b/koyeb/api/models/auto_release_group.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -21,13 +21,12 @@ from typing import Any, ClassVar, Dict, List, Optional from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class AutoReleaseGroup(BaseModel): """ AutoReleaseGroup - """ # noqa: E501 - + """ # noqa: E501 name: Optional[StrictStr] = None repository: Optional[StrictStr] = None git_ref: Optional[StrictStr] = None @@ -35,19 +34,20 @@ class AutoReleaseGroup(BaseModel): __properties: ClassVar[List[str]] = ["name", "repository", "git_ref", "latest_sha"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -64,7 +64,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -82,12 +83,12 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "name": obj.get("name"), - "repository": obj.get("repository"), - "git_ref": obj.get("git_ref"), - "latest_sha": obj.get("latest_sha"), - } - ) + _obj = cls.model_validate({ + "name": obj.get("name"), + "repository": obj.get("repository"), + "git_ref": obj.get("git_ref"), + "latest_sha": obj.get("latest_sha") + }) return _obj + + diff --git a/koyeb/api/models/autocomplete_reply.py b/koyeb/api/models/autocomplete_reply.py index f97bb9e8..d43bd098 100644 --- a/koyeb/api/models/autocomplete_reply.py +++ b/koyeb/api/models/autocomplete_reply.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -21,32 +21,32 @@ from typing import Any, ClassVar, Dict, List, Optional from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class AutocompleteReply(BaseModel): """ AutocompleteReply - """ # noqa: E501 - + """ # noqa: E501 secrets: Optional[List[StrictStr]] = None user_env: Optional[List[StrictStr]] = None system_env: Optional[List[StrictStr]] = None __properties: ClassVar[List[str]] = ["secrets", "user_env", "system_env"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -63,7 +63,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -81,11 +82,11 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "secrets": obj.get("secrets"), - "user_env": obj.get("user_env"), - "system_env": obj.get("system_env"), - } - ) + _obj = cls.model_validate({ + "secrets": obj.get("secrets"), + "user_env": obj.get("user_env"), + "system_env": obj.get("system_env") + }) return _obj + + diff --git a/koyeb/api/models/autocomplete_request.py b/koyeb/api/models/autocomplete_request.py index 2cddb407..12f88813 100644 --- a/koyeb/api/models/autocomplete_request.py +++ b/koyeb/api/models/autocomplete_request.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -22,30 +22,30 @@ from koyeb.api.models.deployment_definition import DeploymentDefinition from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class AutocompleteRequest(BaseModel): """ AutocompleteRequest - """ # noqa: E501 - + """ # noqa: E501 definition: Optional[DeploymentDefinition] = None __properties: ClassVar[List[str]] = ["definition"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -62,7 +62,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -71,7 +72,7 @@ def to_dict(self) -> Dict[str, Any]: ) # override the default output from pydantic by calling `to_dict()` of definition if self.definition: - _dict["definition"] = self.definition.to_dict() + _dict['definition'] = self.definition.to_dict() return _dict @classmethod @@ -83,13 +84,9 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "definition": ( - DeploymentDefinition.from_dict(obj["definition"]) - if obj.get("definition") is not None - else None - ) - } - ) + _obj = cls.model_validate({ + "definition": DeploymentDefinition.from_dict(obj["definition"]) if obj.get("definition") is not None else None + }) return _obj + + diff --git a/koyeb/api/models/availability_level.py b/koyeb/api/models/availability_level.py index 3c84a955..b3af7346 100644 --- a/koyeb/api/models/availability_level.py +++ b/koyeb/api/models/availability_level.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -26,12 +26,14 @@ class AvailabilityLevel(str, Enum): """ allowed enum values """ - UNKNOWN = "UNKNOWN" - LOW = "LOW" - MEDIUM = "MEDIUM" - HIGH = "HIGH" + UNKNOWN = 'UNKNOWN' + LOW = 'LOW' + MEDIUM = 'MEDIUM' + HIGH = 'HIGH' @classmethod def from_json(cls, json_str: str) -> Self: """Create an instance of AvailabilityLevel from a JSON string""" return cls(json.loads(json_str)) + + diff --git a/koyeb/api/models/azure_container_registry_configuration.py b/koyeb/api/models/azure_container_registry_configuration.py index bf23e924..487232a6 100644 --- a/koyeb/api/models/azure_container_registry_configuration.py +++ b/koyeb/api/models/azure_container_registry_configuration.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -21,32 +21,32 @@ from typing import Any, ClassVar, Dict, List, Optional from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class AzureContainerRegistryConfiguration(BaseModel): """ AzureContainerRegistryConfiguration - """ # noqa: E501 - + """ # noqa: E501 registry_name: Optional[StrictStr] = None username: Optional[StrictStr] = None password: Optional[StrictStr] = None __properties: ClassVar[List[str]] = ["registry_name", "username", "password"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -63,7 +63,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -81,11 +82,11 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "registry_name": obj.get("registry_name"), - "username": obj.get("username"), - "password": obj.get("password"), - } - ) + _obj = cls.model_validate({ + "registry_name": obj.get("registry_name"), + "username": obj.get("username"), + "password": obj.get("password") + }) return _obj + + diff --git a/koyeb/api/models/basic_auth_policy.py b/koyeb/api/models/basic_auth_policy.py new file mode 100644 index 00000000..c280abe2 --- /dev/null +++ b/koyeb/api/models/basic_auth_policy.py @@ -0,0 +1,90 @@ +# coding: utf-8 + +""" + Koyeb Rest API + + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class BasicAuthPolicy(BaseModel): + """ + BasicAuthPolicy + """ # noqa: E501 + username: Optional[StrictStr] = None + password: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["username", "password"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of BasicAuthPolicy from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of BasicAuthPolicy from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "username": obj.get("username"), + "password": obj.get("password") + }) + return _obj + + diff --git a/koyeb/api/models/budget.py b/koyeb/api/models/budget.py index e25c00f1..824506f8 100644 --- a/koyeb/api/models/budget.py +++ b/koyeb/api/models/budget.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -21,31 +21,31 @@ from typing import Any, ClassVar, Dict, List, Optional from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class Budget(BaseModel): """ Budget - """ # noqa: E501 - + """ # noqa: E501 amount: Optional[StrictStr] = None thresholds: Optional[List[StrictStr]] = None __properties: ClassVar[List[str]] = ["amount", "thresholds"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -62,7 +62,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -80,7 +81,10 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - {"amount": obj.get("amount"), "thresholds": obj.get("thresholds")} - ) + _obj = cls.model_validate({ + "amount": obj.get("amount"), + "thresholds": obj.get("thresholds") + }) return _obj + + diff --git a/koyeb/api/models/buildpack_builder.py b/koyeb/api/models/buildpack_builder.py index 237340cc..4854af47 100644 --- a/koyeb/api/models/buildpack_builder.py +++ b/koyeb/api/models/buildpack_builder.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -21,32 +21,32 @@ from typing import Any, ClassVar, Dict, List, Optional from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class BuildpackBuilder(BaseModel): """ BuildpackBuilder - """ # noqa: E501 - + """ # noqa: E501 build_command: Optional[StrictStr] = None run_command: Optional[StrictStr] = None privileged: Optional[StrictBool] = None __properties: ClassVar[List[str]] = ["build_command", "run_command", "privileged"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -63,7 +63,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -81,11 +82,11 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "build_command": obj.get("build_command"), - "run_command": obj.get("run_command"), - "privileged": obj.get("privileged"), - } - ) + _obj = cls.model_validate({ + "build_command": obj.get("build_command"), + "run_command": obj.get("run_command"), + "privileged": obj.get("privileged") + }) return _obj + + diff --git a/koyeb/api/models/canny_auth_reply.py b/koyeb/api/models/canny_auth_reply.py index 56ca275a..d3c71df3 100644 --- a/koyeb/api/models/canny_auth_reply.py +++ b/koyeb/api/models/canny_auth_reply.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -21,30 +21,30 @@ from typing import Any, ClassVar, Dict, List, Optional from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class CannyAuthReply(BaseModel): """ CannyAuthReply - """ # noqa: E501 - + """ # noqa: E501 token: Optional[StrictStr] = None __properties: ClassVar[List[str]] = ["token"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -61,7 +61,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -79,5 +80,9 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({"token": obj.get("token")}) + _obj = cls.model_validate({ + "token": obj.get("token") + }) return _obj + + diff --git a/koyeb/api/models/catalog_gpu_details.py b/koyeb/api/models/catalog_gpu_details.py index 687d11b1..4f7a7ad5 100644 --- a/koyeb/api/models/catalog_gpu_details.py +++ b/koyeb/api/models/catalog_gpu_details.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -21,13 +21,12 @@ from typing import Any, ClassVar, Dict, List, Optional from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class CatalogGPUDetails(BaseModel): """ CatalogGPUDetails - """ # noqa: E501 - + """ # noqa: E501 count: Optional[StrictInt] = None brand: Optional[StrictStr] = None memory: Optional[StrictStr] = None @@ -35,19 +34,20 @@ class CatalogGPUDetails(BaseModel): __properties: ClassVar[List[str]] = ["count", "brand", "memory", "name"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -64,7 +64,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -82,12 +83,12 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "count": obj.get("count"), - "brand": obj.get("brand"), - "memory": obj.get("memory"), - "name": obj.get("name"), - } - ) + _obj = cls.model_validate({ + "count": obj.get("count"), + "brand": obj.get("brand"), + "memory": obj.get("memory"), + "name": obj.get("name") + }) return _obj + + diff --git a/koyeb/api/models/catalog_instance.py b/koyeb/api/models/catalog_instance.py index 60b0df0f..628b3c7c 100644 --- a/koyeb/api/models/catalog_instance.py +++ b/koyeb/api/models/catalog_instance.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -17,32 +17,20 @@ import re # noqa: F401 import json -from pydantic import ( - BaseModel, - ConfigDict, - Field, - StrictBool, - StrictFloat, - StrictInt, - StrictStr, -) +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictFloat, StrictInt, StrictStr from typing import Any, ClassVar, Dict, List, Optional, Union from koyeb.api.models.catalog_gpu_details import CatalogGPUDetails from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class CatalogInstance(BaseModel): """ CatalogInstance - """ # noqa: E501 - + """ # noqa: E501 id: Optional[StrictStr] = None description: Optional[StrictStr] = None - vcpu: Optional[StrictInt] = Field( - default=None, - description="The number of cpus. Deprecated. Use vcpu_shares instead.", - ) + vcpu: Optional[StrictInt] = Field(default=None, description="The number of cpus. Deprecated. Use vcpu_shares instead.") memory: Optional[StrictStr] = None disk: Optional[StrictStr] = None price_per_second: Optional[StrictStr] = None @@ -51,9 +39,7 @@ class CatalogInstance(BaseModel): regions: Optional[List[StrictStr]] = None status: Optional[StrictStr] = None require_plan: Optional[List[StrictStr]] = None - vcpu_shares: Optional[Union[StrictFloat, StrictInt]] = Field( - default=None, description="The number of vcpu shares reserved for the instance." - ) + vcpu_shares: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="The number of vcpu shares reserved for the instance.") display_name: Optional[StrictStr] = None aliases: Optional[List[StrictStr]] = None type: Optional[StrictStr] = None @@ -61,42 +47,23 @@ class CatalogInstance(BaseModel): service_types: Optional[List[StrictStr]] = None volumes_enabled: Optional[StrictBool] = None light_sleep_enabled: Optional[StrictBool] = None - __properties: ClassVar[List[str]] = [ - "id", - "description", - "vcpu", - "memory", - "disk", - "price_per_second", - "price_hourly", - "price_monthly", - "regions", - "status", - "require_plan", - "vcpu_shares", - "display_name", - "aliases", - "type", - "gpu", - "service_types", - "volumes_enabled", - "light_sleep_enabled", - ] + __properties: ClassVar[List[str]] = ["id", "description", "vcpu", "memory", "disk", "price_per_second", "price_hourly", "price_monthly", "regions", "status", "require_plan", "vcpu_shares", "display_name", "aliases", "type", "gpu", "service_types", "volumes_enabled", "light_sleep_enabled"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -113,7 +80,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -122,7 +90,7 @@ def to_dict(self) -> Dict[str, Any]: ) # override the default output from pydantic by calling `to_dict()` of gpu if self.gpu: - _dict["gpu"] = self.gpu.to_dict() + _dict['gpu'] = self.gpu.to_dict() return _dict @classmethod @@ -134,31 +102,27 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "id": obj.get("id"), - "description": obj.get("description"), - "vcpu": obj.get("vcpu"), - "memory": obj.get("memory"), - "disk": obj.get("disk"), - "price_per_second": obj.get("price_per_second"), - "price_hourly": obj.get("price_hourly"), - "price_monthly": obj.get("price_monthly"), - "regions": obj.get("regions"), - "status": obj.get("status"), - "require_plan": obj.get("require_plan"), - "vcpu_shares": obj.get("vcpu_shares"), - "display_name": obj.get("display_name"), - "aliases": obj.get("aliases"), - "type": obj.get("type"), - "gpu": ( - CatalogGPUDetails.from_dict(obj["gpu"]) - if obj.get("gpu") is not None - else None - ), - "service_types": obj.get("service_types"), - "volumes_enabled": obj.get("volumes_enabled"), - "light_sleep_enabled": obj.get("light_sleep_enabled"), - } - ) + _obj = cls.model_validate({ + "id": obj.get("id"), + "description": obj.get("description"), + "vcpu": obj.get("vcpu"), + "memory": obj.get("memory"), + "disk": obj.get("disk"), + "price_per_second": obj.get("price_per_second"), + "price_hourly": obj.get("price_hourly"), + "price_monthly": obj.get("price_monthly"), + "regions": obj.get("regions"), + "status": obj.get("status"), + "require_plan": obj.get("require_plan"), + "vcpu_shares": obj.get("vcpu_shares"), + "display_name": obj.get("display_name"), + "aliases": obj.get("aliases"), + "type": obj.get("type"), + "gpu": CatalogGPUDetails.from_dict(obj["gpu"]) if obj.get("gpu") is not None else None, + "service_types": obj.get("service_types"), + "volumes_enabled": obj.get("volumes_enabled"), + "light_sleep_enabled": obj.get("light_sleep_enabled") + }) return _obj + + diff --git a/koyeb/api/models/catalog_instance_list_item.py b/koyeb/api/models/catalog_instance_list_item.py index 14670e96..657d0563 100644 --- a/koyeb/api/models/catalog_instance_list_item.py +++ b/koyeb/api/models/catalog_instance_list_item.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -17,32 +17,20 @@ import re # noqa: F401 import json -from pydantic import ( - BaseModel, - ConfigDict, - Field, - StrictBool, - StrictFloat, - StrictInt, - StrictStr, -) +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictFloat, StrictInt, StrictStr from typing import Any, ClassVar, Dict, List, Optional, Union from koyeb.api.models.catalog_gpu_details import CatalogGPUDetails from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class CatalogInstanceListItem(BaseModel): """ CatalogInstanceListItem - """ # noqa: E501 - + """ # noqa: E501 id: Optional[StrictStr] = None description: Optional[StrictStr] = None - vcpu: Optional[StrictInt] = Field( - default=None, - description="The number of cpus. Deprecated. Use vcpu_shares instead.", - ) + vcpu: Optional[StrictInt] = Field(default=None, description="The number of cpus. Deprecated. Use vcpu_shares instead.") memory: Optional[StrictStr] = None disk: Optional[StrictStr] = None price_per_second: Optional[StrictStr] = None @@ -51,9 +39,7 @@ class CatalogInstanceListItem(BaseModel): regions: Optional[List[StrictStr]] = None status: Optional[StrictStr] = None require_plan: Optional[List[StrictStr]] = None - vcpu_shares: Optional[Union[StrictFloat, StrictInt]] = Field( - default=None, description="The number of vcpu shares reserved for the instance." - ) + vcpu_shares: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="The number of vcpu shares reserved for the instance.") display_name: Optional[StrictStr] = None aliases: Optional[List[StrictStr]] = None type: Optional[StrictStr] = None @@ -61,42 +47,23 @@ class CatalogInstanceListItem(BaseModel): service_types: Optional[List[StrictStr]] = None volumes_enabled: Optional[StrictBool] = None light_sleep_enabled: Optional[StrictBool] = None - __properties: ClassVar[List[str]] = [ - "id", - "description", - "vcpu", - "memory", - "disk", - "price_per_second", - "price_hourly", - "price_monthly", - "regions", - "status", - "require_plan", - "vcpu_shares", - "display_name", - "aliases", - "type", - "gpu", - "service_types", - "volumes_enabled", - "light_sleep_enabled", - ] + __properties: ClassVar[List[str]] = ["id", "description", "vcpu", "memory", "disk", "price_per_second", "price_hourly", "price_monthly", "regions", "status", "require_plan", "vcpu_shares", "display_name", "aliases", "type", "gpu", "service_types", "volumes_enabled", "light_sleep_enabled"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -113,7 +80,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -122,7 +90,7 @@ def to_dict(self) -> Dict[str, Any]: ) # override the default output from pydantic by calling `to_dict()` of gpu if self.gpu: - _dict["gpu"] = self.gpu.to_dict() + _dict['gpu'] = self.gpu.to_dict() return _dict @classmethod @@ -134,31 +102,27 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "id": obj.get("id"), - "description": obj.get("description"), - "vcpu": obj.get("vcpu"), - "memory": obj.get("memory"), - "disk": obj.get("disk"), - "price_per_second": obj.get("price_per_second"), - "price_hourly": obj.get("price_hourly"), - "price_monthly": obj.get("price_monthly"), - "regions": obj.get("regions"), - "status": obj.get("status"), - "require_plan": obj.get("require_plan"), - "vcpu_shares": obj.get("vcpu_shares"), - "display_name": obj.get("display_name"), - "aliases": obj.get("aliases"), - "type": obj.get("type"), - "gpu": ( - CatalogGPUDetails.from_dict(obj["gpu"]) - if obj.get("gpu") is not None - else None - ), - "service_types": obj.get("service_types"), - "volumes_enabled": obj.get("volumes_enabled"), - "light_sleep_enabled": obj.get("light_sleep_enabled"), - } - ) + _obj = cls.model_validate({ + "id": obj.get("id"), + "description": obj.get("description"), + "vcpu": obj.get("vcpu"), + "memory": obj.get("memory"), + "disk": obj.get("disk"), + "price_per_second": obj.get("price_per_second"), + "price_hourly": obj.get("price_hourly"), + "price_monthly": obj.get("price_monthly"), + "regions": obj.get("regions"), + "status": obj.get("status"), + "require_plan": obj.get("require_plan"), + "vcpu_shares": obj.get("vcpu_shares"), + "display_name": obj.get("display_name"), + "aliases": obj.get("aliases"), + "type": obj.get("type"), + "gpu": CatalogGPUDetails.from_dict(obj["gpu"]) if obj.get("gpu") is not None else None, + "service_types": obj.get("service_types"), + "volumes_enabled": obj.get("volumes_enabled"), + "light_sleep_enabled": obj.get("light_sleep_enabled") + }) return _obj + + diff --git a/koyeb/api/models/catalog_usage.py b/koyeb/api/models/catalog_usage.py index a1ba6251..e4e4c9f2 100644 --- a/koyeb/api/models/catalog_usage.py +++ b/koyeb/api/models/catalog_usage.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -22,30 +22,30 @@ from koyeb.api.models.instance_availability import InstanceAvailability from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class CatalogUsage(BaseModel): """ CatalogUsage - """ # noqa: E501 - + """ # noqa: E501 instances: Optional[Dict[str, InstanceAvailability]] = None __properties: ClassVar[List[str]] = ["instances"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -62,7 +62,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -74,10 +75,8 @@ def to_dict(self) -> Dict[str, Any]: if self.instances: for _key_instances in self.instances: if self.instances[_key_instances]: - _field_dict[_key_instances] = self.instances[ - _key_instances - ].to_dict() - _dict["instances"] = _field_dict + _field_dict[_key_instances] = self.instances[_key_instances].to_dict() + _dict['instances'] = _field_dict return _dict @classmethod @@ -89,16 +88,14 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "instances": ( - dict( - (_k, InstanceAvailability.from_dict(_v)) - for _k, _v in obj["instances"].items() - ) - if obj.get("instances") is not None - else None - ) - } - ) + _obj = cls.model_validate({ + "instances": dict( + (_k, InstanceAvailability.from_dict(_v)) + for _k, _v in obj["instances"].items() + ) + if obj.get("instances") is not None + else None + }) return _obj + + diff --git a/koyeb/api/models/check_coupon_reply.py b/koyeb/api/models/check_coupon_reply.py new file mode 100644 index 00000000..2a13bd32 --- /dev/null +++ b/koyeb/api/models/check_coupon_reply.py @@ -0,0 +1,94 @@ +# coding: utf-8 + +""" + Koyeb Rest API + + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictFloat, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional, Union +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class CheckCouponReply(BaseModel): + """ + CheckCouponReply + """ # noqa: E501 + name: Optional[StrictStr] = None + percent_off: Optional[Union[StrictFloat, StrictInt]] = None + amount_off: Optional[StrictStr] = None + currency: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["name", "percent_off", "amount_off", "currency"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of CheckCouponReply from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CheckCouponReply from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "name": obj.get("name"), + "percent_off": obj.get("percent_off"), + "amount_off": obj.get("amount_off"), + "currency": obj.get("currency") + }) + return _obj + + diff --git a/koyeb/api/models/clear_idenfy_verification_result_request.py b/koyeb/api/models/clear_idenfy_verification_result_request.py index 946a3f7e..ebf9fd32 100644 --- a/koyeb/api/models/clear_idenfy_verification_result_request.py +++ b/koyeb/api/models/clear_idenfy_verification_result_request.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -21,31 +21,31 @@ from typing import Any, ClassVar, Dict, List, Optional from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class ClearIdenfyVerificationResultRequest(BaseModel): """ ClearIdenfyVerificationResultRequest - """ # noqa: E501 - + """ # noqa: E501 user_id: Optional[StrictStr] = None organization_id: Optional[StrictStr] = None __properties: ClassVar[List[str]] = ["user_id", "organization_id"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -62,7 +62,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -80,10 +81,10 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "user_id": obj.get("user_id"), - "organization_id": obj.get("organization_id"), - } - ) + _obj = cls.model_validate({ + "user_id": obj.get("user_id"), + "organization_id": obj.get("organization_id") + }) return _obj + + diff --git a/koyeb/api/models/compose_reply.py b/koyeb/api/models/compose_reply.py index d2ea4223..a7a8b20f 100644 --- a/koyeb/api/models/compose_reply.py +++ b/koyeb/api/models/compose_reply.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -23,31 +23,31 @@ from koyeb.api.models.service import Service from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class ComposeReply(BaseModel): """ ComposeReply - """ # noqa: E501 - + """ # noqa: E501 app: Optional[App] = None services: Optional[List[Service]] = None __properties: ClassVar[List[str]] = ["app", "services"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -64,7 +64,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -73,14 +74,14 @@ def to_dict(self) -> Dict[str, Any]: ) # override the default output from pydantic by calling `to_dict()` of app if self.app: - _dict["app"] = self.app.to_dict() + _dict['app'] = self.app.to_dict() # override the default output from pydantic by calling `to_dict()` of each item in services (list) _items = [] if self.services: for _item_services in self.services: if _item_services: _items.append(_item_services.to_dict()) - _dict["services"] = _items + _dict['services'] = _items return _dict @classmethod @@ -92,16 +93,10 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "app": ( - App.from_dict(obj["app"]) if obj.get("app") is not None else None - ), - "services": ( - [Service.from_dict(_item) for _item in obj["services"]] - if obj.get("services") is not None - else None - ), - } - ) + _obj = cls.model_validate({ + "app": App.from_dict(obj["app"]) if obj.get("app") is not None else None, + "services": [Service.from_dict(_item) for _item in obj["services"]] if obj.get("services") is not None else None + }) return _obj + + diff --git a/koyeb/api/models/config_file.py b/koyeb/api/models/config_file.py index e6db013a..b8e444e5 100644 --- a/koyeb/api/models/config_file.py +++ b/koyeb/api/models/config_file.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -21,32 +21,32 @@ from typing import Any, ClassVar, Dict, List, Optional from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class ConfigFile(BaseModel): """ ConfigFile - """ # noqa: E501 - + """ # noqa: E501 path: Optional[StrictStr] = None permissions: Optional[StrictStr] = None content: Optional[StrictStr] = None __properties: ClassVar[List[str]] = ["path", "permissions", "content"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -63,7 +63,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -81,11 +82,11 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "path": obj.get("path"), - "permissions": obj.get("permissions"), - "content": obj.get("content"), - } - ) + _obj = cls.model_validate({ + "path": obj.get("path"), + "permissions": obj.get("permissions"), + "content": obj.get("content") + }) return _obj + + diff --git a/koyeb/api/models/confirm_payment_authorization_reply.py b/koyeb/api/models/confirm_payment_authorization_reply.py index aa5bf0ae..5faf5228 100644 --- a/koyeb/api/models/confirm_payment_authorization_reply.py +++ b/koyeb/api/models/confirm_payment_authorization_reply.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -22,30 +22,30 @@ from koyeb.api.models.payment_method import PaymentMethod from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class ConfirmPaymentAuthorizationReply(BaseModel): """ ConfirmPaymentAuthorizationReply - """ # noqa: E501 - + """ # noqa: E501 payment_method: Optional[PaymentMethod] = None __properties: ClassVar[List[str]] = ["payment_method"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -62,7 +62,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -71,7 +72,7 @@ def to_dict(self) -> Dict[str, Any]: ) # override the default output from pydantic by calling `to_dict()` of payment_method if self.payment_method: - _dict["payment_method"] = self.payment_method.to_dict() + _dict['payment_method'] = self.payment_method.to_dict() return _dict @classmethod @@ -83,13 +84,9 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "payment_method": ( - PaymentMethod.from_dict(obj["payment_method"]) - if obj.get("payment_method") is not None - else None - ) - } - ) + _obj = cls.model_validate({ + "payment_method": PaymentMethod.from_dict(obj["payment_method"]) if obj.get("payment_method") is not None else None + }) return _obj + + diff --git a/koyeb/api/models/create_access_token_reply.py b/koyeb/api/models/create_access_token_reply.py index 281b5a30..23a91db2 100644 --- a/koyeb/api/models/create_access_token_reply.py +++ b/koyeb/api/models/create_access_token_reply.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -21,30 +21,30 @@ from typing import Any, ClassVar, Dict, List, Optional from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class CreateAccessTokenReply(BaseModel): """ CreateAccessTokenReply - """ # noqa: E501 - + """ # noqa: E501 token: Optional[StrictStr] = None __properties: ClassVar[List[str]] = ["token"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -61,7 +61,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -79,5 +80,9 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({"token": obj.get("token")}) + _obj = cls.model_validate({ + "token": obj.get("token") + }) return _obj + + diff --git a/koyeb/api/models/create_access_token_request.py b/koyeb/api/models/create_access_token_request.py index 1cf05f13..fa9b6d85 100644 --- a/koyeb/api/models/create_access_token_request.py +++ b/koyeb/api/models/create_access_token_request.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -21,30 +21,30 @@ from typing import Any, ClassVar, Dict, List, Optional from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class CreateAccessTokenRequest(BaseModel): """ CreateAccessTokenRequest - """ # noqa: E501 - + """ # noqa: E501 validity: Optional[StrictStr] = None __properties: ClassVar[List[str]] = ["validity"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -61,7 +61,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -79,5 +80,9 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({"validity": obj.get("validity")}) + _obj = cls.model_validate({ + "validity": obj.get("validity") + }) return _obj + + diff --git a/koyeb/api/models/create_account_request.py b/koyeb/api/models/create_account_request.py index 1ec7abdf..a076eec5 100644 --- a/koyeb/api/models/create_account_request.py +++ b/koyeb/api/models/create_account_request.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -21,13 +21,12 @@ from typing import Any, ClassVar, Dict, List, Optional from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class CreateAccountRequest(BaseModel): """ Create new account - """ # noqa: E501 - + """ # noqa: E501 email: StrictStr password: StrictStr name: Optional[StrictStr] = None @@ -35,19 +34,20 @@ class CreateAccountRequest(BaseModel): __properties: ClassVar[List[str]] = ["email", "password", "name", "captcha"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -64,7 +64,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -82,12 +83,12 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "email": obj.get("email"), - "password": obj.get("password"), - "name": obj.get("name"), - "captcha": obj.get("captcha"), - } - ) + _obj = cls.model_validate({ + "email": obj.get("email"), + "password": obj.get("password"), + "name": obj.get("name"), + "captcha": obj.get("captcha") + }) return _obj + + diff --git a/koyeb/api/models/create_app.py b/koyeb/api/models/create_app.py index 9beeda55..c7073e4b 100644 --- a/koyeb/api/models/create_app.py +++ b/koyeb/api/models/create_app.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -22,31 +22,32 @@ from koyeb.api.models.app_life_cycle import AppLifeCycle from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class CreateApp(BaseModel): """ CreateApp - """ # noqa: E501 - + """ # noqa: E501 name: Optional[StrictStr] = None life_cycle: Optional[AppLifeCycle] = None - __properties: ClassVar[List[str]] = ["name", "life_cycle"] + project_id: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["name", "life_cycle", "project_id"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -63,7 +64,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -72,7 +74,7 @@ def to_dict(self) -> Dict[str, Any]: ) # override the default output from pydantic by calling `to_dict()` of life_cycle if self.life_cycle: - _dict["life_cycle"] = self.life_cycle.to_dict() + _dict['life_cycle'] = self.life_cycle.to_dict() return _dict @classmethod @@ -84,14 +86,11 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "name": obj.get("name"), - "life_cycle": ( - AppLifeCycle.from_dict(obj["life_cycle"]) - if obj.get("life_cycle") is not None - else None - ), - } - ) + _obj = cls.model_validate({ + "name": obj.get("name"), + "life_cycle": AppLifeCycle.from_dict(obj["life_cycle"]) if obj.get("life_cycle") is not None else None, + "project_id": obj.get("project_id") + }) return _obj + + diff --git a/koyeb/api/models/create_app_reply.py b/koyeb/api/models/create_app_reply.py index a0f5470e..bd6c12e8 100644 --- a/koyeb/api/models/create_app_reply.py +++ b/koyeb/api/models/create_app_reply.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -22,30 +22,30 @@ from koyeb.api.models.app import App from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class CreateAppReply(BaseModel): """ CreateAppReply - """ # noqa: E501 - + """ # noqa: E501 app: Optional[App] = None __properties: ClassVar[List[str]] = ["app"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -62,7 +62,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -71,7 +72,7 @@ def to_dict(self) -> Dict[str, Any]: ) # override the default output from pydantic by calling `to_dict()` of app if self.app: - _dict["app"] = self.app.to_dict() + _dict['app'] = self.app.to_dict() return _dict @classmethod @@ -83,7 +84,9 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - {"app": App.from_dict(obj["app"]) if obj.get("app") is not None else None} - ) + _obj = cls.model_validate({ + "app": App.from_dict(obj["app"]) if obj.get("app") is not None else None + }) return _obj + + diff --git a/koyeb/api/models/create_archive.py b/koyeb/api/models/create_archive.py index 43ac63b4..44fa0430 100644 --- a/koyeb/api/models/create_archive.py +++ b/koyeb/api/models/create_archive.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -21,33 +21,31 @@ from typing import Any, ClassVar, Dict, List, Optional from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class CreateArchive(BaseModel): """ CreateArchive - """ # noqa: E501 - - size: Optional[StrictStr] = Field( - default=None, - description="How much space to provision for the archive, in bytes.", - ) - __properties: ClassVar[List[str]] = ["size"] + """ # noqa: E501 + size: Optional[StrictStr] = Field(default=None, description="How much space to provision for the archive, in bytes.") + project_id: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["size", "project_id"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -64,7 +62,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -82,5 +81,10 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({"size": obj.get("size")}) + _obj = cls.model_validate({ + "size": obj.get("size"), + "project_id": obj.get("project_id") + }) return _obj + + diff --git a/koyeb/api/models/create_archive_reply.py b/koyeb/api/models/create_archive_reply.py index 7a75cec1..609237b8 100644 --- a/koyeb/api/models/create_archive_reply.py +++ b/koyeb/api/models/create_archive_reply.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -22,30 +22,30 @@ from koyeb.api.models.archive import Archive from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class CreateArchiveReply(BaseModel): """ CreateArchiveReply - """ # noqa: E501 - + """ # noqa: E501 archive: Optional[Archive] = None __properties: ClassVar[List[str]] = ["archive"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -62,7 +62,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -71,7 +72,7 @@ def to_dict(self) -> Dict[str, Any]: ) # override the default output from pydantic by calling `to_dict()` of archive if self.archive: - _dict["archive"] = self.archive.to_dict() + _dict['archive'] = self.archive.to_dict() return _dict @classmethod @@ -83,13 +84,9 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "archive": ( - Archive.from_dict(obj["archive"]) - if obj.get("archive") is not None - else None - ) - } - ) + _obj = cls.model_validate({ + "archive": Archive.from_dict(obj["archive"]) if obj.get("archive") is not None else None + }) return _obj + + diff --git a/koyeb/api/models/create_budget_reply.py b/koyeb/api/models/create_budget_reply.py index 5becf69c..d5fce515 100644 --- a/koyeb/api/models/create_budget_reply.py +++ b/koyeb/api/models/create_budget_reply.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -22,30 +22,30 @@ from koyeb.api.models.budget import Budget from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class CreateBudgetReply(BaseModel): """ CreateBudgetReply - """ # noqa: E501 - + """ # noqa: E501 budget: Optional[Budget] = None __properties: ClassVar[List[str]] = ["budget"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -62,7 +62,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -71,7 +72,7 @@ def to_dict(self) -> Dict[str, Any]: ) # override the default output from pydantic by calling `to_dict()` of budget if self.budget: - _dict["budget"] = self.budget.to_dict() + _dict['budget'] = self.budget.to_dict() return _dict @classmethod @@ -83,13 +84,9 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "budget": ( - Budget.from_dict(obj["budget"]) - if obj.get("budget") is not None - else None - ) - } - ) + _obj = cls.model_validate({ + "budget": Budget.from_dict(obj["budget"]) if obj.get("budget") is not None else None + }) return _obj + + diff --git a/koyeb/api/models/create_compose.py b/koyeb/api/models/create_compose.py index ed57b908..4505ad37 100644 --- a/koyeb/api/models/create_compose.py +++ b/koyeb/api/models/create_compose.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -23,31 +23,31 @@ from koyeb.api.models.create_service import CreateService from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class CreateCompose(BaseModel): """ CreateCompose - """ # noqa: E501 - + """ # noqa: E501 app: Optional[CreateApp] = None services: Optional[List[CreateService]] = None __properties: ClassVar[List[str]] = ["app", "services"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -64,7 +64,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -73,14 +74,14 @@ def to_dict(self) -> Dict[str, Any]: ) # override the default output from pydantic by calling `to_dict()` of app if self.app: - _dict["app"] = self.app.to_dict() + _dict['app'] = self.app.to_dict() # override the default output from pydantic by calling `to_dict()` of each item in services (list) _items = [] if self.services: for _item_services in self.services: if _item_services: _items.append(_item_services.to_dict()) - _dict["services"] = _items + _dict['services'] = _items return _dict @classmethod @@ -92,18 +93,10 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "app": ( - CreateApp.from_dict(obj["app"]) - if obj.get("app") is not None - else None - ), - "services": ( - [CreateService.from_dict(_item) for _item in obj["services"]] - if obj.get("services") is not None - else None - ), - } - ) + _obj = cls.model_validate({ + "app": CreateApp.from_dict(obj["app"]) if obj.get("app") is not None else None, + "services": [CreateService.from_dict(_item) for _item in obj["services"]] if obj.get("services") is not None else None + }) return _obj + + diff --git a/koyeb/api/models/create_credential.py b/koyeb/api/models/create_credential.py index 38f3a825..c3c2a4c4 100644 --- a/koyeb/api/models/create_credential.py +++ b/koyeb/api/models/create_credential.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -22,38 +22,33 @@ from koyeb.api.models.credential_type import CredentialType from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class CreateCredential(BaseModel): """ CreateCredential - """ # noqa: E501 - + """ # noqa: E501 name: Optional[StrictStr] = None description: Optional[StrictStr] = None type: Optional[CredentialType] = CredentialType.INVALID organization_id: Optional[StrictStr] = None - __properties: ClassVar[List[str]] = [ - "name", - "description", - "type", - "organization_id", - ] + __properties: ClassVar[List[str]] = ["name", "description", "type", "organization_id"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -70,7 +65,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -88,16 +84,12 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "name": obj.get("name"), - "description": obj.get("description"), - "type": ( - obj.get("type") - if obj.get("type") is not None - else CredentialType.INVALID - ), - "organization_id": obj.get("organization_id"), - } - ) + _obj = cls.model_validate({ + "name": obj.get("name"), + "description": obj.get("description"), + "type": obj.get("type") if obj.get("type") is not None else CredentialType.INVALID, + "organization_id": obj.get("organization_id") + }) return _obj + + diff --git a/koyeb/api/models/create_credential_reply.py b/koyeb/api/models/create_credential_reply.py index db6edebb..15af8dd7 100644 --- a/koyeb/api/models/create_credential_reply.py +++ b/koyeb/api/models/create_credential_reply.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -22,30 +22,30 @@ from koyeb.api.models.credential import Credential from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class CreateCredentialReply(BaseModel): """ CreateCredentialReply - """ # noqa: E501 - + """ # noqa: E501 credential: Optional[Credential] = None __properties: ClassVar[List[str]] = ["credential"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -62,7 +62,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -71,7 +72,7 @@ def to_dict(self) -> Dict[str, Any]: ) # override the default output from pydantic by calling `to_dict()` of credential if self.credential: - _dict["credential"] = self.credential.to_dict() + _dict['credential'] = self.credential.to_dict() return _dict @classmethod @@ -83,13 +84,9 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "credential": ( - Credential.from_dict(obj["credential"]) - if obj.get("credential") is not None - else None - ) - } - ) + _obj = cls.model_validate({ + "credential": Credential.from_dict(obj["credential"]) if obj.get("credential") is not None else None + }) return _obj + + diff --git a/koyeb/api/models/create_domain.py b/koyeb/api/models/create_domain.py index 7c31a4b5..d0f74e8b 100644 --- a/koyeb/api/models/create_domain.py +++ b/koyeb/api/models/create_domain.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -23,40 +23,35 @@ from koyeb.api.models.domain_type import DomainType from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class CreateDomain(BaseModel): """ CreateDomain - """ # noqa: E501 - + """ # noqa: E501 name: Optional[StrictStr] = None type: Optional[DomainType] = DomainType.AUTOASSIGNED app_id: Optional[StrictStr] = None cloudflare: Optional[Dict[str, Any]] = None koyeb: Optional[DomainLoadBalancerKoyeb] = None - __properties: ClassVar[List[str]] = [ - "name", - "type", - "app_id", - "cloudflare", - "koyeb", - ] + project_id: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["name", "type", "app_id", "cloudflare", "koyeb", "project_id"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -73,7 +68,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -82,7 +78,7 @@ def to_dict(self) -> Dict[str, Any]: ) # override the default output from pydantic by calling `to_dict()` of koyeb if self.koyeb: - _dict["koyeb"] = self.koyeb.to_dict() + _dict['koyeb'] = self.koyeb.to_dict() return _dict @classmethod @@ -94,21 +90,14 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "name": obj.get("name"), - "type": ( - obj.get("type") - if obj.get("type") is not None - else DomainType.AUTOASSIGNED - ), - "app_id": obj.get("app_id"), - "cloudflare": obj.get("cloudflare"), - "koyeb": ( - DomainLoadBalancerKoyeb.from_dict(obj["koyeb"]) - if obj.get("koyeb") is not None - else None - ), - } - ) + _obj = cls.model_validate({ + "name": obj.get("name"), + "type": obj.get("type") if obj.get("type") is not None else DomainType.AUTOASSIGNED, + "app_id": obj.get("app_id"), + "cloudflare": obj.get("cloudflare"), + "koyeb": DomainLoadBalancerKoyeb.from_dict(obj["koyeb"]) if obj.get("koyeb") is not None else None, + "project_id": obj.get("project_id") + }) return _obj + + diff --git a/koyeb/api/models/create_domain_reply.py b/koyeb/api/models/create_domain_reply.py index 09c1a20b..34e523bb 100644 --- a/koyeb/api/models/create_domain_reply.py +++ b/koyeb/api/models/create_domain_reply.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -22,30 +22,30 @@ from koyeb.api.models.domain import Domain from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class CreateDomainReply(BaseModel): """ CreateDomainReply - """ # noqa: E501 - + """ # noqa: E501 domain: Optional[Domain] = None __properties: ClassVar[List[str]] = ["domain"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -62,7 +62,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -71,7 +72,7 @@ def to_dict(self) -> Dict[str, Any]: ) # override the default output from pydantic by calling `to_dict()` of domain if self.domain: - _dict["domain"] = self.domain.to_dict() + _dict['domain'] = self.domain.to_dict() return _dict @classmethod @@ -83,13 +84,9 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "domain": ( - Domain.from_dict(obj["domain"]) - if obj.get("domain") is not None - else None - ) - } - ) + _obj = cls.model_validate({ + "domain": Domain.from_dict(obj["domain"]) if obj.get("domain") is not None else None + }) return _obj + + diff --git a/koyeb/api/models/create_organization_invitation_reply.py b/koyeb/api/models/create_organization_invitation_reply.py index af6b2074..ff8f32d0 100644 --- a/koyeb/api/models/create_organization_invitation_reply.py +++ b/koyeb/api/models/create_organization_invitation_reply.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -22,30 +22,30 @@ from koyeb.api.models.organization_invitation import OrganizationInvitation from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class CreateOrganizationInvitationReply(BaseModel): """ CreateOrganizationInvitationReply - """ # noqa: E501 - + """ # noqa: E501 invitation: Optional[OrganizationInvitation] = None __properties: ClassVar[List[str]] = ["invitation"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -62,7 +62,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -71,7 +72,7 @@ def to_dict(self) -> Dict[str, Any]: ) # override the default output from pydantic by calling `to_dict()` of invitation if self.invitation: - _dict["invitation"] = self.invitation.to_dict() + _dict['invitation'] = self.invitation.to_dict() return _dict @classmethod @@ -83,13 +84,9 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "invitation": ( - OrganizationInvitation.from_dict(obj["invitation"]) - if obj.get("invitation") is not None - else None - ) - } - ) + _obj = cls.model_validate({ + "invitation": OrganizationInvitation.from_dict(obj["invitation"]) if obj.get("invitation") is not None else None + }) return _obj + + diff --git a/koyeb/api/models/create_organization_invitation_request.py b/koyeb/api/models/create_organization_invitation_request.py index 3b253201..39fb4c12 100644 --- a/koyeb/api/models/create_organization_invitation_request.py +++ b/koyeb/api/models/create_organization_invitation_request.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -21,30 +21,30 @@ from typing import Any, ClassVar, Dict, List, Optional from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class CreateOrganizationInvitationRequest(BaseModel): """ CreateOrganizationInvitationRequest - """ # noqa: E501 - + """ # noqa: E501 email: Optional[StrictStr] = None __properties: ClassVar[List[str]] = ["email"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -61,7 +61,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -79,5 +80,9 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({"email": obj.get("email")}) + _obj = cls.model_validate({ + "email": obj.get("email") + }) return _obj + + diff --git a/koyeb/api/models/create_organization_reply.py b/koyeb/api/models/create_organization_reply.py index d5850fbb..665f9984 100644 --- a/koyeb/api/models/create_organization_reply.py +++ b/koyeb/api/models/create_organization_reply.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -22,30 +22,30 @@ from koyeb.api.models.organization import Organization from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class CreateOrganizationReply(BaseModel): """ CreateOrganizationReply - """ # noqa: E501 - + """ # noqa: E501 organization: Optional[Organization] = None __properties: ClassVar[List[str]] = ["organization"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -62,7 +62,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -71,7 +72,7 @@ def to_dict(self) -> Dict[str, Any]: ) # override the default output from pydantic by calling `to_dict()` of organization if self.organization: - _dict["organization"] = self.organization.to_dict() + _dict['organization'] = self.organization.to_dict() return _dict @classmethod @@ -83,13 +84,9 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "organization": ( - Organization.from_dict(obj["organization"]) - if obj.get("organization") is not None - else None - ) - } - ) + _obj = cls.model_validate({ + "organization": Organization.from_dict(obj["organization"]) if obj.get("organization") is not None else None + }) return _obj + + diff --git a/koyeb/api/models/create_organization_request.py b/koyeb/api/models/create_organization_request.py index 6c5ce2cb..0714ddbb 100644 --- a/koyeb/api/models/create_organization_request.py +++ b/koyeb/api/models/create_organization_request.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -21,30 +21,30 @@ from typing import Any, ClassVar, Dict, List, Optional from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class CreateOrganizationRequest(BaseModel): """ CreateOrganizationRequest - """ # noqa: E501 - + """ # noqa: E501 name: Optional[StrictStr] = None __properties: ClassVar[List[str]] = ["name"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -61,7 +61,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -79,5 +80,9 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({"name": obj.get("name")}) + _obj = cls.model_validate({ + "name": obj.get("name") + }) return _obj + + diff --git a/koyeb/api/models/create_payment_authorization_reply.py b/koyeb/api/models/create_payment_authorization_reply.py index 3d5bcdc8..f25023c0 100644 --- a/koyeb/api/models/create_payment_authorization_reply.py +++ b/koyeb/api/models/create_payment_authorization_reply.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -22,30 +22,30 @@ from koyeb.api.models.payment_method import PaymentMethod from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class CreatePaymentAuthorizationReply(BaseModel): """ CreatePaymentAuthorizationReply - """ # noqa: E501 - + """ # noqa: E501 payment_method: Optional[PaymentMethod] = None __properties: ClassVar[List[str]] = ["payment_method"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -62,7 +62,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -71,7 +72,7 @@ def to_dict(self) -> Dict[str, Any]: ) # override the default output from pydantic by calling `to_dict()` of payment_method if self.payment_method: - _dict["payment_method"] = self.payment_method.to_dict() + _dict['payment_method'] = self.payment_method.to_dict() return _dict @classmethod @@ -83,13 +84,9 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "payment_method": ( - PaymentMethod.from_dict(obj["payment_method"]) - if obj.get("payment_method") is not None - else None - ) - } - ) + _obj = cls.model_validate({ + "payment_method": PaymentMethod.from_dict(obj["payment_method"]) if obj.get("payment_method") is not None else None + }) return _obj + + diff --git a/koyeb/api/models/create_persistent_volume_reply.py b/koyeb/api/models/create_persistent_volume_reply.py index b3bbb969..e5f909c2 100644 --- a/koyeb/api/models/create_persistent_volume_reply.py +++ b/koyeb/api/models/create_persistent_volume_reply.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -22,30 +22,30 @@ from koyeb.api.models.persistent_volume import PersistentVolume from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class CreatePersistentVolumeReply(BaseModel): """ CreatePersistentVolumeReply - """ # noqa: E501 - + """ # noqa: E501 volume: Optional[PersistentVolume] = None __properties: ClassVar[List[str]] = ["volume"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -62,7 +62,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -71,7 +72,7 @@ def to_dict(self) -> Dict[str, Any]: ) # override the default output from pydantic by calling `to_dict()` of volume if self.volume: - _dict["volume"] = self.volume.to_dict() + _dict['volume'] = self.volume.to_dict() return _dict @classmethod @@ -83,13 +84,9 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "volume": ( - PersistentVolume.from_dict(obj["volume"]) - if obj.get("volume") is not None - else None - ) - } - ) + _obj = cls.model_validate({ + "volume": PersistentVolume.from_dict(obj["volume"]) if obj.get("volume") is not None else None + }) return _obj + + diff --git a/koyeb/api/models/create_persistent_volume_request.py b/koyeb/api/models/create_persistent_volume_request.py index 5493746c..df6ebfce 100644 --- a/koyeb/api/models/create_persistent_volume_request.py +++ b/koyeb/api/models/create_persistent_volume_request.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -19,49 +19,39 @@ from pydantic import BaseModel, ConfigDict, StrictBool, StrictInt, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from koyeb.api.models.persistent_volume_backing_store import ( - PersistentVolumeBackingStore, -) +from koyeb.api.models.persistent_volume_backing_store import PersistentVolumeBackingStore from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class CreatePersistentVolumeRequest(BaseModel): """ CreatePersistentVolumeRequest - """ # noqa: E501 - - volume_type: Optional[PersistentVolumeBackingStore] = ( - PersistentVolumeBackingStore.PERSISTENT_VOLUME_BACKING_STORE_INVALID - ) + """ # noqa: E501 + volume_type: Optional[PersistentVolumeBackingStore] = PersistentVolumeBackingStore.PERSISTENT_VOLUME_BACKING_STORE_INVALID name: Optional[StrictStr] = None region: Optional[StrictStr] = None read_only: Optional[StrictBool] = None max_size: Optional[StrictInt] = None snapshot_id: Optional[StrictStr] = None - __properties: ClassVar[List[str]] = [ - "volume_type", - "name", - "region", - "read_only", - "max_size", - "snapshot_id", - ] + project_id: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["volume_type", "name", "region", "read_only", "max_size", "snapshot_id", "project_id"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -78,7 +68,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -96,18 +87,15 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "volume_type": ( - obj.get("volume_type") - if obj.get("volume_type") is not None - else PersistentVolumeBackingStore.PERSISTENT_VOLUME_BACKING_STORE_INVALID - ), - "name": obj.get("name"), - "region": obj.get("region"), - "read_only": obj.get("read_only"), - "max_size": obj.get("max_size"), - "snapshot_id": obj.get("snapshot_id"), - } - ) + _obj = cls.model_validate({ + "volume_type": obj.get("volume_type") if obj.get("volume_type") is not None else PersistentVolumeBackingStore.PERSISTENT_VOLUME_BACKING_STORE_INVALID, + "name": obj.get("name"), + "region": obj.get("region"), + "read_only": obj.get("read_only"), + "max_size": obj.get("max_size"), + "snapshot_id": obj.get("snapshot_id"), + "project_id": obj.get("project_id") + }) return _obj + + diff --git a/koyeb/api/models/create_project.py b/koyeb/api/models/create_project.py new file mode 100644 index 00000000..28484cb9 --- /dev/null +++ b/koyeb/api/models/create_project.py @@ -0,0 +1,90 @@ +# coding: utf-8 + +""" + Koyeb Rest API + + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class CreateProject(BaseModel): + """ + CreateProject + """ # noqa: E501 + name: Optional[StrictStr] = None + description: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["name", "description"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of CreateProject from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CreateProject from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "name": obj.get("name"), + "description": obj.get("description") + }) + return _obj + + diff --git a/koyeb/api/models/create_project_reply.py b/koyeb/api/models/create_project_reply.py new file mode 100644 index 00000000..80a851cb --- /dev/null +++ b/koyeb/api/models/create_project_reply.py @@ -0,0 +1,92 @@ +# coding: utf-8 + +""" + Koyeb Rest API + + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict +from typing import Any, ClassVar, Dict, List, Optional +from koyeb.api.models.project import Project +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class CreateProjectReply(BaseModel): + """ + CreateProjectReply + """ # noqa: E501 + project: Optional[Project] = None + __properties: ClassVar[List[str]] = ["project"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of CreateProjectReply from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of project + if self.project: + _dict['project'] = self.project.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CreateProjectReply from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "project": Project.from_dict(obj["project"]) if obj.get("project") is not None else None + }) + return _obj + + diff --git a/koyeb/api/models/create_secret.py b/koyeb/api/models/create_secret.py index 667f33f0..a52c912f 100644 --- a/koyeb/api/models/create_secret.py +++ b/koyeb/api/models/create_secret.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -19,31 +19,22 @@ from pydantic import BaseModel, ConfigDict, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from koyeb.api.models.azure_container_registry_configuration import ( - AzureContainerRegistryConfiguration, -) -from koyeb.api.models.digital_ocean_registry_configuration import ( - DigitalOceanRegistryConfiguration, -) -from koyeb.api.models.docker_hub_registry_configuration import ( - DockerHubRegistryConfiguration, -) -from koyeb.api.models.gcp_container_registry_configuration import ( - GCPContainerRegistryConfiguration, -) +from koyeb.api.models.azure_container_registry_configuration import AzureContainerRegistryConfiguration +from koyeb.api.models.digital_ocean_registry_configuration import DigitalOceanRegistryConfiguration +from koyeb.api.models.docker_hub_registry_configuration import DockerHubRegistryConfiguration +from koyeb.api.models.gcp_container_registry_configuration import GCPContainerRegistryConfiguration from koyeb.api.models.git_hub_registry_configuration import GitHubRegistryConfiguration from koyeb.api.models.git_lab_registry_configuration import GitLabRegistryConfiguration from koyeb.api.models.private_registry_configuration import PrivateRegistryConfiguration from koyeb.api.models.secret_type import SecretType from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class CreateSecret(BaseModel): """ CreateSecret - """ # noqa: E501 - + """ # noqa: E501 name: Optional[StrictStr] = None type: Optional[SecretType] = SecretType.SIMPLE value: Optional[StrictStr] = None @@ -54,33 +45,24 @@ class CreateSecret(BaseModel): gitlab_registry: Optional[GitLabRegistryConfiguration] = None gcp_container_registry: Optional[GCPContainerRegistryConfiguration] = None azure_container_registry: Optional[AzureContainerRegistryConfiguration] = None - __properties: ClassVar[List[str]] = [ - "name", - "type", - "value", - "docker_hub_registry", - "private_registry", - "digital_ocean_registry", - "github_registry", - "gitlab_registry", - "gcp_container_registry", - "azure_container_registry", - ] + project_id: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["name", "type", "value", "docker_hub_registry", "private_registry", "digital_ocean_registry", "github_registry", "gitlab_registry", "gcp_container_registry", "azure_container_registry", "project_id"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -97,7 +79,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -106,25 +89,25 @@ def to_dict(self) -> Dict[str, Any]: ) # override the default output from pydantic by calling `to_dict()` of docker_hub_registry if self.docker_hub_registry: - _dict["docker_hub_registry"] = self.docker_hub_registry.to_dict() + _dict['docker_hub_registry'] = self.docker_hub_registry.to_dict() # override the default output from pydantic by calling `to_dict()` of private_registry if self.private_registry: - _dict["private_registry"] = self.private_registry.to_dict() + _dict['private_registry'] = self.private_registry.to_dict() # override the default output from pydantic by calling `to_dict()` of digital_ocean_registry if self.digital_ocean_registry: - _dict["digital_ocean_registry"] = self.digital_ocean_registry.to_dict() + _dict['digital_ocean_registry'] = self.digital_ocean_registry.to_dict() # override the default output from pydantic by calling `to_dict()` of github_registry if self.github_registry: - _dict["github_registry"] = self.github_registry.to_dict() + _dict['github_registry'] = self.github_registry.to_dict() # override the default output from pydantic by calling `to_dict()` of gitlab_registry if self.gitlab_registry: - _dict["gitlab_registry"] = self.gitlab_registry.to_dict() + _dict['gitlab_registry'] = self.gitlab_registry.to_dict() # override the default output from pydantic by calling `to_dict()` of gcp_container_registry if self.gcp_container_registry: - _dict["gcp_container_registry"] = self.gcp_container_registry.to_dict() + _dict['gcp_container_registry'] = self.gcp_container_registry.to_dict() # override the default output from pydantic by calling `to_dict()` of azure_container_registry if self.azure_container_registry: - _dict["azure_container_registry"] = self.azure_container_registry.to_dict() + _dict['azure_container_registry'] = self.azure_container_registry.to_dict() return _dict @classmethod @@ -136,56 +119,19 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "name": obj.get("name"), - "type": ( - obj.get("type") - if obj.get("type") is not None - else SecretType.SIMPLE - ), - "value": obj.get("value"), - "docker_hub_registry": ( - DockerHubRegistryConfiguration.from_dict(obj["docker_hub_registry"]) - if obj.get("docker_hub_registry") is not None - else None - ), - "private_registry": ( - PrivateRegistryConfiguration.from_dict(obj["private_registry"]) - if obj.get("private_registry") is not None - else None - ), - "digital_ocean_registry": ( - DigitalOceanRegistryConfiguration.from_dict( - obj["digital_ocean_registry"] - ) - if obj.get("digital_ocean_registry") is not None - else None - ), - "github_registry": ( - GitHubRegistryConfiguration.from_dict(obj["github_registry"]) - if obj.get("github_registry") is not None - else None - ), - "gitlab_registry": ( - GitLabRegistryConfiguration.from_dict(obj["gitlab_registry"]) - if obj.get("gitlab_registry") is not None - else None - ), - "gcp_container_registry": ( - GCPContainerRegistryConfiguration.from_dict( - obj["gcp_container_registry"] - ) - if obj.get("gcp_container_registry") is not None - else None - ), - "azure_container_registry": ( - AzureContainerRegistryConfiguration.from_dict( - obj["azure_container_registry"] - ) - if obj.get("azure_container_registry") is not None - else None - ), - } - ) + _obj = cls.model_validate({ + "name": obj.get("name"), + "type": obj.get("type") if obj.get("type") is not None else SecretType.SIMPLE, + "value": obj.get("value"), + "docker_hub_registry": DockerHubRegistryConfiguration.from_dict(obj["docker_hub_registry"]) if obj.get("docker_hub_registry") is not None else None, + "private_registry": PrivateRegistryConfiguration.from_dict(obj["private_registry"]) if obj.get("private_registry") is not None else None, + "digital_ocean_registry": DigitalOceanRegistryConfiguration.from_dict(obj["digital_ocean_registry"]) if obj.get("digital_ocean_registry") is not None else None, + "github_registry": GitHubRegistryConfiguration.from_dict(obj["github_registry"]) if obj.get("github_registry") is not None else None, + "gitlab_registry": GitLabRegistryConfiguration.from_dict(obj["gitlab_registry"]) if obj.get("gitlab_registry") is not None else None, + "gcp_container_registry": GCPContainerRegistryConfiguration.from_dict(obj["gcp_container_registry"]) if obj.get("gcp_container_registry") is not None else None, + "azure_container_registry": AzureContainerRegistryConfiguration.from_dict(obj["azure_container_registry"]) if obj.get("azure_container_registry") is not None else None, + "project_id": obj.get("project_id") + }) return _obj + + diff --git a/koyeb/api/models/create_secret_reply.py b/koyeb/api/models/create_secret_reply.py index c842ce3d..0710a0b4 100644 --- a/koyeb/api/models/create_secret_reply.py +++ b/koyeb/api/models/create_secret_reply.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -22,30 +22,30 @@ from koyeb.api.models.secret import Secret from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class CreateSecretReply(BaseModel): """ CreateSecretReply - """ # noqa: E501 - + """ # noqa: E501 secret: Optional[Secret] = None __properties: ClassVar[List[str]] = ["secret"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -62,7 +62,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -71,7 +72,7 @@ def to_dict(self) -> Dict[str, Any]: ) # override the default output from pydantic by calling `to_dict()` of secret if self.secret: - _dict["secret"] = self.secret.to_dict() + _dict['secret'] = self.secret.to_dict() return _dict @classmethod @@ -83,13 +84,9 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "secret": ( - Secret.from_dict(obj["secret"]) - if obj.get("secret") is not None - else None - ) - } - ) + _obj = cls.model_validate({ + "secret": Secret.from_dict(obj["secret"]) if obj.get("secret") is not None else None + }) return _obj + + diff --git a/koyeb/api/models/create_service.py b/koyeb/api/models/create_service.py index a42773bf..04e5a9e7 100644 --- a/koyeb/api/models/create_service.py +++ b/koyeb/api/models/create_service.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -23,32 +23,33 @@ from koyeb.api.models.service_life_cycle import ServiceLifeCycle from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class CreateService(BaseModel): """ CreateService - """ # noqa: E501 - + """ # noqa: E501 app_id: Optional[StrictStr] = None definition: Optional[DeploymentDefinition] = None life_cycle: Optional[ServiceLifeCycle] = None - __properties: ClassVar[List[str]] = ["app_id", "definition", "life_cycle"] + project_id: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["app_id", "definition", "life_cycle", "project_id"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -65,7 +66,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -74,10 +76,10 @@ def to_dict(self) -> Dict[str, Any]: ) # override the default output from pydantic by calling `to_dict()` of definition if self.definition: - _dict["definition"] = self.definition.to_dict() + _dict['definition'] = self.definition.to_dict() # override the default output from pydantic by calling `to_dict()` of life_cycle if self.life_cycle: - _dict["life_cycle"] = self.life_cycle.to_dict() + _dict['life_cycle'] = self.life_cycle.to_dict() return _dict @classmethod @@ -89,19 +91,12 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "app_id": obj.get("app_id"), - "definition": ( - DeploymentDefinition.from_dict(obj["definition"]) - if obj.get("definition") is not None - else None - ), - "life_cycle": ( - ServiceLifeCycle.from_dict(obj["life_cycle"]) - if obj.get("life_cycle") is not None - else None - ), - } - ) + _obj = cls.model_validate({ + "app_id": obj.get("app_id"), + "definition": DeploymentDefinition.from_dict(obj["definition"]) if obj.get("definition") is not None else None, + "life_cycle": ServiceLifeCycle.from_dict(obj["life_cycle"]) if obj.get("life_cycle") is not None else None, + "project_id": obj.get("project_id") + }) return _obj + + diff --git a/koyeb/api/models/create_service_reply.py b/koyeb/api/models/create_service_reply.py index 1d0228a2..bf9b50e2 100644 --- a/koyeb/api/models/create_service_reply.py +++ b/koyeb/api/models/create_service_reply.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -22,30 +22,30 @@ from koyeb.api.models.service import Service from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class CreateServiceReply(BaseModel): """ CreateServiceReply - """ # noqa: E501 - + """ # noqa: E501 service: Optional[Service] = None __properties: ClassVar[List[str]] = ["service"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -62,7 +62,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -71,7 +72,7 @@ def to_dict(self) -> Dict[str, Any]: ) # override the default output from pydantic by calling `to_dict()` of service if self.service: - _dict["service"] = self.service.to_dict() + _dict['service'] = self.service.to_dict() return _dict @classmethod @@ -83,13 +84,9 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "service": ( - Service.from_dict(obj["service"]) - if obj.get("service") is not None - else None - ) - } - ) + _obj = cls.model_validate({ + "service": Service.from_dict(obj["service"]) if obj.get("service") is not None else None + }) return _obj + + diff --git a/koyeb/api/models/create_snapshot_reply.py b/koyeb/api/models/create_snapshot_reply.py index f4def592..27b93b5c 100644 --- a/koyeb/api/models/create_snapshot_reply.py +++ b/koyeb/api/models/create_snapshot_reply.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -22,30 +22,30 @@ from koyeb.api.models.snapshot import Snapshot from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class CreateSnapshotReply(BaseModel): """ CreateSnapshotReply - """ # noqa: E501 - + """ # noqa: E501 snapshot: Optional[Snapshot] = None __properties: ClassVar[List[str]] = ["snapshot"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -62,7 +62,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -71,7 +72,7 @@ def to_dict(self) -> Dict[str, Any]: ) # override the default output from pydantic by calling `to_dict()` of snapshot if self.snapshot: - _dict["snapshot"] = self.snapshot.to_dict() + _dict['snapshot'] = self.snapshot.to_dict() return _dict @classmethod @@ -83,13 +84,9 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "snapshot": ( - Snapshot.from_dict(obj["snapshot"]) - if obj.get("snapshot") is not None - else None - ) - } - ) + _obj = cls.model_validate({ + "snapshot": Snapshot.from_dict(obj["snapshot"]) if obj.get("snapshot") is not None else None + }) return _obj + + diff --git a/koyeb/api/models/create_snapshot_request.py b/koyeb/api/models/create_snapshot_request.py index 783b0c54..8c29a0ce 100644 --- a/koyeb/api/models/create_snapshot_request.py +++ b/koyeb/api/models/create_snapshot_request.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -21,31 +21,32 @@ from typing import Any, ClassVar, Dict, List, Optional from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class CreateSnapshotRequest(BaseModel): """ CreateSnapshotRequest - """ # noqa: E501 - + """ # noqa: E501 parent_volume_id: Optional[StrictStr] = None name: Optional[StrictStr] = None - __properties: ClassVar[List[str]] = ["parent_volume_id", "name"] + project_id: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["parent_volume_id", "name", "project_id"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -62,7 +63,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -80,7 +82,11 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - {"parent_volume_id": obj.get("parent_volume_id"), "name": obj.get("name")} - ) + _obj = cls.model_validate({ + "parent_volume_id": obj.get("parent_volume_id"), + "name": obj.get("name"), + "project_id": obj.get("project_id") + }) return _obj + + diff --git a/koyeb/api/models/create_stage_attempt_request.py b/koyeb/api/models/create_stage_attempt_request.py index 8bbfbc7d..f46a7e81 100644 --- a/koyeb/api/models/create_stage_attempt_request.py +++ b/koyeb/api/models/create_stage_attempt_request.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -20,47 +20,37 @@ from datetime import datetime from pydantic import BaseModel, ConfigDict, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from koyeb.api.models.deployment_provisioning_info_stage_status import ( - DeploymentProvisioningInfoStageStatus, -) +from koyeb.api.models.deployment_provisioning_info_stage_status import DeploymentProvisioningInfoStageStatus from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class CreateStageAttemptRequest(BaseModel): """ CreateStageAttemptRequest - """ # noqa: E501 - + """ # noqa: E501 secret: Optional[StrictStr] = None - status: Optional[DeploymentProvisioningInfoStageStatus] = ( - DeploymentProvisioningInfoStageStatus.UNKNOWN - ) + status: Optional[DeploymentProvisioningInfoStageStatus] = DeploymentProvisioningInfoStageStatus.UNKNOWN started_at: Optional[datetime] = None messages: Optional[List[StrictStr]] = None steps: Optional[List[StrictStr]] = None - __properties: ClassVar[List[str]] = [ - "secret", - "status", - "started_at", - "messages", - "steps", - ] + __properties: ClassVar[List[str]] = ["secret", "status", "started_at", "messages", "steps"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -77,7 +67,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -95,17 +86,13 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "secret": obj.get("secret"), - "status": ( - obj.get("status") - if obj.get("status") is not None - else DeploymentProvisioningInfoStageStatus.UNKNOWN - ), - "started_at": obj.get("started_at"), - "messages": obj.get("messages"), - "steps": obj.get("steps"), - } - ) + _obj = cls.model_validate({ + "secret": obj.get("secret"), + "status": obj.get("status") if obj.get("status") is not None else DeploymentProvisioningInfoStageStatus.UNKNOWN, + "started_at": obj.get("started_at"), + "messages": obj.get("messages"), + "steps": obj.get("steps") + }) return _obj + + diff --git a/koyeb/api/models/credential.py b/koyeb/api/models/credential.py index b34f5cf8..a9423d98 100644 --- a/koyeb/api/models/credential.py +++ b/koyeb/api/models/credential.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -23,13 +23,12 @@ from koyeb.api.models.credential_type import CredentialType from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class Credential(BaseModel): """ Credential - """ # noqa: E501 - + """ # noqa: E501 id: Optional[StrictStr] = None type: Optional[CredentialType] = CredentialType.INVALID name: Optional[StrictStr] = None @@ -40,33 +39,23 @@ class Credential(BaseModel): updated_at: Optional[datetime] = None created_at: Optional[datetime] = None expires_at: Optional[datetime] = None - __properties: ClassVar[List[str]] = [ - "id", - "type", - "name", - "token", - "description", - "user_id", - "organization_id", - "updated_at", - "created_at", - "expires_at", - ] + __properties: ClassVar[List[str]] = ["id", "type", "name", "token", "description", "user_id", "organization_id", "updated_at", "created_at", "expires_at"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -83,7 +72,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -101,22 +91,18 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "id": obj.get("id"), - "type": ( - obj.get("type") - if obj.get("type") is not None - else CredentialType.INVALID - ), - "name": obj.get("name"), - "token": obj.get("token"), - "description": obj.get("description"), - "user_id": obj.get("user_id"), - "organization_id": obj.get("organization_id"), - "updated_at": obj.get("updated_at"), - "created_at": obj.get("created_at"), - "expires_at": obj.get("expires_at"), - } - ) + _obj = cls.model_validate({ + "id": obj.get("id"), + "type": obj.get("type") if obj.get("type") is not None else CredentialType.INVALID, + "name": obj.get("name"), + "token": obj.get("token"), + "description": obj.get("description"), + "user_id": obj.get("user_id"), + "organization_id": obj.get("organization_id"), + "updated_at": obj.get("updated_at"), + "created_at": obj.get("created_at"), + "expires_at": obj.get("expires_at") + }) return _obj + + diff --git a/koyeb/api/models/credential_type.py b/koyeb/api/models/credential_type.py index b329066b..bf4708ee 100644 --- a/koyeb/api/models/credential_type.py +++ b/koyeb/api/models/credential_type.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -26,11 +26,13 @@ class CredentialType(str, Enum): """ allowed enum values """ - INVALID = "INVALID" - USER = "USER" - ORGANIZATION = "ORGANIZATION" + INVALID = 'INVALID' + USER = 'USER' + ORGANIZATION = 'ORGANIZATION' @classmethod def from_json(cls, json_str: str) -> Self: """Create an instance of CredentialType from a JSON string""" return cls(json.loads(json_str)) + + diff --git a/koyeb/api/models/database_deployment_metadata.py b/koyeb/api/models/database_deployment_metadata.py index d8127233..8cc12f56 100644 --- a/koyeb/api/models/database_deployment_metadata.py +++ b/koyeb/api/models/database_deployment_metadata.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -19,35 +19,33 @@ from pydantic import BaseModel, ConfigDict from typing import Any, ClassVar, Dict, List, Optional -from koyeb.api.models.neon_postgres_database_deployment_metadata import ( - NeonPostgresDatabaseDeploymentMetadata, -) +from koyeb.api.models.neon_postgres_database_deployment_metadata import NeonPostgresDatabaseDeploymentMetadata from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class DatabaseDeploymentMetadata(BaseModel): """ DatabaseDeploymentMetadata - """ # noqa: E501 - + """ # noqa: E501 neon_postgres: Optional[NeonPostgresDatabaseDeploymentMetadata] = None __properties: ClassVar[List[str]] = ["neon_postgres"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -64,7 +62,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -73,7 +72,7 @@ def to_dict(self) -> Dict[str, Any]: ) # override the default output from pydantic by calling `to_dict()` of neon_postgres if self.neon_postgres: - _dict["neon_postgres"] = self.neon_postgres.to_dict() + _dict['neon_postgres'] = self.neon_postgres.to_dict() return _dict @classmethod @@ -85,15 +84,9 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "neon_postgres": ( - NeonPostgresDatabaseDeploymentMetadata.from_dict( - obj["neon_postgres"] - ) - if obj.get("neon_postgres") is not None - else None - ) - } - ) + _obj = cls.model_validate({ + "neon_postgres": NeonPostgresDatabaseDeploymentMetadata.from_dict(obj["neon_postgres"]) if obj.get("neon_postgres") is not None else None + }) return _obj + + diff --git a/koyeb/api/models/database_role_password.py b/koyeb/api/models/database_role_password.py index b8ac10fd..c405a183 100644 --- a/koyeb/api/models/database_role_password.py +++ b/koyeb/api/models/database_role_password.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -21,31 +21,31 @@ from typing import Any, ClassVar, Dict, List, Optional from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class DatabaseRolePassword(BaseModel): """ DatabaseRolePassword - """ # noqa: E501 - + """ # noqa: E501 username: Optional[StrictStr] = None password: Optional[StrictStr] = None __properties: ClassVar[List[str]] = ["username", "password"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -62,7 +62,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -80,7 +81,10 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - {"username": obj.get("username"), "password": obj.get("password")} - ) + _obj = cls.model_validate({ + "username": obj.get("username"), + "password": obj.get("password") + }) return _obj + + diff --git a/koyeb/api/models/database_source.py b/koyeb/api/models/database_source.py index 56a22554..1e02e2e3 100644 --- a/koyeb/api/models/database_source.py +++ b/koyeb/api/models/database_source.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -22,30 +22,30 @@ from koyeb.api.models.neon_postgres_database import NeonPostgresDatabase from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class DatabaseSource(BaseModel): """ DatabaseSource - """ # noqa: E501 - + """ # noqa: E501 neon_postgres: Optional[NeonPostgresDatabase] = None __properties: ClassVar[List[str]] = ["neon_postgres"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -62,7 +62,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -71,7 +72,7 @@ def to_dict(self) -> Dict[str, Any]: ) # override the default output from pydantic by calling `to_dict()` of neon_postgres if self.neon_postgres: - _dict["neon_postgres"] = self.neon_postgres.to_dict() + _dict['neon_postgres'] = self.neon_postgres.to_dict() return _dict @classmethod @@ -83,13 +84,9 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "neon_postgres": ( - NeonPostgresDatabase.from_dict(obj["neon_postgres"]) - if obj.get("neon_postgres") is not None - else None - ) - } - ) + _obj = cls.model_validate({ + "neon_postgres": NeonPostgresDatabase.from_dict(obj["neon_postgres"]) if obj.get("neon_postgres") is not None else None + }) return _obj + + diff --git a/koyeb/api/models/database_usage.py b/koyeb/api/models/database_usage.py index e1e92c3f..7343bf59 100644 --- a/koyeb/api/models/database_usage.py +++ b/koyeb/api/models/database_usage.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -21,38 +21,33 @@ from typing import Any, ClassVar, Dict, List, Optional from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class DatabaseUsage(BaseModel): """ DatabaseUsage - """ # noqa: E501 - + """ # noqa: E501 service_id: Optional[StrictStr] = None service_name: Optional[StrictStr] = None compute_time_seconds: Optional[StrictInt] = None data_storage_megabytes_hours: Optional[StrictInt] = None - __properties: ClassVar[List[str]] = [ - "service_id", - "service_name", - "compute_time_seconds", - "data_storage_megabytes_hours", - ] + __properties: ClassVar[List[str]] = ["service_id", "service_name", "compute_time_seconds", "data_storage_megabytes_hours"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -69,7 +64,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -87,12 +83,12 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "service_id": obj.get("service_id"), - "service_name": obj.get("service_name"), - "compute_time_seconds": obj.get("compute_time_seconds"), - "data_storage_megabytes_hours": obj.get("data_storage_megabytes_hours"), - } - ) + _obj = cls.model_validate({ + "service_id": obj.get("service_id"), + "service_name": obj.get("service_name"), + "compute_time_seconds": obj.get("compute_time_seconds"), + "data_storage_megabytes_hours": obj.get("data_storage_megabytes_hours") + }) return _obj + + diff --git a/koyeb/api/models/database_usage_details.py b/koyeb/api/models/database_usage_details.py index 71f45b16..96eb3fcd 100644 --- a/koyeb/api/models/database_usage_details.py +++ b/koyeb/api/models/database_usage_details.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -22,13 +22,12 @@ from typing import Any, ClassVar, Dict, List, Optional from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class DatabaseUsageDetails(BaseModel): """ DatabaseUsageDetails - """ # noqa: E501 - + """ # noqa: E501 organization_id: Optional[StrictStr] = None app_id: Optional[StrictStr] = None app_name: Optional[StrictStr] = None @@ -38,32 +37,23 @@ class DatabaseUsageDetails(BaseModel): data_storage_megabytes_hour: Optional[StrictInt] = None started_at: Optional[datetime] = None terminated_at: Optional[datetime] = None - __properties: ClassVar[List[str]] = [ - "organization_id", - "app_id", - "app_name", - "service_id", - "service_name", - "compute_time_seconds", - "data_storage_megabytes_hour", - "started_at", - "terminated_at", - ] + __properties: ClassVar[List[str]] = ["organization_id", "app_id", "app_name", "service_id", "service_name", "compute_time_seconds", "data_storage_megabytes_hour", "started_at", "terminated_at"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -80,7 +70,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -98,17 +89,17 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "organization_id": obj.get("organization_id"), - "app_id": obj.get("app_id"), - "app_name": obj.get("app_name"), - "service_id": obj.get("service_id"), - "service_name": obj.get("service_name"), - "compute_time_seconds": obj.get("compute_time_seconds"), - "data_storage_megabytes_hour": obj.get("data_storage_megabytes_hour"), - "started_at": obj.get("started_at"), - "terminated_at": obj.get("terminated_at"), - } - ) + _obj = cls.model_validate({ + "organization_id": obj.get("organization_id"), + "app_id": obj.get("app_id"), + "app_name": obj.get("app_name"), + "service_id": obj.get("service_id"), + "service_name": obj.get("service_name"), + "compute_time_seconds": obj.get("compute_time_seconds"), + "data_storage_megabytes_hour": obj.get("data_storage_megabytes_hour"), + "started_at": obj.get("started_at"), + "terminated_at": obj.get("terminated_at") + }) return _obj + + diff --git a/koyeb/api/models/datacenter_list_item.py b/koyeb/api/models/datacenter_list_item.py index 4a15b143..f9806cc1 100644 --- a/koyeb/api/models/datacenter_list_item.py +++ b/koyeb/api/models/datacenter_list_item.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -21,42 +21,35 @@ from typing import Any, ClassVar, Dict, List, Optional from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class DatacenterListItem(BaseModel): """ DatacenterListItem - """ # noqa: E501 - + """ # noqa: E501 id: Optional[StrictStr] = None region_id: Optional[StrictStr] = None domain: Optional[StrictStr] = None coordinates: Optional[List[StrictStr]] = None use_gpu: Optional[StrictBool] = None regions: Optional[List[StrictStr]] = None - __properties: ClassVar[List[str]] = [ - "id", - "region_id", - "domain", - "coordinates", - "use_gpu", - "regions", - ] + __properties: ClassVar[List[str]] = ["id", "region_id", "domain", "coordinates", "use_gpu", "regions"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -73,7 +66,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -91,14 +85,14 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "id": obj.get("id"), - "region_id": obj.get("region_id"), - "domain": obj.get("domain"), - "coordinates": obj.get("coordinates"), - "use_gpu": obj.get("use_gpu"), - "regions": obj.get("regions"), - } - ) + _obj = cls.model_validate({ + "id": obj.get("id"), + "region_id": obj.get("region_id"), + "domain": obj.get("domain"), + "coordinates": obj.get("coordinates"), + "use_gpu": obj.get("use_gpu"), + "regions": obj.get("regions") + }) return _obj + + diff --git a/koyeb/api/models/deactivate_organization_reply.py b/koyeb/api/models/deactivate_organization_reply.py index a644e245..8fd7daef 100644 --- a/koyeb/api/models/deactivate_organization_reply.py +++ b/koyeb/api/models/deactivate_organization_reply.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -22,30 +22,30 @@ from koyeb.api.models.organization import Organization from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class DeactivateOrganizationReply(BaseModel): """ DeactivateOrganizationReply - """ # noqa: E501 - + """ # noqa: E501 organization: Optional[Organization] = None __properties: ClassVar[List[str]] = ["organization"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -62,7 +62,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -71,7 +72,7 @@ def to_dict(self) -> Dict[str, Any]: ) # override the default output from pydantic by calling `to_dict()` of organization if self.organization: - _dict["organization"] = self.organization.to_dict() + _dict['organization'] = self.organization.to_dict() return _dict @classmethod @@ -83,13 +84,9 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "organization": ( - Organization.from_dict(obj["organization"]) - if obj.get("organization") is not None - else None - ) - } - ) + _obj = cls.model_validate({ + "organization": Organization.from_dict(obj["organization"]) if obj.get("organization") is not None else None + }) return _obj + + diff --git a/koyeb/api/models/deactivate_organization_request.py b/koyeb/api/models/deactivate_organization_request.py index 295db468..74cd5765 100644 --- a/koyeb/api/models/deactivate_organization_request.py +++ b/koyeb/api/models/deactivate_organization_request.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -21,33 +21,30 @@ from typing import Any, ClassVar, Dict, List, Optional from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class DeactivateOrganizationRequest(BaseModel): """ DeactivateOrganizationRequest - """ # noqa: E501 - - skip_confirmation: Optional[StrictBool] = Field( - default=None, - description="if set to true, skip_confirmation will directly start the deactivation process, without sending a confirmation email beforehand.", - ) + """ # noqa: E501 + skip_confirmation: Optional[StrictBool] = Field(default=None, description="if set to true, skip_confirmation will directly start the deactivation process, without sending a confirmation email beforehand.") __properties: ClassVar[List[str]] = ["skip_confirmation"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -64,7 +61,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -82,5 +80,9 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({"skip_confirmation": obj.get("skip_confirmation")}) + _obj = cls.model_validate({ + "skip_confirmation": obj.get("skip_confirmation") + }) return _obj + + diff --git a/koyeb/api/models/declare_stage_progress_request.py b/koyeb/api/models/declare_stage_progress_request.py index 37c6cf84..50777c22 100644 --- a/koyeb/api/models/declare_stage_progress_request.py +++ b/koyeb/api/models/declare_stage_progress_request.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -20,51 +20,39 @@ from datetime import datetime from pydantic import BaseModel, ConfigDict, StrictBool, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from koyeb.api.models.deployment_provisioning_info_stage_status import ( - DeploymentProvisioningInfoStageStatus, -) +from koyeb.api.models.deployment_provisioning_info_stage_status import DeploymentProvisioningInfoStageStatus from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class DeclareStageProgressRequest(BaseModel): """ DeclareStageProgressRequest - """ # noqa: E501 - + """ # noqa: E501 secret: Optional[StrictStr] = None - status: Optional[DeploymentProvisioningInfoStageStatus] = ( - DeploymentProvisioningInfoStageStatus.UNKNOWN - ) + status: Optional[DeploymentProvisioningInfoStageStatus] = DeploymentProvisioningInfoStageStatus.UNKNOWN finished_at: Optional[datetime] = None messages: Optional[List[StrictStr]] = None image_pushed: Optional[StrictBool] = None internal_failure: Optional[StrictBool] = None retryable_failure: Optional[StrictBool] = None - __properties: ClassVar[List[str]] = [ - "secret", - "status", - "finished_at", - "messages", - "image_pushed", - "internal_failure", - "retryable_failure", - ] + __properties: ClassVar[List[str]] = ["secret", "status", "finished_at", "messages", "image_pushed", "internal_failure", "retryable_failure"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -81,7 +69,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -99,19 +88,15 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "secret": obj.get("secret"), - "status": ( - obj.get("status") - if obj.get("status") is not None - else DeploymentProvisioningInfoStageStatus.UNKNOWN - ), - "finished_at": obj.get("finished_at"), - "messages": obj.get("messages"), - "image_pushed": obj.get("image_pushed"), - "internal_failure": obj.get("internal_failure"), - "retryable_failure": obj.get("retryable_failure"), - } - ) + _obj = cls.model_validate({ + "secret": obj.get("secret"), + "status": obj.get("status") if obj.get("status") is not None else DeploymentProvisioningInfoStageStatus.UNKNOWN, + "finished_at": obj.get("finished_at"), + "messages": obj.get("messages"), + "image_pushed": obj.get("image_pushed"), + "internal_failure": obj.get("internal_failure"), + "retryable_failure": obj.get("retryable_failure") + }) return _obj + + diff --git a/koyeb/api/models/declare_step_progress_request.py b/koyeb/api/models/declare_step_progress_request.py index 5dab2bc5..98034a21 100644 --- a/koyeb/api/models/declare_step_progress_request.py +++ b/koyeb/api/models/declare_step_progress_request.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -20,47 +20,37 @@ from datetime import datetime from pydantic import BaseModel, ConfigDict, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from koyeb.api.models.deployment_provisioning_info_stage_status import ( - DeploymentProvisioningInfoStageStatus, -) +from koyeb.api.models.deployment_provisioning_info_stage_status import DeploymentProvisioningInfoStageStatus from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class DeclareStepProgressRequest(BaseModel): """ DeclareStepProgressRequest - """ # noqa: E501 - + """ # noqa: E501 secret: Optional[StrictStr] = None - status: Optional[DeploymentProvisioningInfoStageStatus] = ( - DeploymentProvisioningInfoStageStatus.UNKNOWN - ) + status: Optional[DeploymentProvisioningInfoStageStatus] = DeploymentProvisioningInfoStageStatus.UNKNOWN started_at: Optional[datetime] = None finished_at: Optional[datetime] = None messages: Optional[List[StrictStr]] = None - __properties: ClassVar[List[str]] = [ - "secret", - "status", - "started_at", - "finished_at", - "messages", - ] + __properties: ClassVar[List[str]] = ["secret", "status", "started_at", "finished_at", "messages"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -77,7 +67,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -95,17 +86,13 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "secret": obj.get("secret"), - "status": ( - obj.get("status") - if obj.get("status") is not None - else DeploymentProvisioningInfoStageStatus.UNKNOWN - ), - "started_at": obj.get("started_at"), - "finished_at": obj.get("finished_at"), - "messages": obj.get("messages"), - } - ) + _obj = cls.model_validate({ + "secret": obj.get("secret"), + "status": obj.get("status") if obj.get("status") is not None else DeploymentProvisioningInfoStageStatus.UNKNOWN, + "started_at": obj.get("started_at"), + "finished_at": obj.get("finished_at"), + "messages": obj.get("messages") + }) return _obj + + diff --git a/koyeb/api/models/decline_organization_invitation_reply.py b/koyeb/api/models/decline_organization_invitation_reply.py index 473a5639..3abfeaa3 100644 --- a/koyeb/api/models/decline_organization_invitation_reply.py +++ b/koyeb/api/models/decline_organization_invitation_reply.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -22,30 +22,30 @@ from koyeb.api.models.organization_invitation import OrganizationInvitation from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class DeclineOrganizationInvitationReply(BaseModel): """ DeclineOrganizationInvitationReply - """ # noqa: E501 - + """ # noqa: E501 invitation: Optional[OrganizationInvitation] = None __properties: ClassVar[List[str]] = ["invitation"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -62,7 +62,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -71,7 +72,7 @@ def to_dict(self) -> Dict[str, Any]: ) # override the default output from pydantic by calling `to_dict()` of invitation if self.invitation: - _dict["invitation"] = self.invitation.to_dict() + _dict['invitation'] = self.invitation.to_dict() return _dict @classmethod @@ -83,13 +84,9 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "invitation": ( - OrganizationInvitation.from_dict(obj["invitation"]) - if obj.get("invitation") is not None - else None - ) - } - ) + _obj = cls.model_validate({ + "invitation": OrganizationInvitation.from_dict(obj["invitation"]) if obj.get("invitation") is not None else None + }) return _obj + + diff --git a/koyeb/api/models/delete_organization_reply.py b/koyeb/api/models/delete_organization_reply.py index 808909d5..608fca90 100644 --- a/koyeb/api/models/delete_organization_reply.py +++ b/koyeb/api/models/delete_organization_reply.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -22,30 +22,30 @@ from koyeb.api.models.organization import Organization from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class DeleteOrganizationReply(BaseModel): """ DeleteOrganizationReply - """ # noqa: E501 - + """ # noqa: E501 organization: Optional[Organization] = None __properties: ClassVar[List[str]] = ["organization"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -62,7 +62,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -71,7 +72,7 @@ def to_dict(self) -> Dict[str, Any]: ) # override the default output from pydantic by calling `to_dict()` of organization if self.organization: - _dict["organization"] = self.organization.to_dict() + _dict['organization'] = self.organization.to_dict() return _dict @classmethod @@ -83,13 +84,9 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "organization": ( - Organization.from_dict(obj["organization"]) - if obj.get("organization") is not None - else None - ) - } - ) + _obj = cls.model_validate({ + "organization": Organization.from_dict(obj["organization"]) if obj.get("organization") is not None else None + }) return _obj + + diff --git a/koyeb/api/models/delete_persistent_volume_reply.py b/koyeb/api/models/delete_persistent_volume_reply.py index 759a7c79..5ac4389a 100644 --- a/koyeb/api/models/delete_persistent_volume_reply.py +++ b/koyeb/api/models/delete_persistent_volume_reply.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -22,30 +22,30 @@ from koyeb.api.models.persistent_volume import PersistentVolume from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class DeletePersistentVolumeReply(BaseModel): """ DeletePersistentVolumeReply - """ # noqa: E501 - + """ # noqa: E501 volume: Optional[PersistentVolume] = None __properties: ClassVar[List[str]] = ["volume"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -62,7 +62,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -71,7 +72,7 @@ def to_dict(self) -> Dict[str, Any]: ) # override the default output from pydantic by calling `to_dict()` of volume if self.volume: - _dict["volume"] = self.volume.to_dict() + _dict['volume'] = self.volume.to_dict() return _dict @classmethod @@ -83,13 +84,9 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "volume": ( - PersistentVolume.from_dict(obj["volume"]) - if obj.get("volume") is not None - else None - ) - } - ) + _obj = cls.model_validate({ + "volume": PersistentVolume.from_dict(obj["volume"]) if obj.get("volume") is not None else None + }) return _obj + + diff --git a/koyeb/api/models/delete_snapshot_reply.py b/koyeb/api/models/delete_snapshot_reply.py index 5209193c..9a365a63 100644 --- a/koyeb/api/models/delete_snapshot_reply.py +++ b/koyeb/api/models/delete_snapshot_reply.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -22,30 +22,30 @@ from koyeb.api.models.snapshot import Snapshot from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class DeleteSnapshotReply(BaseModel): """ DeleteSnapshotReply - """ # noqa: E501 - + """ # noqa: E501 snapshot: Optional[Snapshot] = None __properties: ClassVar[List[str]] = ["snapshot"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -62,7 +62,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -71,7 +72,7 @@ def to_dict(self) -> Dict[str, Any]: ) # override the default output from pydantic by calling `to_dict()` of snapshot if self.snapshot: - _dict["snapshot"] = self.snapshot.to_dict() + _dict['snapshot'] = self.snapshot.to_dict() return _dict @classmethod @@ -83,13 +84,9 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "snapshot": ( - Snapshot.from_dict(obj["snapshot"]) - if obj.get("snapshot") is not None - else None - ) - } - ) + _obj = cls.model_validate({ + "snapshot": Snapshot.from_dict(obj["snapshot"]) if obj.get("snapshot") is not None else None + }) return _obj + + diff --git a/koyeb/api/models/delete_user_reply.py b/koyeb/api/models/delete_user_reply.py index 9246783b..0bf3fac2 100644 --- a/koyeb/api/models/delete_user_reply.py +++ b/koyeb/api/models/delete_user_reply.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -22,30 +22,30 @@ from koyeb.api.models.user import User from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class DeleteUserReply(BaseModel): """ DeleteUserReply - """ # noqa: E501 - + """ # noqa: E501 user: Optional[User] = None __properties: ClassVar[List[str]] = ["user"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -62,7 +62,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -71,7 +72,7 @@ def to_dict(self) -> Dict[str, Any]: ) # override the default output from pydantic by calling `to_dict()` of user if self.user: - _dict["user"] = self.user.to_dict() + _dict['user'] = self.user.to_dict() return _dict @classmethod @@ -83,11 +84,9 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "user": ( - User.from_dict(obj["user"]) if obj.get("user") is not None else None - ) - } - ) + _obj = cls.model_validate({ + "user": User.from_dict(obj["user"]) if obj.get("user") is not None else None + }) return _obj + + diff --git a/koyeb/api/models/deployment.py b/koyeb/api/models/deployment.py index 9babd8a0..f5814a35 100644 --- a/koyeb/api/models/deployment.py +++ b/koyeb/api/models/deployment.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -28,13 +28,12 @@ from koyeb.api.models.deployment_status import DeploymentStatus from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class Deployment(BaseModel): """ Deployment - """ # noqa: E501 - + """ # noqa: E501 id: Optional[StrictStr] = None created_at: Optional[datetime] = None updated_at: Optional[datetime] = None @@ -57,45 +56,23 @@ class Deployment(BaseModel): role: Optional[DeploymentRole] = DeploymentRole.INVALID version: Optional[StrictStr] = None deployment_group: Optional[StrictStr] = None - __properties: ClassVar[List[str]] = [ - "id", - "created_at", - "updated_at", - "allocated_at", - "started_at", - "succeeded_at", - "terminated_at", - "organization_id", - "app_id", - "service_id", - "parent_id", - "child_id", - "status", - "metadata", - "definition", - "messages", - "provisioning_info", - "database_info", - "skip_build", - "role", - "version", - "deployment_group", - ] + __properties: ClassVar[List[str]] = ["id", "created_at", "updated_at", "allocated_at", "started_at", "succeeded_at", "terminated_at", "organization_id", "app_id", "service_id", "parent_id", "child_id", "status", "metadata", "definition", "messages", "provisioning_info", "database_info", "skip_build", "role", "version", "deployment_group"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -112,7 +89,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -121,16 +99,16 @@ def to_dict(self) -> Dict[str, Any]: ) # override the default output from pydantic by calling `to_dict()` of metadata if self.metadata: - _dict["metadata"] = self.metadata.to_dict() + _dict['metadata'] = self.metadata.to_dict() # override the default output from pydantic by calling `to_dict()` of definition if self.definition: - _dict["definition"] = self.definition.to_dict() + _dict['definition'] = self.definition.to_dict() # override the default output from pydantic by calling `to_dict()` of provisioning_info if self.provisioning_info: - _dict["provisioning_info"] = self.provisioning_info.to_dict() + _dict['provisioning_info'] = self.provisioning_info.to_dict() # override the default output from pydantic by calling `to_dict()` of database_info if self.database_info: - _dict["database_info"] = self.database_info.to_dict() + _dict['database_info'] = self.database_info.to_dict() return _dict @classmethod @@ -142,54 +120,30 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "id": obj.get("id"), - "created_at": obj.get("created_at"), - "updated_at": obj.get("updated_at"), - "allocated_at": obj.get("allocated_at"), - "started_at": obj.get("started_at"), - "succeeded_at": obj.get("succeeded_at"), - "terminated_at": obj.get("terminated_at"), - "organization_id": obj.get("organization_id"), - "app_id": obj.get("app_id"), - "service_id": obj.get("service_id"), - "parent_id": obj.get("parent_id"), - "child_id": obj.get("child_id"), - "status": ( - obj.get("status") - if obj.get("status") is not None - else DeploymentStatus.PENDING - ), - "metadata": ( - DeploymentMetadata.from_dict(obj["metadata"]) - if obj.get("metadata") is not None - else None - ), - "definition": ( - DeploymentDefinition.from_dict(obj["definition"]) - if obj.get("definition") is not None - else None - ), - "messages": obj.get("messages"), - "provisioning_info": ( - DeploymentProvisioningInfo.from_dict(obj["provisioning_info"]) - if obj.get("provisioning_info") is not None - else None - ), - "database_info": ( - DeploymentDatabaseInfo.from_dict(obj["database_info"]) - if obj.get("database_info") is not None - else None - ), - "skip_build": obj.get("skip_build"), - "role": ( - obj.get("role") - if obj.get("role") is not None - else DeploymentRole.INVALID - ), - "version": obj.get("version"), - "deployment_group": obj.get("deployment_group"), - } - ) + _obj = cls.model_validate({ + "id": obj.get("id"), + "created_at": obj.get("created_at"), + "updated_at": obj.get("updated_at"), + "allocated_at": obj.get("allocated_at"), + "started_at": obj.get("started_at"), + "succeeded_at": obj.get("succeeded_at"), + "terminated_at": obj.get("terminated_at"), + "organization_id": obj.get("organization_id"), + "app_id": obj.get("app_id"), + "service_id": obj.get("service_id"), + "parent_id": obj.get("parent_id"), + "child_id": obj.get("child_id"), + "status": obj.get("status") if obj.get("status") is not None else DeploymentStatus.PENDING, + "metadata": DeploymentMetadata.from_dict(obj["metadata"]) if obj.get("metadata") is not None else None, + "definition": DeploymentDefinition.from_dict(obj["definition"]) if obj.get("definition") is not None else None, + "messages": obj.get("messages"), + "provisioning_info": DeploymentProvisioningInfo.from_dict(obj["provisioning_info"]) if obj.get("provisioning_info") is not None else None, + "database_info": DeploymentDatabaseInfo.from_dict(obj["database_info"]) if obj.get("database_info") is not None else None, + "skip_build": obj.get("skip_build"), + "role": obj.get("role") if obj.get("role") is not None else DeploymentRole.INVALID, + "version": obj.get("version"), + "deployment_group": obj.get("deployment_group") + }) return _obj + + diff --git a/koyeb/api/models/deployment_database_info.py b/koyeb/api/models/deployment_database_info.py index 61667cf1..ed47eb57 100644 --- a/koyeb/api/models/deployment_database_info.py +++ b/koyeb/api/models/deployment_database_info.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -19,35 +19,33 @@ from pydantic import BaseModel, ConfigDict from typing import Any, ClassVar, Dict, List, Optional -from koyeb.api.models.deployment_neon_postgres_database_info import ( - DeploymentNeonPostgresDatabaseInfo, -) +from koyeb.api.models.deployment_neon_postgres_database_info import DeploymentNeonPostgresDatabaseInfo from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class DeploymentDatabaseInfo(BaseModel): """ DeploymentDatabaseInfo - """ # noqa: E501 - + """ # noqa: E501 neon_postgres: Optional[DeploymentNeonPostgresDatabaseInfo] = None __properties: ClassVar[List[str]] = ["neon_postgres"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -64,7 +62,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -73,7 +72,7 @@ def to_dict(self) -> Dict[str, Any]: ) # override the default output from pydantic by calling `to_dict()` of neon_postgres if self.neon_postgres: - _dict["neon_postgres"] = self.neon_postgres.to_dict() + _dict['neon_postgres'] = self.neon_postgres.to_dict() return _dict @classmethod @@ -85,13 +84,9 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "neon_postgres": ( - DeploymentNeonPostgresDatabaseInfo.from_dict(obj["neon_postgres"]) - if obj.get("neon_postgres") is not None - else None - ) - } - ) + _obj = cls.model_validate({ + "neon_postgres": DeploymentNeonPostgresDatabaseInfo.from_dict(obj["neon_postgres"]) if obj.get("neon_postgres") is not None else None + }) return _obj + + diff --git a/koyeb/api/models/deployment_definition.py b/koyeb/api/models/deployment_definition.py index d294477a..36146284 100644 --- a/koyeb/api/models/deployment_definition.py +++ b/koyeb/api/models/deployment_definition.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -36,13 +36,12 @@ from koyeb.api.models.git_source import GitSource from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class DeploymentDefinition(BaseModel): """ DeploymentDefinition - """ # noqa: E501 - + """ # noqa: E501 name: Optional[StrictStr] = None type: Optional[DeploymentDefinitionType] = DeploymentDefinitionType.INVALID strategy: Optional[DeploymentStrategy] = None @@ -61,41 +60,23 @@ class DeploymentDefinition(BaseModel): git: Optional[GitSource] = None database: Optional[DatabaseSource] = None archive: Optional[ArchiveSource] = None - __properties: ClassVar[List[str]] = [ - "name", - "type", - "strategy", - "routes", - "ports", - "proxy_ports", - "env", - "regions", - "scalings", - "instance_types", - "health_checks", - "volumes", - "config_files", - "skip_cache", - "docker", - "git", - "database", - "archive", - ] + __properties: ClassVar[List[str]] = ["name", "type", "strategy", "routes", "ports", "proxy_ports", "env", "regions", "scalings", "instance_types", "health_checks", "volumes", "config_files", "skip_cache", "docker", "git", "database", "archive"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -112,7 +93,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -121,82 +103,82 @@ def to_dict(self) -> Dict[str, Any]: ) # override the default output from pydantic by calling `to_dict()` of strategy if self.strategy: - _dict["strategy"] = self.strategy.to_dict() + _dict['strategy'] = self.strategy.to_dict() # override the default output from pydantic by calling `to_dict()` of each item in routes (list) _items = [] if self.routes: for _item_routes in self.routes: if _item_routes: _items.append(_item_routes.to_dict()) - _dict["routes"] = _items + _dict['routes'] = _items # override the default output from pydantic by calling `to_dict()` of each item in ports (list) _items = [] if self.ports: for _item_ports in self.ports: if _item_ports: _items.append(_item_ports.to_dict()) - _dict["ports"] = _items + _dict['ports'] = _items # override the default output from pydantic by calling `to_dict()` of each item in proxy_ports (list) _items = [] if self.proxy_ports: for _item_proxy_ports in self.proxy_ports: if _item_proxy_ports: _items.append(_item_proxy_ports.to_dict()) - _dict["proxy_ports"] = _items + _dict['proxy_ports'] = _items # override the default output from pydantic by calling `to_dict()` of each item in env (list) _items = [] if self.env: for _item_env in self.env: if _item_env: _items.append(_item_env.to_dict()) - _dict["env"] = _items + _dict['env'] = _items # override the default output from pydantic by calling `to_dict()` of each item in scalings (list) _items = [] if self.scalings: for _item_scalings in self.scalings: if _item_scalings: _items.append(_item_scalings.to_dict()) - _dict["scalings"] = _items + _dict['scalings'] = _items # override the default output from pydantic by calling `to_dict()` of each item in instance_types (list) _items = [] if self.instance_types: for _item_instance_types in self.instance_types: if _item_instance_types: _items.append(_item_instance_types.to_dict()) - _dict["instance_types"] = _items + _dict['instance_types'] = _items # override the default output from pydantic by calling `to_dict()` of each item in health_checks (list) _items = [] if self.health_checks: for _item_health_checks in self.health_checks: if _item_health_checks: _items.append(_item_health_checks.to_dict()) - _dict["health_checks"] = _items + _dict['health_checks'] = _items # override the default output from pydantic by calling `to_dict()` of each item in volumes (list) _items = [] if self.volumes: for _item_volumes in self.volumes: if _item_volumes: _items.append(_item_volumes.to_dict()) - _dict["volumes"] = _items + _dict['volumes'] = _items # override the default output from pydantic by calling `to_dict()` of each item in config_files (list) _items = [] if self.config_files: for _item_config_files in self.config_files: if _item_config_files: _items.append(_item_config_files.to_dict()) - _dict["config_files"] = _items + _dict['config_files'] = _items # override the default output from pydantic by calling `to_dict()` of docker if self.docker: - _dict["docker"] = self.docker.to_dict() + _dict['docker'] = self.docker.to_dict() # override the default output from pydantic by calling `to_dict()` of git if self.git: - _dict["git"] = self.git.to_dict() + _dict['git'] = self.git.to_dict() # override the default output from pydantic by calling `to_dict()` of database if self.database: - _dict["database"] = self.database.to_dict() + _dict['database'] = self.database.to_dict() # override the default output from pydantic by calling `to_dict()` of archive if self.archive: - _dict["archive"] = self.archive.to_dict() + _dict['archive'] = self.archive.to_dict() return _dict @classmethod @@ -208,95 +190,26 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "name": obj.get("name"), - "type": ( - obj.get("type") - if obj.get("type") is not None - else DeploymentDefinitionType.INVALID - ), - "strategy": ( - DeploymentStrategy.from_dict(obj["strategy"]) - if obj.get("strategy") is not None - else None - ), - "routes": ( - [DeploymentRoute.from_dict(_item) for _item in obj["routes"]] - if obj.get("routes") is not None - else None - ), - "ports": ( - [DeploymentPort.from_dict(_item) for _item in obj["ports"]] - if obj.get("ports") is not None - else None - ), - "proxy_ports": ( - [ - DeploymentProxyPort.from_dict(_item) - for _item in obj["proxy_ports"] - ] - if obj.get("proxy_ports") is not None - else None - ), - "env": ( - [DeploymentEnv.from_dict(_item) for _item in obj["env"]] - if obj.get("env") is not None - else None - ), - "regions": obj.get("regions"), - "scalings": ( - [DeploymentScaling.from_dict(_item) for _item in obj["scalings"]] - if obj.get("scalings") is not None - else None - ), - "instance_types": ( - [ - DeploymentInstanceType.from_dict(_item) - for _item in obj["instance_types"] - ] - if obj.get("instance_types") is not None - else None - ), - "health_checks": ( - [ - DeploymentHealthCheck.from_dict(_item) - for _item in obj["health_checks"] - ] - if obj.get("health_checks") is not None - else None - ), - "volumes": ( - [DeploymentVolume.from_dict(_item) for _item in obj["volumes"]] - if obj.get("volumes") is not None - else None - ), - "config_files": ( - [ConfigFile.from_dict(_item) for _item in obj["config_files"]] - if obj.get("config_files") is not None - else None - ), - "skip_cache": obj.get("skip_cache"), - "docker": ( - DockerSource.from_dict(obj["docker"]) - if obj.get("docker") is not None - else None - ), - "git": ( - GitSource.from_dict(obj["git"]) - if obj.get("git") is not None - else None - ), - "database": ( - DatabaseSource.from_dict(obj["database"]) - if obj.get("database") is not None - else None - ), - "archive": ( - ArchiveSource.from_dict(obj["archive"]) - if obj.get("archive") is not None - else None - ), - } - ) + _obj = cls.model_validate({ + "name": obj.get("name"), + "type": obj.get("type") if obj.get("type") is not None else DeploymentDefinitionType.INVALID, + "strategy": DeploymentStrategy.from_dict(obj["strategy"]) if obj.get("strategy") is not None else None, + "routes": [DeploymentRoute.from_dict(_item) for _item in obj["routes"]] if obj.get("routes") is not None else None, + "ports": [DeploymentPort.from_dict(_item) for _item in obj["ports"]] if obj.get("ports") is not None else None, + "proxy_ports": [DeploymentProxyPort.from_dict(_item) for _item in obj["proxy_ports"]] if obj.get("proxy_ports") is not None else None, + "env": [DeploymentEnv.from_dict(_item) for _item in obj["env"]] if obj.get("env") is not None else None, + "regions": obj.get("regions"), + "scalings": [DeploymentScaling.from_dict(_item) for _item in obj["scalings"]] if obj.get("scalings") is not None else None, + "instance_types": [DeploymentInstanceType.from_dict(_item) for _item in obj["instance_types"]] if obj.get("instance_types") is not None else None, + "health_checks": [DeploymentHealthCheck.from_dict(_item) for _item in obj["health_checks"]] if obj.get("health_checks") is not None else None, + "volumes": [DeploymentVolume.from_dict(_item) for _item in obj["volumes"]] if obj.get("volumes") is not None else None, + "config_files": [ConfigFile.from_dict(_item) for _item in obj["config_files"]] if obj.get("config_files") is not None else None, + "skip_cache": obj.get("skip_cache"), + "docker": DockerSource.from_dict(obj["docker"]) if obj.get("docker") is not None else None, + "git": GitSource.from_dict(obj["git"]) if obj.get("git") is not None else None, + "database": DatabaseSource.from_dict(obj["database"]) if obj.get("database") is not None else None, + "archive": ArchiveSource.from_dict(obj["archive"]) if obj.get("archive") is not None else None + }) return _obj + + diff --git a/koyeb/api/models/deployment_definition_type.py b/koyeb/api/models/deployment_definition_type.py index 64e9cce6..4897cba4 100644 --- a/koyeb/api/models/deployment_definition_type.py +++ b/koyeb/api/models/deployment_definition_type.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -26,13 +26,15 @@ class DeploymentDefinitionType(str, Enum): """ allowed enum values """ - INVALID = "INVALID" - WEB = "WEB" - WORKER = "WORKER" - DATABASE = "DATABASE" - SANDBOX = "SANDBOX" + INVALID = 'INVALID' + WEB = 'WEB' + WORKER = 'WORKER' + DATABASE = 'DATABASE' + SANDBOX = 'SANDBOX' @classmethod def from_json(cls, json_str: str) -> Self: """Create an instance of DeploymentDefinitionType from a JSON string""" return cls(json.loads(json_str)) + + diff --git a/koyeb/api/models/deployment_env.py b/koyeb/api/models/deployment_env.py index a459d6c4..98d50c71 100644 --- a/koyeb/api/models/deployment_env.py +++ b/koyeb/api/models/deployment_env.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -21,13 +21,12 @@ from typing import Any, ClassVar, Dict, List, Optional from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class DeploymentEnv(BaseModel): """ DeploymentEnv - """ # noqa: E501 - + """ # noqa: E501 scopes: Optional[List[StrictStr]] = None key: Optional[StrictStr] = None value: Optional[StrictStr] = None @@ -35,19 +34,20 @@ class DeploymentEnv(BaseModel): __properties: ClassVar[List[str]] = ["scopes", "key", "value", "secret"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -64,7 +64,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -82,12 +83,12 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "scopes": obj.get("scopes"), - "key": obj.get("key"), - "value": obj.get("value"), - "secret": obj.get("secret"), - } - ) + _obj = cls.model_validate({ + "scopes": obj.get("scopes"), + "key": obj.get("key"), + "value": obj.get("value"), + "secret": obj.get("secret") + }) return _obj + + diff --git a/koyeb/api/models/deployment_event.py b/koyeb/api/models/deployment_event.py index 2c03c913..c95f6fea 100644 --- a/koyeb/api/models/deployment_event.py +++ b/koyeb/api/models/deployment_event.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -22,13 +22,12 @@ from typing import Any, ClassVar, Dict, List, Optional from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class DeploymentEvent(BaseModel): """ DeploymentEvent - """ # noqa: E501 - + """ # noqa: E501 id: Optional[StrictStr] = None when: Optional[datetime] = None organization_id: Optional[StrictStr] = None @@ -36,30 +35,23 @@ class DeploymentEvent(BaseModel): type: Optional[StrictStr] = None message: Optional[StrictStr] = None metadata: Optional[Dict[str, Any]] = None - __properties: ClassVar[List[str]] = [ - "id", - "when", - "organization_id", - "deployment_id", - "type", - "message", - "metadata", - ] + __properties: ClassVar[List[str]] = ["id", "when", "organization_id", "deployment_id", "type", "message", "metadata"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -76,7 +68,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -94,15 +87,15 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "id": obj.get("id"), - "when": obj.get("when"), - "organization_id": obj.get("organization_id"), - "deployment_id": obj.get("deployment_id"), - "type": obj.get("type"), - "message": obj.get("message"), - "metadata": obj.get("metadata"), - } - ) + _obj = cls.model_validate({ + "id": obj.get("id"), + "when": obj.get("when"), + "organization_id": obj.get("organization_id"), + "deployment_id": obj.get("deployment_id"), + "type": obj.get("type"), + "message": obj.get("message"), + "metadata": obj.get("metadata") + }) return _obj + + diff --git a/koyeb/api/models/deployment_health_check.py b/koyeb/api/models/deployment_health_check.py index 7d99c16c..18e63351 100644 --- a/koyeb/api/models/deployment_health_check.py +++ b/koyeb/api/models/deployment_health_check.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -23,42 +23,35 @@ from koyeb.api.models.tcp_health_check import TCPHealthCheck from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class DeploymentHealthCheck(BaseModel): """ DeploymentHealthCheck - """ # noqa: E501 - + """ # noqa: E501 grace_period: Optional[StrictInt] = None interval: Optional[StrictInt] = None restart_limit: Optional[StrictInt] = None timeout: Optional[StrictInt] = None tcp: Optional[TCPHealthCheck] = None http: Optional[HTTPHealthCheck] = None - __properties: ClassVar[List[str]] = [ - "grace_period", - "interval", - "restart_limit", - "timeout", - "tcp", - "http", - ] + __properties: ClassVar[List[str]] = ["grace_period", "interval", "restart_limit", "timeout", "tcp", "http"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -75,7 +68,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -84,10 +78,10 @@ def to_dict(self) -> Dict[str, Any]: ) # override the default output from pydantic by calling `to_dict()` of tcp if self.tcp: - _dict["tcp"] = self.tcp.to_dict() + _dict['tcp'] = self.tcp.to_dict() # override the default output from pydantic by calling `to_dict()` of http if self.http: - _dict["http"] = self.http.to_dict() + _dict['http'] = self.http.to_dict() return _dict @classmethod @@ -99,22 +93,14 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "grace_period": obj.get("grace_period"), - "interval": obj.get("interval"), - "restart_limit": obj.get("restart_limit"), - "timeout": obj.get("timeout"), - "tcp": ( - TCPHealthCheck.from_dict(obj["tcp"]) - if obj.get("tcp") is not None - else None - ), - "http": ( - HTTPHealthCheck.from_dict(obj["http"]) - if obj.get("http") is not None - else None - ), - } - ) + _obj = cls.model_validate({ + "grace_period": obj.get("grace_period"), + "interval": obj.get("interval"), + "restart_limit": obj.get("restart_limit"), + "timeout": obj.get("timeout"), + "tcp": TCPHealthCheck.from_dict(obj["tcp"]) if obj.get("tcp") is not None else None, + "http": HTTPHealthCheck.from_dict(obj["http"]) if obj.get("http") is not None else None + }) return _obj + + diff --git a/koyeb/api/models/deployment_instance_type.py b/koyeb/api/models/deployment_instance_type.py index 546c1508..9ea41e65 100644 --- a/koyeb/api/models/deployment_instance_type.py +++ b/koyeb/api/models/deployment_instance_type.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -21,31 +21,31 @@ from typing import Any, ClassVar, Dict, List, Optional from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class DeploymentInstanceType(BaseModel): """ DeploymentInstanceType - """ # noqa: E501 - + """ # noqa: E501 scopes: Optional[List[StrictStr]] = None type: Optional[StrictStr] = None __properties: ClassVar[List[str]] = ["scopes", "type"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -62,7 +62,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -80,7 +81,10 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - {"scopes": obj.get("scopes"), "type": obj.get("type")} - ) + _obj = cls.model_validate({ + "scopes": obj.get("scopes"), + "type": obj.get("type") + }) return _obj + + diff --git a/koyeb/api/models/deployment_list_item.py b/koyeb/api/models/deployment_list_item.py index fcf161bc..854d04fc 100644 --- a/koyeb/api/models/deployment_list_item.py +++ b/koyeb/api/models/deployment_list_item.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -27,13 +27,12 @@ from koyeb.api.models.deployment_status import DeploymentStatus from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class DeploymentListItem(BaseModel): """ DeploymentListItem - """ # noqa: E501 - + """ # noqa: E501 id: Optional[StrictStr] = None created_at: Optional[datetime] = None updated_at: Optional[datetime] = None @@ -54,43 +53,23 @@ class DeploymentListItem(BaseModel): database_info: Optional[DeploymentDatabaseInfo] = None version: Optional[StrictStr] = None deployment_group: Optional[StrictStr] = None - __properties: ClassVar[List[str]] = [ - "id", - "created_at", - "updated_at", - "allocated_at", - "started_at", - "succeeded_at", - "terminated_at", - "organization_id", - "app_id", - "service_id", - "parent_id", - "child_id", - "status", - "metadata", - "definition", - "messages", - "provisioning_info", - "database_info", - "version", - "deployment_group", - ] + __properties: ClassVar[List[str]] = ["id", "created_at", "updated_at", "allocated_at", "started_at", "succeeded_at", "terminated_at", "organization_id", "app_id", "service_id", "parent_id", "child_id", "status", "metadata", "definition", "messages", "provisioning_info", "database_info", "version", "deployment_group"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -107,7 +86,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -116,16 +96,16 @@ def to_dict(self) -> Dict[str, Any]: ) # override the default output from pydantic by calling `to_dict()` of metadata if self.metadata: - _dict["metadata"] = self.metadata.to_dict() + _dict['metadata'] = self.metadata.to_dict() # override the default output from pydantic by calling `to_dict()` of definition if self.definition: - _dict["definition"] = self.definition.to_dict() + _dict['definition'] = self.definition.to_dict() # override the default output from pydantic by calling `to_dict()` of provisioning_info if self.provisioning_info: - _dict["provisioning_info"] = self.provisioning_info.to_dict() + _dict['provisioning_info'] = self.provisioning_info.to_dict() # override the default output from pydantic by calling `to_dict()` of database_info if self.database_info: - _dict["database_info"] = self.database_info.to_dict() + _dict['database_info'] = self.database_info.to_dict() return _dict @classmethod @@ -137,48 +117,28 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "id": obj.get("id"), - "created_at": obj.get("created_at"), - "updated_at": obj.get("updated_at"), - "allocated_at": obj.get("allocated_at"), - "started_at": obj.get("started_at"), - "succeeded_at": obj.get("succeeded_at"), - "terminated_at": obj.get("terminated_at"), - "organization_id": obj.get("organization_id"), - "app_id": obj.get("app_id"), - "service_id": obj.get("service_id"), - "parent_id": obj.get("parent_id"), - "child_id": obj.get("child_id"), - "status": ( - obj.get("status") - if obj.get("status") is not None - else DeploymentStatus.PENDING - ), - "metadata": ( - DeploymentMetadata.from_dict(obj["metadata"]) - if obj.get("metadata") is not None - else None - ), - "definition": ( - DeploymentDefinition.from_dict(obj["definition"]) - if obj.get("definition") is not None - else None - ), - "messages": obj.get("messages"), - "provisioning_info": ( - DeploymentProvisioningInfo.from_dict(obj["provisioning_info"]) - if obj.get("provisioning_info") is not None - else None - ), - "database_info": ( - DeploymentDatabaseInfo.from_dict(obj["database_info"]) - if obj.get("database_info") is not None - else None - ), - "version": obj.get("version"), - "deployment_group": obj.get("deployment_group"), - } - ) + _obj = cls.model_validate({ + "id": obj.get("id"), + "created_at": obj.get("created_at"), + "updated_at": obj.get("updated_at"), + "allocated_at": obj.get("allocated_at"), + "started_at": obj.get("started_at"), + "succeeded_at": obj.get("succeeded_at"), + "terminated_at": obj.get("terminated_at"), + "organization_id": obj.get("organization_id"), + "app_id": obj.get("app_id"), + "service_id": obj.get("service_id"), + "parent_id": obj.get("parent_id"), + "child_id": obj.get("child_id"), + "status": obj.get("status") if obj.get("status") is not None else DeploymentStatus.PENDING, + "metadata": DeploymentMetadata.from_dict(obj["metadata"]) if obj.get("metadata") is not None else None, + "definition": DeploymentDefinition.from_dict(obj["definition"]) if obj.get("definition") is not None else None, + "messages": obj.get("messages"), + "provisioning_info": DeploymentProvisioningInfo.from_dict(obj["provisioning_info"]) if obj.get("provisioning_info") is not None else None, + "database_info": DeploymentDatabaseInfo.from_dict(obj["database_info"]) if obj.get("database_info") is not None else None, + "version": obj.get("version"), + "deployment_group": obj.get("deployment_group") + }) return _obj + + diff --git a/koyeb/api/models/deployment_metadata.py b/koyeb/api/models/deployment_metadata.py index ce6b3747..3b5d9cab 100644 --- a/koyeb/api/models/deployment_metadata.py +++ b/koyeb/api/models/deployment_metadata.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -23,43 +23,39 @@ from koyeb.api.models.database_deployment_metadata import DatabaseDeploymentMetadata from koyeb.api.models.deployment_proxy_port_metadata import DeploymentProxyPortMetadata from koyeb.api.models.git_deployment_metadata import GitDeploymentMetadata +from koyeb.api.models.sandbox_metadata import SandboxMetadata from koyeb.api.models.trigger_deployment_metadata import TriggerDeploymentMetadata from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class DeploymentMetadata(BaseModel): """ DeploymentMetadata - """ # noqa: E501 - + """ # noqa: E501 trigger: Optional[TriggerDeploymentMetadata] = None database: Optional[DatabaseDeploymentMetadata] = None git: Optional[GitDeploymentMetadata] = None archive: Optional[ArchiveDeploymentMetadata] = None proxy_ports: Optional[List[DeploymentProxyPortMetadata]] = None - __properties: ClassVar[List[str]] = [ - "trigger", - "database", - "git", - "archive", - "proxy_ports", - ] + sandbox: Optional[SandboxMetadata] = None + __properties: ClassVar[List[str]] = ["trigger", "database", "git", "archive", "proxy_ports", "sandbox"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -76,7 +72,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -85,23 +82,26 @@ def to_dict(self) -> Dict[str, Any]: ) # override the default output from pydantic by calling `to_dict()` of trigger if self.trigger: - _dict["trigger"] = self.trigger.to_dict() + _dict['trigger'] = self.trigger.to_dict() # override the default output from pydantic by calling `to_dict()` of database if self.database: - _dict["database"] = self.database.to_dict() + _dict['database'] = self.database.to_dict() # override the default output from pydantic by calling `to_dict()` of git if self.git: - _dict["git"] = self.git.to_dict() + _dict['git'] = self.git.to_dict() # override the default output from pydantic by calling `to_dict()` of archive if self.archive: - _dict["archive"] = self.archive.to_dict() + _dict['archive'] = self.archive.to_dict() # override the default output from pydantic by calling `to_dict()` of each item in proxy_ports (list) _items = [] if self.proxy_ports: for _item_proxy_ports in self.proxy_ports: if _item_proxy_ports: _items.append(_item_proxy_ports.to_dict()) - _dict["proxy_ports"] = _items + _dict['proxy_ports'] = _items + # override the default output from pydantic by calling `to_dict()` of sandbox + if self.sandbox: + _dict['sandbox'] = self.sandbox.to_dict() return _dict @classmethod @@ -113,36 +113,14 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "trigger": ( - TriggerDeploymentMetadata.from_dict(obj["trigger"]) - if obj.get("trigger") is not None - else None - ), - "database": ( - DatabaseDeploymentMetadata.from_dict(obj["database"]) - if obj.get("database") is not None - else None - ), - "git": ( - GitDeploymentMetadata.from_dict(obj["git"]) - if obj.get("git") is not None - else None - ), - "archive": ( - ArchiveDeploymentMetadata.from_dict(obj["archive"]) - if obj.get("archive") is not None - else None - ), - "proxy_ports": ( - [ - DeploymentProxyPortMetadata.from_dict(_item) - for _item in obj["proxy_ports"] - ] - if obj.get("proxy_ports") is not None - else None - ), - } - ) + _obj = cls.model_validate({ + "trigger": TriggerDeploymentMetadata.from_dict(obj["trigger"]) if obj.get("trigger") is not None else None, + "database": DatabaseDeploymentMetadata.from_dict(obj["database"]) if obj.get("database") is not None else None, + "git": GitDeploymentMetadata.from_dict(obj["git"]) if obj.get("git") is not None else None, + "archive": ArchiveDeploymentMetadata.from_dict(obj["archive"]) if obj.get("archive") is not None else None, + "proxy_ports": [DeploymentProxyPortMetadata.from_dict(_item) for _item in obj["proxy_ports"]] if obj.get("proxy_ports") is not None else None, + "sandbox": SandboxMetadata.from_dict(obj["sandbox"]) if obj.get("sandbox") is not None else None + }) return _obj + + diff --git a/koyeb/api/models/deployment_neon_postgres_database_info.py b/koyeb/api/models/deployment_neon_postgres_database_info.py index bbb31572..a672cba5 100644 --- a/koyeb/api/models/deployment_neon_postgres_database_info.py +++ b/koyeb/api/models/deployment_neon_postgres_database_info.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -20,18 +20,15 @@ from datetime import datetime from pydantic import BaseModel, ConfigDict, StrictInt, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from koyeb.api.models.deployment_neon_postgres_database_info_role import ( - DeploymentNeonPostgresDatabaseInfoRole, -) +from koyeb.api.models.deployment_neon_postgres_database_info_role import DeploymentNeonPostgresDatabaseInfoRole from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class DeploymentNeonPostgresDatabaseInfo(BaseModel): """ DeploymentNeonPostgresDatabaseInfo - """ # noqa: E501 - + """ # noqa: E501 active_time_seconds: Optional[StrictStr] = None compute_time_seconds: Optional[StrictStr] = None written_data_bytes: Optional[StrictStr] = None @@ -46,37 +43,23 @@ class DeploymentNeonPostgresDatabaseInfo(BaseModel): default_branch_state: Optional[StrictStr] = None default_branch_logical_size: Optional[StrictStr] = None roles: Optional[List[DeploymentNeonPostgresDatabaseInfoRole]] = None - __properties: ClassVar[List[str]] = [ - "active_time_seconds", - "compute_time_seconds", - "written_data_bytes", - "data_transfer_bytes", - "data_storage_bytes_hour", - "server_host", - "server_port", - "endpoint_state", - "endpoint_last_active", - "default_branch_id", - "default_branch_name", - "default_branch_state", - "default_branch_logical_size", - "roles", - ] + __properties: ClassVar[List[str]] = ["active_time_seconds", "compute_time_seconds", "written_data_bytes", "data_transfer_bytes", "data_storage_bytes_hour", "server_host", "server_port", "endpoint_state", "endpoint_last_active", "default_branch_id", "default_branch_name", "default_branch_state", "default_branch_logical_size", "roles"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -93,7 +76,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -106,7 +90,7 @@ def to_dict(self) -> Dict[str, Any]: for _item_roles in self.roles: if _item_roles: _items.append(_item_roles.to_dict()) - _dict["roles"] = _items + _dict['roles'] = _items return _dict @classmethod @@ -118,29 +102,22 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "active_time_seconds": obj.get("active_time_seconds"), - "compute_time_seconds": obj.get("compute_time_seconds"), - "written_data_bytes": obj.get("written_data_bytes"), - "data_transfer_bytes": obj.get("data_transfer_bytes"), - "data_storage_bytes_hour": obj.get("data_storage_bytes_hour"), - "server_host": obj.get("server_host"), - "server_port": obj.get("server_port"), - "endpoint_state": obj.get("endpoint_state"), - "endpoint_last_active": obj.get("endpoint_last_active"), - "default_branch_id": obj.get("default_branch_id"), - "default_branch_name": obj.get("default_branch_name"), - "default_branch_state": obj.get("default_branch_state"), - "default_branch_logical_size": obj.get("default_branch_logical_size"), - "roles": ( - [ - DeploymentNeonPostgresDatabaseInfoRole.from_dict(_item) - for _item in obj["roles"] - ] - if obj.get("roles") is not None - else None - ), - } - ) + _obj = cls.model_validate({ + "active_time_seconds": obj.get("active_time_seconds"), + "compute_time_seconds": obj.get("compute_time_seconds"), + "written_data_bytes": obj.get("written_data_bytes"), + "data_transfer_bytes": obj.get("data_transfer_bytes"), + "data_storage_bytes_hour": obj.get("data_storage_bytes_hour"), + "server_host": obj.get("server_host"), + "server_port": obj.get("server_port"), + "endpoint_state": obj.get("endpoint_state"), + "endpoint_last_active": obj.get("endpoint_last_active"), + "default_branch_id": obj.get("default_branch_id"), + "default_branch_name": obj.get("default_branch_name"), + "default_branch_state": obj.get("default_branch_state"), + "default_branch_logical_size": obj.get("default_branch_logical_size"), + "roles": [DeploymentNeonPostgresDatabaseInfoRole.from_dict(_item) for _item in obj["roles"]] if obj.get("roles") is not None else None + }) return _obj + + diff --git a/koyeb/api/models/deployment_neon_postgres_database_info_role.py b/koyeb/api/models/deployment_neon_postgres_database_info_role.py index 61f82562..e488eb0e 100644 --- a/koyeb/api/models/deployment_neon_postgres_database_info_role.py +++ b/koyeb/api/models/deployment_neon_postgres_database_info_role.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -21,31 +21,31 @@ from typing import Any, ClassVar, Dict, List, Optional from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class DeploymentNeonPostgresDatabaseInfoRole(BaseModel): """ DeploymentNeonPostgresDatabaseInfoRole - """ # noqa: E501 - + """ # noqa: E501 name: Optional[StrictStr] = None secret_id: Optional[StrictStr] = None __properties: ClassVar[List[str]] = ["name", "secret_id"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -62,7 +62,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -80,7 +81,10 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - {"name": obj.get("name"), "secret_id": obj.get("secret_id")} - ) + _obj = cls.model_validate({ + "name": obj.get("name"), + "secret_id": obj.get("secret_id") + }) return _obj + + diff --git a/koyeb/api/models/deployment_port.py b/koyeb/api/models/deployment_port.py index 664b84f4..9f2535d8 100644 --- a/koyeb/api/models/deployment_port.py +++ b/koyeb/api/models/deployment_port.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -21,31 +21,31 @@ from typing import Any, ClassVar, Dict, List, Optional from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class DeploymentPort(BaseModel): """ DeploymentPort - """ # noqa: E501 - + """ # noqa: E501 port: Optional[StrictInt] = None protocol: Optional[StrictStr] = None __properties: ClassVar[List[str]] = ["port", "protocol"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -62,7 +62,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -80,7 +81,10 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - {"port": obj.get("port"), "protocol": obj.get("protocol")} - ) + _obj = cls.model_validate({ + "port": obj.get("port"), + "protocol": obj.get("protocol") + }) return _obj + + diff --git a/koyeb/api/models/deployment_provisioning_info.py b/koyeb/api/models/deployment_provisioning_info.py index f8cc0952..1f752524 100644 --- a/koyeb/api/models/deployment_provisioning_info.py +++ b/koyeb/api/models/deployment_provisioning_info.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -19,44 +19,35 @@ from pydantic import BaseModel, ConfigDict, Field, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from koyeb.api.models.deployment_provisioning_info_stage import ( - DeploymentProvisioningInfoStage, -) +from koyeb.api.models.deployment_provisioning_info_stage import DeploymentProvisioningInfoStage from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class DeploymentProvisioningInfo(BaseModel): """ DeploymentProvisioningInfo - """ # noqa: E501 - - sha: Optional[StrictStr] = Field( - default=None, - description="The git sha for this build (we resolve the reference at the start of the build).", - ) - image: Optional[StrictStr] = Field( - default=None, description="The docker image built as a result of this build." - ) - stages: Optional[List[DeploymentProvisioningInfoStage]] = Field( - default=None, description="Some info about the build." - ) + """ # noqa: E501 + sha: Optional[StrictStr] = Field(default=None, description="The git sha for this build (we resolve the reference at the start of the build).") + image: Optional[StrictStr] = Field(default=None, description="The docker image built as a result of this build.") + stages: Optional[List[DeploymentProvisioningInfoStage]] = Field(default=None, description="Some info about the build.") __properties: ClassVar[List[str]] = ["sha", "image", "stages"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -73,7 +64,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -86,7 +78,7 @@ def to_dict(self) -> Dict[str, Any]: for _item_stages in self.stages: if _item_stages: _items.append(_item_stages.to_dict()) - _dict["stages"] = _items + _dict['stages'] = _items return _dict @classmethod @@ -98,18 +90,11 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "sha": obj.get("sha"), - "image": obj.get("image"), - "stages": ( - [ - DeploymentProvisioningInfoStage.from_dict(_item) - for _item in obj["stages"] - ] - if obj.get("stages") is not None - else None - ), - } - ) + _obj = cls.model_validate({ + "sha": obj.get("sha"), + "image": obj.get("image"), + "stages": [DeploymentProvisioningInfoStage.from_dict(_item) for _item in obj["stages"]] if obj.get("stages") is not None else None + }) return _obj + + diff --git a/koyeb/api/models/deployment_provisioning_info_stage.py b/koyeb/api/models/deployment_provisioning_info_stage.py index ee736d31..b09a561c 100644 --- a/koyeb/api/models/deployment_provisioning_info_stage.py +++ b/koyeb/api/models/deployment_provisioning_info_stage.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -20,52 +20,39 @@ from datetime import datetime from pydantic import BaseModel, ConfigDict, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from koyeb.api.models.deployment_provisioning_info_stage_build_attempt import ( - DeploymentProvisioningInfoStageBuildAttempt, -) -from koyeb.api.models.deployment_provisioning_info_stage_status import ( - DeploymentProvisioningInfoStageStatus, -) +from koyeb.api.models.deployment_provisioning_info_stage_build_attempt import DeploymentProvisioningInfoStageBuildAttempt +from koyeb.api.models.deployment_provisioning_info_stage_status import DeploymentProvisioningInfoStageStatus from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class DeploymentProvisioningInfoStage(BaseModel): """ DeploymentProvisioningInfoStage - """ # noqa: E501 - + """ # noqa: E501 name: Optional[StrictStr] = None - status: Optional[DeploymentProvisioningInfoStageStatus] = ( - DeploymentProvisioningInfoStageStatus.UNKNOWN - ) + status: Optional[DeploymentProvisioningInfoStageStatus] = DeploymentProvisioningInfoStageStatus.UNKNOWN messages: Optional[List[StrictStr]] = None started_at: Optional[datetime] = None finished_at: Optional[datetime] = None build_attempts: Optional[List[DeploymentProvisioningInfoStageBuildAttempt]] = None - __properties: ClassVar[List[str]] = [ - "name", - "status", - "messages", - "started_at", - "finished_at", - "build_attempts", - ] + __properties: ClassVar[List[str]] = ["name", "status", "messages", "started_at", "finished_at", "build_attempts"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -82,7 +69,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -95,7 +83,7 @@ def to_dict(self) -> Dict[str, Any]: for _item_build_attempts in self.build_attempts: if _item_build_attempts: _items.append(_item_build_attempts.to_dict()) - _dict["build_attempts"] = _items + _dict['build_attempts'] = _items return _dict @classmethod @@ -107,25 +95,14 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "name": obj.get("name"), - "status": ( - obj.get("status") - if obj.get("status") is not None - else DeploymentProvisioningInfoStageStatus.UNKNOWN - ), - "messages": obj.get("messages"), - "started_at": obj.get("started_at"), - "finished_at": obj.get("finished_at"), - "build_attempts": ( - [ - DeploymentProvisioningInfoStageBuildAttempt.from_dict(_item) - for _item in obj["build_attempts"] - ] - if obj.get("build_attempts") is not None - else None - ), - } - ) + _obj = cls.model_validate({ + "name": obj.get("name"), + "status": obj.get("status") if obj.get("status") is not None else DeploymentProvisioningInfoStageStatus.UNKNOWN, + "messages": obj.get("messages"), + "started_at": obj.get("started_at"), + "finished_at": obj.get("finished_at"), + "build_attempts": [DeploymentProvisioningInfoStageBuildAttempt.from_dict(_item) for _item in obj["build_attempts"]] if obj.get("build_attempts") is not None else None + }) return _obj + + diff --git a/koyeb/api/models/deployment_provisioning_info_stage_build_attempt.py b/koyeb/api/models/deployment_provisioning_info_stage_build_attempt.py index 65e164b6..9b67ba17 100644 --- a/koyeb/api/models/deployment_provisioning_info_stage_build_attempt.py +++ b/koyeb/api/models/deployment_provisioning_info_stage_build_attempt.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -20,25 +20,18 @@ from datetime import datetime from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from koyeb.api.models.deployment_provisioning_info_stage_build_attempt_build_step import ( - DeploymentProvisioningInfoStageBuildAttemptBuildStep, -) -from koyeb.api.models.deployment_provisioning_info_stage_status import ( - DeploymentProvisioningInfoStageStatus, -) +from koyeb.api.models.deployment_provisioning_info_stage_build_attempt_build_step import DeploymentProvisioningInfoStageBuildAttemptBuildStep +from koyeb.api.models.deployment_provisioning_info_stage_status import DeploymentProvisioningInfoStageStatus from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class DeploymentProvisioningInfoStageBuildAttempt(BaseModel): """ DeploymentProvisioningInfoStageBuildAttempt - """ # noqa: E501 - + """ # noqa: E501 id: Optional[StrictInt] = None - status: Optional[DeploymentProvisioningInfoStageStatus] = ( - DeploymentProvisioningInfoStageStatus.UNKNOWN - ) + status: Optional[DeploymentProvisioningInfoStageStatus] = DeploymentProvisioningInfoStageStatus.UNKNOWN messages: Optional[List[StrictStr]] = None started_at: Optional[datetime] = None finished_at: Optional[datetime] = None @@ -46,37 +39,24 @@ class DeploymentProvisioningInfoStageBuildAttempt(BaseModel): image_pushed: Optional[StrictBool] = None internal_failure: Optional[StrictBool] = None retryable_failure: Optional[StrictBool] = None - wait_completion: Optional[StrictBool] = Field( - default=None, - description="This flag is used to finalize the build, and continue the deployment in case of success, or cancel and potentially retry the build in case of failure.", - ) - __properties: ClassVar[List[str]] = [ - "id", - "status", - "messages", - "started_at", - "finished_at", - "steps", - "image_pushed", - "internal_failure", - "retryable_failure", - "wait_completion", - ] + wait_completion: Optional[StrictBool] = Field(default=None, description="This flag is used to finalize the build, and continue the deployment in case of success, or cancel and potentially retry the build in case of failure.") + __properties: ClassVar[List[str]] = ["id", "status", "messages", "started_at", "finished_at", "steps", "image_pushed", "internal_failure", "retryable_failure", "wait_completion"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -93,7 +73,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -106,7 +87,7 @@ def to_dict(self) -> Dict[str, Any]: for _item_steps in self.steps: if _item_steps: _items.append(_item_steps.to_dict()) - _dict["steps"] = _items + _dict['steps'] = _items return _dict @classmethod @@ -118,31 +99,18 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "id": obj.get("id"), - "status": ( - obj.get("status") - if obj.get("status") is not None - else DeploymentProvisioningInfoStageStatus.UNKNOWN - ), - "messages": obj.get("messages"), - "started_at": obj.get("started_at"), - "finished_at": obj.get("finished_at"), - "steps": ( - [ - DeploymentProvisioningInfoStageBuildAttemptBuildStep.from_dict( - _item - ) - for _item in obj["steps"] - ] - if obj.get("steps") is not None - else None - ), - "image_pushed": obj.get("image_pushed"), - "internal_failure": obj.get("internal_failure"), - "retryable_failure": obj.get("retryable_failure"), - "wait_completion": obj.get("wait_completion"), - } - ) + _obj = cls.model_validate({ + "id": obj.get("id"), + "status": obj.get("status") if obj.get("status") is not None else DeploymentProvisioningInfoStageStatus.UNKNOWN, + "messages": obj.get("messages"), + "started_at": obj.get("started_at"), + "finished_at": obj.get("finished_at"), + "steps": [DeploymentProvisioningInfoStageBuildAttemptBuildStep.from_dict(_item) for _item in obj["steps"]] if obj.get("steps") is not None else None, + "image_pushed": obj.get("image_pushed"), + "internal_failure": obj.get("internal_failure"), + "retryable_failure": obj.get("retryable_failure"), + "wait_completion": obj.get("wait_completion") + }) return _obj + + diff --git a/koyeb/api/models/deployment_provisioning_info_stage_build_attempt_build_step.py b/koyeb/api/models/deployment_provisioning_info_stage_build_attempt_build_step.py index 01c93f32..c6ab06b1 100644 --- a/koyeb/api/models/deployment_provisioning_info_stage_build_attempt_build_step.py +++ b/koyeb/api/models/deployment_provisioning_info_stage_build_attempt_build_step.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -20,47 +20,37 @@ from datetime import datetime from pydantic import BaseModel, ConfigDict, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from koyeb.api.models.deployment_provisioning_info_stage_status import ( - DeploymentProvisioningInfoStageStatus, -) +from koyeb.api.models.deployment_provisioning_info_stage_status import DeploymentProvisioningInfoStageStatus from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class DeploymentProvisioningInfoStageBuildAttemptBuildStep(BaseModel): """ DeploymentProvisioningInfoStageBuildAttemptBuildStep - """ # noqa: E501 - + """ # noqa: E501 name: Optional[StrictStr] = None - status: Optional[DeploymentProvisioningInfoStageStatus] = ( - DeploymentProvisioningInfoStageStatus.UNKNOWN - ) + status: Optional[DeploymentProvisioningInfoStageStatus] = DeploymentProvisioningInfoStageStatus.UNKNOWN messages: Optional[List[StrictStr]] = None started_at: Optional[datetime] = None finished_at: Optional[datetime] = None - __properties: ClassVar[List[str]] = [ - "name", - "status", - "messages", - "started_at", - "finished_at", - ] + __properties: ClassVar[List[str]] = ["name", "status", "messages", "started_at", "finished_at"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -77,7 +67,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -95,17 +86,13 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "name": obj.get("name"), - "status": ( - obj.get("status") - if obj.get("status") is not None - else DeploymentProvisioningInfoStageStatus.UNKNOWN - ), - "messages": obj.get("messages"), - "started_at": obj.get("started_at"), - "finished_at": obj.get("finished_at"), - } - ) + _obj = cls.model_validate({ + "name": obj.get("name"), + "status": obj.get("status") if obj.get("status") is not None else DeploymentProvisioningInfoStageStatus.UNKNOWN, + "messages": obj.get("messages"), + "started_at": obj.get("started_at"), + "finished_at": obj.get("finished_at") + }) return _obj + + diff --git a/koyeb/api/models/deployment_provisioning_info_stage_status.py b/koyeb/api/models/deployment_provisioning_info_stage_status.py index cc598007..38fe449d 100644 --- a/koyeb/api/models/deployment_provisioning_info_stage_status.py +++ b/koyeb/api/models/deployment_provisioning_info_stage_status.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -26,14 +26,16 @@ class DeploymentProvisioningInfoStageStatus(str, Enum): """ allowed enum values """ - UNKNOWN = "UNKNOWN" - PENDING = "PENDING" - RUNNING = "RUNNING" - FAILED = "FAILED" - COMPLETED = "COMPLETED" - ABORTED = "ABORTED" + UNKNOWN = 'UNKNOWN' + PENDING = 'PENDING' + RUNNING = 'RUNNING' + FAILED = 'FAILED' + COMPLETED = 'COMPLETED' + ABORTED = 'ABORTED' @classmethod def from_json(cls, json_str: str) -> Self: """Create an instance of DeploymentProvisioningInfoStageStatus from a JSON string""" return cls(json.loads(json_str)) + + diff --git a/koyeb/api/models/deployment_proxy_port.py b/koyeb/api/models/deployment_proxy_port.py index 581253d0..a18ef578 100644 --- a/koyeb/api/models/deployment_proxy_port.py +++ b/koyeb/api/models/deployment_proxy_port.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -22,31 +22,31 @@ from koyeb.api.models.proxy_port_protocol import ProxyPortProtocol from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class DeploymentProxyPort(BaseModel): """ DeploymentProxyPort - """ # noqa: E501 - + """ # noqa: E501 port: Optional[StrictInt] = None protocol: Optional[ProxyPortProtocol] = ProxyPortProtocol.TCP __properties: ClassVar[List[str]] = ["port", "protocol"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -63,7 +63,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -81,14 +82,10 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "port": obj.get("port"), - "protocol": ( - obj.get("protocol") - if obj.get("protocol") is not None - else ProxyPortProtocol.TCP - ), - } - ) + _obj = cls.model_validate({ + "port": obj.get("port"), + "protocol": obj.get("protocol") if obj.get("protocol") is not None else ProxyPortProtocol.TCP + }) return _obj + + diff --git a/koyeb/api/models/deployment_proxy_port_metadata.py b/koyeb/api/models/deployment_proxy_port_metadata.py index 66d4ca17..9e675c64 100644 --- a/koyeb/api/models/deployment_proxy_port_metadata.py +++ b/koyeb/api/models/deployment_proxy_port_metadata.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -22,13 +22,12 @@ from koyeb.api.models.proxy_port_protocol import ProxyPortProtocol from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class DeploymentProxyPortMetadata(BaseModel): """ DeploymentProxyPortMetadata - """ # noqa: E501 - + """ # noqa: E501 host: Optional[StrictStr] = None public_port: Optional[StrictInt] = None port: Optional[StrictInt] = None @@ -36,19 +35,20 @@ class DeploymentProxyPortMetadata(BaseModel): __properties: ClassVar[List[str]] = ["host", "public_port", "port", "protocol"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -65,7 +65,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -83,16 +84,12 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "host": obj.get("host"), - "public_port": obj.get("public_port"), - "port": obj.get("port"), - "protocol": ( - obj.get("protocol") - if obj.get("protocol") is not None - else ProxyPortProtocol.TCP - ), - } - ) + _obj = cls.model_validate({ + "host": obj.get("host"), + "public_port": obj.get("public_port"), + "port": obj.get("port"), + "protocol": obj.get("protocol") if obj.get("protocol") is not None else ProxyPortProtocol.TCP + }) return _obj + + diff --git a/koyeb/api/models/deployment_role.py b/koyeb/api/models/deployment_role.py index 1d3f5bd2..da8fe3d3 100644 --- a/koyeb/api/models/deployment_role.py +++ b/koyeb/api/models/deployment_role.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -26,12 +26,14 @@ class DeploymentRole(str, Enum): """ allowed enum values """ - INVALID = "INVALID" - ACTIVE = "ACTIVE" - UPCOMING = "UPCOMING" - CURRENT = "CURRENT" + INVALID = 'INVALID' + ACTIVE = 'ACTIVE' + UPCOMING = 'UPCOMING' + CURRENT = 'CURRENT' @classmethod def from_json(cls, json_str: str) -> Self: """Create an instance of DeploymentRole from a JSON string""" return cls(json.loads(json_str)) + + diff --git a/koyeb/api/models/deployment_route.py b/koyeb/api/models/deployment_route.py index bba58d67..948fdf30 100644 --- a/koyeb/api/models/deployment_route.py +++ b/koyeb/api/models/deployment_route.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -19,33 +19,35 @@ from pydantic import BaseModel, ConfigDict, StrictInt, StrictStr from typing import Any, ClassVar, Dict, List, Optional +from koyeb.api.models.security_policies import SecurityPolicies from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class DeploymentRoute(BaseModel): """ DeploymentRoute - """ # noqa: E501 - + """ # noqa: E501 port: Optional[StrictInt] = None path: Optional[StrictStr] = None - __properties: ClassVar[List[str]] = ["port", "path"] + security_policies: Optional[SecurityPolicies] = None + __properties: ClassVar[List[str]] = ["port", "path", "security_policies"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -62,13 +64,17 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, exclude=excluded_fields, exclude_none=True, ) + # override the default output from pydantic by calling `to_dict()` of security_policies + if self.security_policies: + _dict['security_policies'] = self.security_policies.to_dict() return _dict @classmethod @@ -80,5 +86,11 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({"port": obj.get("port"), "path": obj.get("path")}) + _obj = cls.model_validate({ + "port": obj.get("port"), + "path": obj.get("path"), + "security_policies": SecurityPolicies.from_dict(obj["security_policies"]) if obj.get("security_policies") is not None else None + }) return _obj + + diff --git a/koyeb/api/models/deployment_scaling.py b/koyeb/api/models/deployment_scaling.py index 9cd2596c..59729764 100644 --- a/koyeb/api/models/deployment_scaling.py +++ b/koyeb/api/models/deployment_scaling.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -22,13 +22,12 @@ from koyeb.api.models.deployment_scaling_target import DeploymentScalingTarget from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class DeploymentScaling(BaseModel): """ DeploymentScaling - """ # noqa: E501 - + """ # noqa: E501 scopes: Optional[List[StrictStr]] = None min: Optional[StrictInt] = None max: Optional[StrictInt] = None @@ -36,19 +35,20 @@ class DeploymentScaling(BaseModel): __properties: ClassVar[List[str]] = ["scopes", "min", "max", "targets"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -65,7 +65,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -78,7 +79,7 @@ def to_dict(self) -> Dict[str, Any]: for _item_targets in self.targets: if _item_targets: _items.append(_item_targets.to_dict()) - _dict["targets"] = _items + _dict['targets'] = _items return _dict @classmethod @@ -90,19 +91,12 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "scopes": obj.get("scopes"), - "min": obj.get("min"), - "max": obj.get("max"), - "targets": ( - [ - DeploymentScalingTarget.from_dict(_item) - for _item in obj["targets"] - ] - if obj.get("targets") is not None - else None - ), - } - ) + _obj = cls.model_validate({ + "scopes": obj.get("scopes"), + "min": obj.get("min"), + "max": obj.get("max"), + "targets": [DeploymentScalingTarget.from_dict(_item) for _item in obj["targets"]] if obj.get("targets") is not None else None + }) return _obj + + diff --git a/koyeb/api/models/deployment_scaling_target.py b/koyeb/api/models/deployment_scaling_target.py index e77e07b4..9c16b24a 100644 --- a/koyeb/api/models/deployment_scaling_target.py +++ b/koyeb/api/models/deployment_scaling_target.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -19,62 +19,43 @@ from pydantic import BaseModel, ConfigDict from typing import Any, ClassVar, Dict, List, Optional -from koyeb.api.models.deployment_scaling_target_average_cpu import ( - DeploymentScalingTargetAverageCPU, -) -from koyeb.api.models.deployment_scaling_target_average_mem import ( - DeploymentScalingTargetAverageMem, -) -from koyeb.api.models.deployment_scaling_target_concurrent_requests import ( - DeploymentScalingTargetConcurrentRequests, -) -from koyeb.api.models.deployment_scaling_target_requests_per_second import ( - DeploymentScalingTargetRequestsPerSecond, -) -from koyeb.api.models.deployment_scaling_target_requests_response_time import ( - DeploymentScalingTargetRequestsResponseTime, -) -from koyeb.api.models.deployment_scaling_target_sleep_idle_delay import ( - DeploymentScalingTargetSleepIdleDelay, -) +from koyeb.api.models.deployment_scaling_target_average_cpu import DeploymentScalingTargetAverageCPU +from koyeb.api.models.deployment_scaling_target_average_mem import DeploymentScalingTargetAverageMem +from koyeb.api.models.deployment_scaling_target_concurrent_requests import DeploymentScalingTargetConcurrentRequests +from koyeb.api.models.deployment_scaling_target_requests_per_second import DeploymentScalingTargetRequestsPerSecond +from koyeb.api.models.deployment_scaling_target_requests_response_time import DeploymentScalingTargetRequestsResponseTime +from koyeb.api.models.deployment_scaling_target_sleep_idle_delay import DeploymentScalingTargetSleepIdleDelay from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class DeploymentScalingTarget(BaseModel): """ DeploymentScalingTarget - """ # noqa: E501 - + """ # noqa: E501 average_cpu: Optional[DeploymentScalingTargetAverageCPU] = None average_mem: Optional[DeploymentScalingTargetAverageMem] = None requests_per_second: Optional[DeploymentScalingTargetRequestsPerSecond] = None concurrent_requests: Optional[DeploymentScalingTargetConcurrentRequests] = None requests_response_time: Optional[DeploymentScalingTargetRequestsResponseTime] = None sleep_idle_delay: Optional[DeploymentScalingTargetSleepIdleDelay] = None - __properties: ClassVar[List[str]] = [ - "average_cpu", - "average_mem", - "requests_per_second", - "concurrent_requests", - "requests_response_time", - "sleep_idle_delay", - ] + __properties: ClassVar[List[str]] = ["average_cpu", "average_mem", "requests_per_second", "concurrent_requests", "requests_response_time", "sleep_idle_delay"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -91,7 +72,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -100,22 +82,22 @@ def to_dict(self) -> Dict[str, Any]: ) # override the default output from pydantic by calling `to_dict()` of average_cpu if self.average_cpu: - _dict["average_cpu"] = self.average_cpu.to_dict() + _dict['average_cpu'] = self.average_cpu.to_dict() # override the default output from pydantic by calling `to_dict()` of average_mem if self.average_mem: - _dict["average_mem"] = self.average_mem.to_dict() + _dict['average_mem'] = self.average_mem.to_dict() # override the default output from pydantic by calling `to_dict()` of requests_per_second if self.requests_per_second: - _dict["requests_per_second"] = self.requests_per_second.to_dict() + _dict['requests_per_second'] = self.requests_per_second.to_dict() # override the default output from pydantic by calling `to_dict()` of concurrent_requests if self.concurrent_requests: - _dict["concurrent_requests"] = self.concurrent_requests.to_dict() + _dict['concurrent_requests'] = self.concurrent_requests.to_dict() # override the default output from pydantic by calling `to_dict()` of requests_response_time if self.requests_response_time: - _dict["requests_response_time"] = self.requests_response_time.to_dict() + _dict['requests_response_time'] = self.requests_response_time.to_dict() # override the default output from pydantic by calling `to_dict()` of sleep_idle_delay if self.sleep_idle_delay: - _dict["sleep_idle_delay"] = self.sleep_idle_delay.to_dict() + _dict['sleep_idle_delay'] = self.sleep_idle_delay.to_dict() return _dict @classmethod @@ -127,46 +109,14 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "average_cpu": ( - DeploymentScalingTargetAverageCPU.from_dict(obj["average_cpu"]) - if obj.get("average_cpu") is not None - else None - ), - "average_mem": ( - DeploymentScalingTargetAverageMem.from_dict(obj["average_mem"]) - if obj.get("average_mem") is not None - else None - ), - "requests_per_second": ( - DeploymentScalingTargetRequestsPerSecond.from_dict( - obj["requests_per_second"] - ) - if obj.get("requests_per_second") is not None - else None - ), - "concurrent_requests": ( - DeploymentScalingTargetConcurrentRequests.from_dict( - obj["concurrent_requests"] - ) - if obj.get("concurrent_requests") is not None - else None - ), - "requests_response_time": ( - DeploymentScalingTargetRequestsResponseTime.from_dict( - obj["requests_response_time"] - ) - if obj.get("requests_response_time") is not None - else None - ), - "sleep_idle_delay": ( - DeploymentScalingTargetSleepIdleDelay.from_dict( - obj["sleep_idle_delay"] - ) - if obj.get("sleep_idle_delay") is not None - else None - ), - } - ) + _obj = cls.model_validate({ + "average_cpu": DeploymentScalingTargetAverageCPU.from_dict(obj["average_cpu"]) if obj.get("average_cpu") is not None else None, + "average_mem": DeploymentScalingTargetAverageMem.from_dict(obj["average_mem"]) if obj.get("average_mem") is not None else None, + "requests_per_second": DeploymentScalingTargetRequestsPerSecond.from_dict(obj["requests_per_second"]) if obj.get("requests_per_second") is not None else None, + "concurrent_requests": DeploymentScalingTargetConcurrentRequests.from_dict(obj["concurrent_requests"]) if obj.get("concurrent_requests") is not None else None, + "requests_response_time": DeploymentScalingTargetRequestsResponseTime.from_dict(obj["requests_response_time"]) if obj.get("requests_response_time") is not None else None, + "sleep_idle_delay": DeploymentScalingTargetSleepIdleDelay.from_dict(obj["sleep_idle_delay"]) if obj.get("sleep_idle_delay") is not None else None + }) return _obj + + diff --git a/koyeb/api/models/deployment_scaling_target_average_cpu.py b/koyeb/api/models/deployment_scaling_target_average_cpu.py index 3b2648b4..5dd9efdb 100644 --- a/koyeb/api/models/deployment_scaling_target_average_cpu.py +++ b/koyeb/api/models/deployment_scaling_target_average_cpu.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -21,30 +21,30 @@ from typing import Any, ClassVar, Dict, List, Optional from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class DeploymentScalingTargetAverageCPU(BaseModel): """ DeploymentScalingTargetAverageCPU - """ # noqa: E501 - + """ # noqa: E501 value: Optional[StrictInt] = None __properties: ClassVar[List[str]] = ["value"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -61,7 +61,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -79,5 +80,9 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({"value": obj.get("value")}) + _obj = cls.model_validate({ + "value": obj.get("value") + }) return _obj + + diff --git a/koyeb/api/models/deployment_scaling_target_average_mem.py b/koyeb/api/models/deployment_scaling_target_average_mem.py index 8bcef090..f5e1e36a 100644 --- a/koyeb/api/models/deployment_scaling_target_average_mem.py +++ b/koyeb/api/models/deployment_scaling_target_average_mem.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -21,30 +21,30 @@ from typing import Any, ClassVar, Dict, List, Optional from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class DeploymentScalingTargetAverageMem(BaseModel): """ DeploymentScalingTargetAverageMem - """ # noqa: E501 - + """ # noqa: E501 value: Optional[StrictInt] = None __properties: ClassVar[List[str]] = ["value"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -61,7 +61,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -79,5 +80,9 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({"value": obj.get("value")}) + _obj = cls.model_validate({ + "value": obj.get("value") + }) return _obj + + diff --git a/koyeb/api/models/deployment_scaling_target_concurrent_requests.py b/koyeb/api/models/deployment_scaling_target_concurrent_requests.py index 12897b01..eb1e59a0 100644 --- a/koyeb/api/models/deployment_scaling_target_concurrent_requests.py +++ b/koyeb/api/models/deployment_scaling_target_concurrent_requests.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -21,30 +21,30 @@ from typing import Any, ClassVar, Dict, List, Optional from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class DeploymentScalingTargetConcurrentRequests(BaseModel): """ DeploymentScalingTargetConcurrentRequests - """ # noqa: E501 - + """ # noqa: E501 value: Optional[StrictInt] = None __properties: ClassVar[List[str]] = ["value"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -61,7 +61,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -79,5 +80,9 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({"value": obj.get("value")}) + _obj = cls.model_validate({ + "value": obj.get("value") + }) return _obj + + diff --git a/koyeb/api/models/deployment_scaling_target_requests_per_second.py b/koyeb/api/models/deployment_scaling_target_requests_per_second.py index 00166100..d2e602ef 100644 --- a/koyeb/api/models/deployment_scaling_target_requests_per_second.py +++ b/koyeb/api/models/deployment_scaling_target_requests_per_second.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -21,30 +21,30 @@ from typing import Any, ClassVar, Dict, List, Optional from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class DeploymentScalingTargetRequestsPerSecond(BaseModel): """ DeploymentScalingTargetRequestsPerSecond - """ # noqa: E501 - + """ # noqa: E501 value: Optional[StrictInt] = None __properties: ClassVar[List[str]] = ["value"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -61,7 +61,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -79,5 +80,9 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({"value": obj.get("value")}) + _obj = cls.model_validate({ + "value": obj.get("value") + }) return _obj + + diff --git a/koyeb/api/models/deployment_scaling_target_requests_response_time.py b/koyeb/api/models/deployment_scaling_target_requests_response_time.py index 5777a25a..f1c78121 100644 --- a/koyeb/api/models/deployment_scaling_target_requests_response_time.py +++ b/koyeb/api/models/deployment_scaling_target_requests_response_time.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -21,34 +21,31 @@ from typing import Any, ClassVar, Dict, List, Optional from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class DeploymentScalingTargetRequestsResponseTime(BaseModel): """ DeploymentScalingTargetRequestsResponseTime - """ # noqa: E501 - + """ # noqa: E501 value: Optional[StrictInt] = None - quantile: Optional[StrictInt] = Field( - default=None, - description="The quantile to use for autoscaling. For example, set to 95 to use the 95th percentile (p95) for autoscaling. Valid values are between 0 and 100.", - ) + quantile: Optional[StrictInt] = Field(default=None, description="The quantile to use for autoscaling. For example, set to 95 to use the 95th percentile (p95) for autoscaling. Valid values are between 0 and 100.") __properties: ClassVar[List[str]] = ["value", "quantile"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -65,7 +62,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -83,7 +81,10 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - {"value": obj.get("value"), "quantile": obj.get("quantile")} - ) + _obj = cls.model_validate({ + "value": obj.get("value"), + "quantile": obj.get("quantile") + }) return _obj + + diff --git a/koyeb/api/models/deployment_scaling_target_sleep_idle_delay.py b/koyeb/api/models/deployment_scaling_target_sleep_idle_delay.py index ede98372..2d131c68 100644 --- a/koyeb/api/models/deployment_scaling_target_sleep_idle_delay.py +++ b/koyeb/api/models/deployment_scaling_target_sleep_idle_delay.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -21,45 +21,32 @@ from typing import Any, ClassVar, Dict, List, Optional from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class DeploymentScalingTargetSleepIdleDelay(BaseModel): """ DeploymentScalingTargetSleepIdleDelay - """ # noqa: E501 - - value: Optional[StrictInt] = Field( - default=None, - description="DEPRECATED: use deep_sleep_value instead. Delay in seconds after which a service which received 0 request is put to deep sleep.", - ) - deep_sleep_value: Optional[StrictInt] = Field( - default=None, - description="Delay in seconds after which a service which received 0 request is put to deep sleep.", - ) - light_sleep_value: Optional[StrictInt] = Field( - default=None, - description="Delay in seconds after which a service which received 0 request is put to light sleep.", - ) - __properties: ClassVar[List[str]] = [ - "value", - "deep_sleep_value", - "light_sleep_value", - ] + """ # noqa: E501 + value: Optional[StrictInt] = Field(default=None, description="DEPRECATED: use deep_sleep_value instead. Delay in seconds after which a service which received 0 request is put to deep sleep.") + deep_sleep_value: Optional[StrictInt] = Field(default=None, description="Delay in seconds after which a service which received 0 request is put to deep sleep.") + light_sleep_value: Optional[StrictInt] = Field(default=None, description="Delay in seconds after which a service which received 0 request is put to light sleep.") + __properties: ClassVar[List[str]] = ["value", "deep_sleep_value", "light_sleep_value"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -76,7 +63,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -94,11 +82,11 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "value": obj.get("value"), - "deep_sleep_value": obj.get("deep_sleep_value"), - "light_sleep_value": obj.get("light_sleep_value"), - } - ) + _obj = cls.model_validate({ + "value": obj.get("value"), + "deep_sleep_value": obj.get("deep_sleep_value"), + "light_sleep_value": obj.get("light_sleep_value") + }) return _obj + + diff --git a/koyeb/api/models/deployment_status.py b/koyeb/api/models/deployment_status.py index 134ea181..ce4765e8 100644 --- a/koyeb/api/models/deployment_status.py +++ b/koyeb/api/models/deployment_status.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -26,24 +26,26 @@ class DeploymentStatus(str, Enum): """ allowed enum values """ - PENDING = "PENDING" - PROVISIONING = "PROVISIONING" - SCHEDULED = "SCHEDULED" - CANCELING = "CANCELING" - CANCELED = "CANCELED" - ALLOCATING = "ALLOCATING" - STARTING = "STARTING" - HEALTHY = "HEALTHY" - DEGRADED = "DEGRADED" - UNHEALTHY = "UNHEALTHY" - STOPPING = "STOPPING" - STOPPED = "STOPPED" - ERRORING = "ERRORING" - ERROR = "ERROR" - STASHED = "STASHED" - SLEEPING = "SLEEPING" + PENDING = 'PENDING' + PROVISIONING = 'PROVISIONING' + SCHEDULED = 'SCHEDULED' + CANCELING = 'CANCELING' + CANCELED = 'CANCELED' + ALLOCATING = 'ALLOCATING' + STARTING = 'STARTING' + HEALTHY = 'HEALTHY' + DEGRADED = 'DEGRADED' + UNHEALTHY = 'UNHEALTHY' + STOPPING = 'STOPPING' + STOPPED = 'STOPPED' + ERRORING = 'ERRORING' + ERROR = 'ERROR' + STASHED = 'STASHED' + SLEEPING = 'SLEEPING' @classmethod def from_json(cls, json_str: str) -> Self: """Create an instance of DeploymentStatus from a JSON string""" return cls(json.loads(json_str)) + + diff --git a/koyeb/api/models/deployment_strategy.py b/koyeb/api/models/deployment_strategy.py index c5de7c38..b1bd96d0 100644 --- a/koyeb/api/models/deployment_strategy.py +++ b/koyeb/api/models/deployment_strategy.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -22,32 +22,30 @@ from koyeb.api.models.deployment_strategy_type import DeploymentStrategyType from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class DeploymentStrategy(BaseModel): """ DeploymentStrategy - """ # noqa: E501 - - type: Optional[DeploymentStrategyType] = ( - DeploymentStrategyType.DEPLOYMENT_STRATEGY_TYPE_INVALID - ) + """ # noqa: E501 + type: Optional[DeploymentStrategyType] = DeploymentStrategyType.DEPLOYMENT_STRATEGY_TYPE_INVALID __properties: ClassVar[List[str]] = ["type"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -64,7 +62,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -82,13 +81,9 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "type": ( - obj.get("type") - if obj.get("type") is not None - else DeploymentStrategyType.DEPLOYMENT_STRATEGY_TYPE_INVALID - ) - } - ) + _obj = cls.model_validate({ + "type": obj.get("type") if obj.get("type") is not None else DeploymentStrategyType.DEPLOYMENT_STRATEGY_TYPE_INVALID + }) return _obj + + diff --git a/koyeb/api/models/deployment_strategy_type.py b/koyeb/api/models/deployment_strategy_type.py index 3d551315..34e4d106 100644 --- a/koyeb/api/models/deployment_strategy_type.py +++ b/koyeb/api/models/deployment_strategy_type.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -20,19 +20,22 @@ class DeploymentStrategyType(str, Enum): """ - - DEPLOYMENT_STRATEGY_TYPE_INVALID: Invalid / Zero value. - DEPLOYMENT_STRATEGY_TYPE_CANARY: Use canary strategy. - DEPLOYMENT_STRATEGY_TYPE_ROLLING: Use rolling strategy. - DEPLOYMENT_STRATEGY_TYPE_BLUE_GREEN: Use blue green strategy. - DEPLOYMENT_STRATEGY_TYPE_IMMEDIATE: Use immediate strategy. + - DEPLOYMENT_STRATEGY_TYPE_INVALID: DEPRECATED: Use DEPLOYMENT_STRATEGY_TYPE_DEFAULT instead. - DEPLOYMENT_STRATEGY_TYPE_DEFAULT: Default/unspecified strategy (resolves to platform default, currently ROLLING). - DEPLOYMENT_STRATEGY_TYPE_CANARY: Use canary strategy. - DEPLOYMENT_STRATEGY_TYPE_ROLLING: Use rolling strategy. - DEPLOYMENT_STRATEGY_TYPE_BLUE_GREEN: Use blue green strategy. - DEPLOYMENT_STRATEGY_TYPE_IMMEDIATE: Use immediate strategy. """ """ allowed enum values """ - DEPLOYMENT_STRATEGY_TYPE_INVALID = "DEPLOYMENT_STRATEGY_TYPE_INVALID" - DEPLOYMENT_STRATEGY_TYPE_CANARY = "DEPLOYMENT_STRATEGY_TYPE_CANARY" - DEPLOYMENT_STRATEGY_TYPE_ROLLING = "DEPLOYMENT_STRATEGY_TYPE_ROLLING" - DEPLOYMENT_STRATEGY_TYPE_BLUE_GREEN = "DEPLOYMENT_STRATEGY_TYPE_BLUE_GREEN" - DEPLOYMENT_STRATEGY_TYPE_IMMEDIATE = "DEPLOYMENT_STRATEGY_TYPE_IMMEDIATE" + DEPLOYMENT_STRATEGY_TYPE_INVALID = 'DEPLOYMENT_STRATEGY_TYPE_INVALID' + DEPLOYMENT_STRATEGY_TYPE_DEFAULT = 'DEPLOYMENT_STRATEGY_TYPE_DEFAULT' + DEPLOYMENT_STRATEGY_TYPE_CANARY = 'DEPLOYMENT_STRATEGY_TYPE_CANARY' + DEPLOYMENT_STRATEGY_TYPE_ROLLING = 'DEPLOYMENT_STRATEGY_TYPE_ROLLING' + DEPLOYMENT_STRATEGY_TYPE_BLUE_GREEN = 'DEPLOYMENT_STRATEGY_TYPE_BLUE_GREEN' + DEPLOYMENT_STRATEGY_TYPE_IMMEDIATE = 'DEPLOYMENT_STRATEGY_TYPE_IMMEDIATE' @classmethod def from_json(cls, json_str: str) -> Self: """Create an instance of DeploymentStrategyType from a JSON string""" return cls(json.loads(json_str)) + + diff --git a/koyeb/api/models/deployment_volume.py b/koyeb/api/models/deployment_volume.py index b90422ac..0a671f05 100644 --- a/koyeb/api/models/deployment_volume.py +++ b/koyeb/api/models/deployment_volume.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -21,13 +21,12 @@ from typing import Any, ClassVar, Dict, List, Optional from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class DeploymentVolume(BaseModel): """ DeploymentVolume - """ # noqa: E501 - + """ # noqa: E501 id: Optional[StrictStr] = None path: Optional[StrictStr] = None replica_index: Optional[StrictInt] = None @@ -35,19 +34,20 @@ class DeploymentVolume(BaseModel): __properties: ClassVar[List[str]] = ["id", "path", "replica_index", "scopes"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -64,7 +64,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -82,12 +83,12 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "id": obj.get("id"), - "path": obj.get("path"), - "replica_index": obj.get("replica_index"), - "scopes": obj.get("scopes"), - } - ) + _obj = cls.model_validate({ + "id": obj.get("id"), + "path": obj.get("path"), + "replica_index": obj.get("replica_index"), + "scopes": obj.get("scopes") + }) return _obj + + diff --git a/koyeb/api/models/desired_deployment.py b/koyeb/api/models/desired_deployment.py index 1fcf9fff..70ee050f 100644 --- a/koyeb/api/models/desired_deployment.py +++ b/koyeb/api/models/desired_deployment.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -22,30 +22,30 @@ from koyeb.api.models.desired_deployment_group import DesiredDeploymentGroup from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class DesiredDeployment(BaseModel): """ DesiredDeployment - """ # noqa: E501 - + """ # noqa: E501 groups: Optional[List[DesiredDeploymentGroup]] = None __properties: ClassVar[List[str]] = ["groups"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -62,7 +62,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -75,7 +76,7 @@ def to_dict(self) -> Dict[str, Any]: for _item_groups in self.groups: if _item_groups: _items.append(_item_groups.to_dict()) - _dict["groups"] = _items + _dict['groups'] = _items return _dict @classmethod @@ -87,13 +88,9 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "groups": ( - [DesiredDeploymentGroup.from_dict(_item) for _item in obj["groups"]] - if obj.get("groups") is not None - else None - ) - } - ) + _obj = cls.model_validate({ + "groups": [DesiredDeploymentGroup.from_dict(_item) for _item in obj["groups"]] if obj.get("groups") is not None else None + }) return _obj + + diff --git a/koyeb/api/models/desired_deployment_group.py b/koyeb/api/models/desired_deployment_group.py index 40e5a55e..ff32228b 100644 --- a/koyeb/api/models/desired_deployment_group.py +++ b/koyeb/api/models/desired_deployment_group.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -21,31 +21,31 @@ from typing import Any, ClassVar, Dict, List, Optional from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class DesiredDeploymentGroup(BaseModel): """ DesiredDeploymentGroup - """ # noqa: E501 - + """ # noqa: E501 name: Optional[StrictStr] = None deployment_ids: Optional[List[StrictStr]] = None __properties: ClassVar[List[str]] = ["name", "deployment_ids"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -62,7 +62,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -80,7 +81,10 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - {"name": obj.get("name"), "deployment_ids": obj.get("deployment_ids")} - ) + _obj = cls.model_validate({ + "name": obj.get("name"), + "deployment_ids": obj.get("deployment_ids") + }) return _obj + + diff --git a/koyeb/api/models/digital_ocean_registry_configuration.py b/koyeb/api/models/digital_ocean_registry_configuration.py index 03895931..655cb1bb 100644 --- a/koyeb/api/models/digital_ocean_registry_configuration.py +++ b/koyeb/api/models/digital_ocean_registry_configuration.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -21,31 +21,31 @@ from typing import Any, ClassVar, Dict, List, Optional from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class DigitalOceanRegistryConfiguration(BaseModel): """ DigitalOceanRegistryConfiguration - """ # noqa: E501 - + """ # noqa: E501 username: Optional[StrictStr] = None password: Optional[StrictStr] = None __properties: ClassVar[List[str]] = ["username", "password"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -62,7 +62,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -80,7 +81,10 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - {"username": obj.get("username"), "password": obj.get("password")} - ) + _obj = cls.model_validate({ + "username": obj.get("username"), + "password": obj.get("password") + }) return _obj + + diff --git a/koyeb/api/models/discourse_auth_reply.py b/koyeb/api/models/discourse_auth_reply.py index a7358113..222a7321 100644 --- a/koyeb/api/models/discourse_auth_reply.py +++ b/koyeb/api/models/discourse_auth_reply.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -21,31 +21,31 @@ from typing import Any, ClassVar, Dict, List, Optional from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class DiscourseAuthReply(BaseModel): """ DiscourseAuthReply - """ # noqa: E501 - + """ # noqa: E501 sso: Optional[StrictStr] = None sig: Optional[StrictStr] = None __properties: ClassVar[List[str]] = ["sso", "sig"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -62,7 +62,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -80,5 +81,10 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({"sso": obj.get("sso"), "sig": obj.get("sig")}) + _obj = cls.model_validate({ + "sso": obj.get("sso"), + "sig": obj.get("sig") + }) return _obj + + diff --git a/koyeb/api/models/discourse_auth_request.py b/koyeb/api/models/discourse_auth_request.py index 7dc95273..ee511966 100644 --- a/koyeb/api/models/discourse_auth_request.py +++ b/koyeb/api/models/discourse_auth_request.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -21,31 +21,31 @@ from typing import Any, ClassVar, Dict, List, Optional from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class DiscourseAuthRequest(BaseModel): """ DiscourseAuthRequest - """ # noqa: E501 - + """ # noqa: E501 payload: Optional[StrictStr] = None sig: Optional[StrictStr] = None __properties: ClassVar[List[str]] = ["payload", "sig"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -62,7 +62,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -80,7 +81,10 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - {"payload": obj.get("payload"), "sig": obj.get("sig")} - ) + _obj = cls.model_validate({ + "payload": obj.get("payload"), + "sig": obj.get("sig") + }) return _obj + + diff --git a/koyeb/api/models/docker_builder.py b/koyeb/api/models/docker_builder.py index 544abc04..008cec1a 100644 --- a/koyeb/api/models/docker_builder.py +++ b/koyeb/api/models/docker_builder.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -21,42 +21,35 @@ from typing import Any, ClassVar, Dict, List, Optional from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class DockerBuilder(BaseModel): """ DockerBuilder - """ # noqa: E501 - + """ # noqa: E501 dockerfile: Optional[StrictStr] = None entrypoint: Optional[List[StrictStr]] = None command: Optional[StrictStr] = None args: Optional[List[StrictStr]] = None target: Optional[StrictStr] = None privileged: Optional[StrictBool] = None - __properties: ClassVar[List[str]] = [ - "dockerfile", - "entrypoint", - "command", - "args", - "target", - "privileged", - ] + __properties: ClassVar[List[str]] = ["dockerfile", "entrypoint", "command", "args", "target", "privileged"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -73,7 +66,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -91,14 +85,14 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "dockerfile": obj.get("dockerfile"), - "entrypoint": obj.get("entrypoint"), - "command": obj.get("command"), - "args": obj.get("args"), - "target": obj.get("target"), - "privileged": obj.get("privileged"), - } - ) + _obj = cls.model_validate({ + "dockerfile": obj.get("dockerfile"), + "entrypoint": obj.get("entrypoint"), + "command": obj.get("command"), + "args": obj.get("args"), + "target": obj.get("target"), + "privileged": obj.get("privileged") + }) return _obj + + diff --git a/koyeb/api/models/docker_hub_registry_configuration.py b/koyeb/api/models/docker_hub_registry_configuration.py index 305a0f1e..1e3d6c45 100644 --- a/koyeb/api/models/docker_hub_registry_configuration.py +++ b/koyeb/api/models/docker_hub_registry_configuration.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -21,31 +21,31 @@ from typing import Any, ClassVar, Dict, List, Optional from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class DockerHubRegistryConfiguration(BaseModel): """ DockerHubRegistryConfiguration - """ # noqa: E501 - + """ # noqa: E501 username: Optional[StrictStr] = None password: Optional[StrictStr] = None __properties: ClassVar[List[str]] = ["username", "password"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -62,7 +62,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -80,7 +81,10 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - {"username": obj.get("username"), "password": obj.get("password")} - ) + _obj = cls.model_validate({ + "username": obj.get("username"), + "password": obj.get("password") + }) return _obj + + diff --git a/koyeb/api/models/docker_source.py b/koyeb/api/models/docker_source.py index b3ca771e..1ed042d9 100644 --- a/koyeb/api/models/docker_source.py +++ b/koyeb/api/models/docker_source.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -21,42 +21,35 @@ from typing import Any, ClassVar, Dict, List, Optional from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class DockerSource(BaseModel): """ DockerSource - """ # noqa: E501 - + """ # noqa: E501 image: Optional[StrictStr] = None command: Optional[StrictStr] = None args: Optional[List[StrictStr]] = None image_registry_secret: Optional[StrictStr] = None entrypoint: Optional[List[StrictStr]] = None privileged: Optional[StrictBool] = None - __properties: ClassVar[List[str]] = [ - "image", - "command", - "args", - "image_registry_secret", - "entrypoint", - "privileged", - ] + __properties: ClassVar[List[str]] = ["image", "command", "args", "image_registry_secret", "entrypoint", "privileged"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -73,7 +66,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -91,14 +85,14 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "image": obj.get("image"), - "command": obj.get("command"), - "args": obj.get("args"), - "image_registry_secret": obj.get("image_registry_secret"), - "entrypoint": obj.get("entrypoint"), - "privileged": obj.get("privileged"), - } - ) + _obj = cls.model_validate({ + "image": obj.get("image"), + "command": obj.get("command"), + "args": obj.get("args"), + "image_registry_secret": obj.get("image_registry_secret"), + "entrypoint": obj.get("entrypoint"), + "privileged": obj.get("privileged") + }) return _obj + + diff --git a/koyeb/api/models/domain.py b/koyeb/api/models/domain.py index 8f39f68d..9c1101ee 100644 --- a/koyeb/api/models/domain.py +++ b/koyeb/api/models/domain.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -18,20 +18,19 @@ import json from datetime import datetime -from pydantic import BaseModel, ConfigDict, StrictStr +from pydantic import BaseModel, ConfigDict, Field, StrictStr from typing import Any, ClassVar, Dict, List, Optional from koyeb.api.models.domain_load_balancer_koyeb import DomainLoadBalancerKoyeb from koyeb.api.models.domain_status import DomainStatus from koyeb.api.models.domain_type import DomainType from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class Domain(BaseModel): """ Domain - """ # noqa: E501 - + """ # noqa: E501 id: Optional[StrictStr] = None organization_id: Optional[StrictStr] = None name: Optional[StrictStr] = None @@ -47,38 +46,24 @@ class Domain(BaseModel): version: Optional[StrictStr] = None cloudflare: Optional[Dict[str, Any]] = None koyeb: Optional[DomainLoadBalancerKoyeb] = None - __properties: ClassVar[List[str]] = [ - "id", - "organization_id", - "name", - "created_at", - "updated_at", - "status", - "type", - "app_id", - "deployment_group", - "verified_at", - "intended_cname", - "messages", - "version", - "cloudflare", - "koyeb", - ] + project_id: Optional[StrictStr] = Field(default=None, description="The project ID this domain belongs to. Empty if the domain is organization-level.") + __properties: ClassVar[List[str]] = ["id", "organization_id", "name", "created_at", "updated_at", "status", "type", "app_id", "deployment_group", "verified_at", "intended_cname", "messages", "version", "cloudflare", "koyeb", "project_id"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -95,7 +80,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -104,7 +90,7 @@ def to_dict(self) -> Dict[str, Any]: ) # override the default output from pydantic by calling `to_dict()` of koyeb if self.koyeb: - _dict["koyeb"] = self.koyeb.to_dict() + _dict['koyeb'] = self.koyeb.to_dict() return _dict @classmethod @@ -116,35 +102,24 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "id": obj.get("id"), - "organization_id": obj.get("organization_id"), - "name": obj.get("name"), - "created_at": obj.get("created_at"), - "updated_at": obj.get("updated_at"), - "status": ( - obj.get("status") - if obj.get("status") is not None - else DomainStatus.PENDING - ), - "type": ( - obj.get("type") - if obj.get("type") is not None - else DomainType.AUTOASSIGNED - ), - "app_id": obj.get("app_id"), - "deployment_group": obj.get("deployment_group"), - "verified_at": obj.get("verified_at"), - "intended_cname": obj.get("intended_cname"), - "messages": obj.get("messages"), - "version": obj.get("version"), - "cloudflare": obj.get("cloudflare"), - "koyeb": ( - DomainLoadBalancerKoyeb.from_dict(obj["koyeb"]) - if obj.get("koyeb") is not None - else None - ), - } - ) + _obj = cls.model_validate({ + "id": obj.get("id"), + "organization_id": obj.get("organization_id"), + "name": obj.get("name"), + "created_at": obj.get("created_at"), + "updated_at": obj.get("updated_at"), + "status": obj.get("status") if obj.get("status") is not None else DomainStatus.PENDING, + "type": obj.get("type") if obj.get("type") is not None else DomainType.AUTOASSIGNED, + "app_id": obj.get("app_id"), + "deployment_group": obj.get("deployment_group"), + "verified_at": obj.get("verified_at"), + "intended_cname": obj.get("intended_cname"), + "messages": obj.get("messages"), + "version": obj.get("version"), + "cloudflare": obj.get("cloudflare"), + "koyeb": DomainLoadBalancerKoyeb.from_dict(obj["koyeb"]) if obj.get("koyeb") is not None else None, + "project_id": obj.get("project_id") + }) return _obj + + diff --git a/koyeb/api/models/domain_load_balancer_koyeb.py b/koyeb/api/models/domain_load_balancer_koyeb.py index 034c4d1d..a3b2a3f1 100644 --- a/koyeb/api/models/domain_load_balancer_koyeb.py +++ b/koyeb/api/models/domain_load_balancer_koyeb.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -21,30 +21,30 @@ from typing import Any, ClassVar, Dict, List, Optional from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class DomainLoadBalancerKoyeb(BaseModel): """ DomainLoadBalancerKoyeb - """ # noqa: E501 - + """ # noqa: E501 request_timeout_seconds: Optional[StrictInt] = None __properties: ClassVar[List[str]] = ["request_timeout_seconds"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -61,7 +61,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -79,7 +80,9 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - {"request_timeout_seconds": obj.get("request_timeout_seconds")} - ) + _obj = cls.model_validate({ + "request_timeout_seconds": obj.get("request_timeout_seconds") + }) return _obj + + diff --git a/koyeb/api/models/domain_load_balancer_quotas.py b/koyeb/api/models/domain_load_balancer_quotas.py index 09a2fd89..4a16fea9 100644 --- a/koyeb/api/models/domain_load_balancer_quotas.py +++ b/koyeb/api/models/domain_load_balancer_quotas.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -21,30 +21,30 @@ from typing import Any, ClassVar, Dict, List, Optional from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class DomainLoadBalancerQuotas(BaseModel): """ DomainLoadBalancerQuotas - """ # noqa: E501 - + """ # noqa: E501 max_koyeb: Optional[StrictInt] = None __properties: ClassVar[List[str]] = ["max_koyeb"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -61,7 +61,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -79,5 +80,9 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({"max_koyeb": obj.get("max_koyeb")}) + _obj = cls.model_validate({ + "max_koyeb": obj.get("max_koyeb") + }) return _obj + + diff --git a/koyeb/api/models/domain_status.py b/koyeb/api/models/domain_status.py index e05ed638..1f441933 100644 --- a/koyeb/api/models/domain_status.py +++ b/koyeb/api/models/domain_status.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -26,13 +26,15 @@ class DomainStatus(str, Enum): """ allowed enum values """ - PENDING = "PENDING" - ACTIVE = "ACTIVE" - ERROR = "ERROR" - DELETING = "DELETING" - DELETED = "DELETED" + PENDING = 'PENDING' + ACTIVE = 'ACTIVE' + ERROR = 'ERROR' + DELETING = 'DELETING' + DELETED = 'DELETED' @classmethod def from_json(cls, json_str: str) -> Self: """Create an instance of DomainStatus from a JSON string""" return cls(json.loads(json_str)) + + diff --git a/koyeb/api/models/domain_type.py b/koyeb/api/models/domain_type.py index f76c076e..6ea6ca50 100644 --- a/koyeb/api/models/domain_type.py +++ b/koyeb/api/models/domain_type.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -26,10 +26,12 @@ class DomainType(str, Enum): """ allowed enum values """ - AUTOASSIGNED = "AUTOASSIGNED" - CUSTOM = "CUSTOM" + AUTOASSIGNED = 'AUTOASSIGNED' + CUSTOM = 'CUSTOM' @classmethod def from_json(cls, json_str: str) -> Self: """Create an instance of DomainType from a JSON string""" return cls(json.loads(json_str)) + + diff --git a/koyeb/api/models/domains_summary.py b/koyeb/api/models/domains_summary.py index 6305158d..6c569af5 100644 --- a/koyeb/api/models/domains_summary.py +++ b/koyeb/api/models/domains_summary.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -21,31 +21,31 @@ from typing import Any, ClassVar, Dict, List, Optional from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class DomainsSummary(BaseModel): """ DomainsSummary - """ # noqa: E501 - + """ # noqa: E501 total: Optional[StrictStr] = None by_status: Optional[Dict[str, StrictStr]] = None __properties: ClassVar[List[str]] = ["total", "by_status"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -62,7 +62,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -80,7 +81,10 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - {"total": obj.get("total"), "by_status": obj.get("by_status")} - ) + _obj = cls.model_validate({ + "total": obj.get("total"), + "by_status": obj.get("by_status") + }) return _obj + + diff --git a/koyeb/api/models/env.py b/koyeb/api/models/env.py index 9ec5425c..4f05c55d 100644 --- a/koyeb/api/models/env.py +++ b/koyeb/api/models/env.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -21,32 +21,32 @@ from typing import Any, ClassVar, Dict, List, Optional from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class Env(BaseModel): """ Env - """ # noqa: E501 - + """ # noqa: E501 key: Optional[StrictStr] = None value: Optional[StrictStr] = None secret: Optional[StrictStr] = None __properties: ClassVar[List[str]] = ["key", "value", "secret"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -63,7 +63,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -81,11 +82,11 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "key": obj.get("key"), - "value": obj.get("value"), - "secret": obj.get("secret"), - } - ) + _obj = cls.model_validate({ + "key": obj.get("key"), + "value": obj.get("value"), + "secret": obj.get("secret") + }) return _obj + + diff --git a/koyeb/api/models/error.py b/koyeb/api/models/error.py index 18c60e6a..a7c14eae 100644 --- a/koyeb/api/models/error.py +++ b/koyeb/api/models/error.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -21,32 +21,32 @@ from typing import Any, ClassVar, Dict, List, Optional from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class Error(BaseModel): """ Error - """ # noqa: E501 - + """ # noqa: E501 status: Optional[StrictInt] = None code: Optional[StrictStr] = None message: Optional[StrictStr] = None __properties: ClassVar[List[str]] = ["status", "code", "message"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -63,7 +63,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -81,11 +82,11 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "status": obj.get("status"), - "code": obj.get("code"), - "message": obj.get("message"), - } - ) + _obj = cls.model_validate({ + "status": obj.get("status"), + "code": obj.get("code"), + "message": obj.get("message") + }) return _obj + + diff --git a/koyeb/api/models/error_field.py b/koyeb/api/models/error_field.py index 776fa9bf..0672a721 100644 --- a/koyeb/api/models/error_field.py +++ b/koyeb/api/models/error_field.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -21,31 +21,31 @@ from typing import Any, ClassVar, Dict, List, Optional from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class ErrorField(BaseModel): """ ErrorField - """ # noqa: E501 - + """ # noqa: E501 var_field: Optional[StrictStr] = Field(default=None, alias="field") description: Optional[StrictStr] = None __properties: ClassVar[List[str]] = ["field", "description"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -62,7 +62,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -80,7 +81,10 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - {"field": obj.get("field"), "description": obj.get("description")} - ) + _obj = cls.model_validate({ + "field": obj.get("field"), + "description": obj.get("description") + }) return _obj + + diff --git a/koyeb/api/models/error_with_fields.py b/koyeb/api/models/error_with_fields.py index 91aad573..40991b74 100644 --- a/koyeb/api/models/error_with_fields.py +++ b/koyeb/api/models/error_with_fields.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -22,13 +22,12 @@ from koyeb.api.models.error_field import ErrorField from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class ErrorWithFields(BaseModel): """ ErrorWithFields - """ # noqa: E501 - + """ # noqa: E501 status: Optional[StrictInt] = None code: Optional[StrictStr] = None message: Optional[StrictStr] = None @@ -36,19 +35,20 @@ class ErrorWithFields(BaseModel): __properties: ClassVar[List[str]] = ["status", "code", "message", "fields"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -65,7 +65,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -78,7 +79,7 @@ def to_dict(self) -> Dict[str, Any]: for _item_fields in self.fields: if _item_fields: _items.append(_item_fields.to_dict()) - _dict["fields"] = _items + _dict['fields'] = _items return _dict @classmethod @@ -90,16 +91,12 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "status": obj.get("status"), - "code": obj.get("code"), - "message": obj.get("message"), - "fields": ( - [ErrorField.from_dict(_item) for _item in obj["fields"]] - if obj.get("fields") is not None - else None - ), - } - ) + _obj = cls.model_validate({ + "status": obj.get("status"), + "code": obj.get("code"), + "message": obj.get("message"), + "fields": [ErrorField.from_dict(_item) for _item in obj["fields"]] if obj.get("fields") is not None else None + }) return _obj + + diff --git a/koyeb/api/models/exec_command_io.py b/koyeb/api/models/exec_command_io.py index de37cbec..56e374f7 100644 --- a/koyeb/api/models/exec_command_io.py +++ b/koyeb/api/models/exec_command_io.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -22,50 +22,41 @@ from typing_extensions import Annotated from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class ExecCommandIO(BaseModel): """ ExecCommandIO - """ # noqa: E501 - - data: Optional[ - Union[Annotated[bytes, Field(strict=True)], Annotated[str, Field(strict=True)]] - ] = Field(default=None, description="Data is base64 encoded") - close: Optional[StrictBool] = Field( - default=None, description="Indicate last data frame" - ) + """ # noqa: E501 + data: Optional[Union[Annotated[bytes, Field(strict=True)], Annotated[str, Field(strict=True)]]] = Field(default=None, description="Data is base64 encoded") + close: Optional[StrictBool] = Field(default=None, description="Indicate last data frame") __properties: ClassVar[List[str]] = ["data", "close"] - @field_validator("data") + @field_validator('data') def data_validate_regular_expression(cls, value): """Validates the regular expression""" if value is None: return value - if not re.match( - r"^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$", - value, - ): - raise ValueError( - r"must validate the regular expression /^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/" - ) + if not re.match(r"^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$", value): + raise ValueError(r"must validate the regular expression /^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/") return value model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -82,7 +73,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -100,5 +92,10 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({"data": obj.get("data"), "close": obj.get("close")}) + _obj = cls.model_validate({ + "data": obj.get("data"), + "close": obj.get("close") + }) return _obj + + diff --git a/koyeb/api/models/exec_command_reply.py b/koyeb/api/models/exec_command_reply.py index 77264cb5..4b386cc4 100644 --- a/koyeb/api/models/exec_command_reply.py +++ b/koyeb/api/models/exec_command_reply.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -22,13 +22,12 @@ from koyeb.api.models.exec_command_io import ExecCommandIO from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class ExecCommandReply(BaseModel): """ ExecCommandReply - """ # noqa: E501 - + """ # noqa: E501 stdout: Optional[ExecCommandIO] = None stderr: Optional[ExecCommandIO] = None exited: Optional[StrictBool] = None @@ -36,19 +35,20 @@ class ExecCommandReply(BaseModel): __properties: ClassVar[List[str]] = ["stdout", "stderr", "exited", "exit_code"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -65,7 +65,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -74,10 +75,10 @@ def to_dict(self) -> Dict[str, Any]: ) # override the default output from pydantic by calling `to_dict()` of stdout if self.stdout: - _dict["stdout"] = self.stdout.to_dict() + _dict['stdout'] = self.stdout.to_dict() # override the default output from pydantic by calling `to_dict()` of stderr if self.stderr: - _dict["stderr"] = self.stderr.to_dict() + _dict['stderr'] = self.stderr.to_dict() return _dict @classmethod @@ -89,20 +90,12 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "stdout": ( - ExecCommandIO.from_dict(obj["stdout"]) - if obj.get("stdout") is not None - else None - ), - "stderr": ( - ExecCommandIO.from_dict(obj["stderr"]) - if obj.get("stderr") is not None - else None - ), - "exited": obj.get("exited"), - "exit_code": obj.get("exit_code"), - } - ) + _obj = cls.model_validate({ + "stdout": ExecCommandIO.from_dict(obj["stdout"]) if obj.get("stdout") is not None else None, + "stderr": ExecCommandIO.from_dict(obj["stderr"]) if obj.get("stderr") is not None else None, + "exited": obj.get("exited"), + "exit_code": obj.get("exit_code") + }) return _obj + + diff --git a/koyeb/api/models/exec_command_request_body.py b/koyeb/api/models/exec_command_request_body.py index 4b930cd4..25257ae2 100644 --- a/koyeb/api/models/exec_command_request_body.py +++ b/koyeb/api/models/exec_command_request_body.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -20,44 +20,36 @@ from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr from typing import Any, ClassVar, Dict, List, Optional from koyeb.api.models.exec_command_io import ExecCommandIO -from koyeb.api.models.exec_command_request_terminal_size import ( - ExecCommandRequestTerminalSize, -) +from koyeb.api.models.exec_command_request_terminal_size import ExecCommandRequestTerminalSize from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class ExecCommandRequestBody(BaseModel): """ ExecCommandRequestBody - """ # noqa: E501 - - command: Optional[List[StrictStr]] = Field( - default=None, description="Command to exec. Mandatory in the first frame sent" - ) + """ # noqa: E501 + command: Optional[List[StrictStr]] = Field(default=None, description="Command to exec. Mandatory in the first frame sent") tty_size: Optional[ExecCommandRequestTerminalSize] = None stdin: Optional[ExecCommandIO] = None - disable_tty: Optional[StrictBool] = Field( - default=None, - description="Disable TTY. It's enough to specify it in the first frame", - alias="disableTty", - ) + disable_tty: Optional[StrictBool] = Field(default=None, description="Disable TTY. It's enough to specify it in the first frame", alias="disableTty") __properties: ClassVar[List[str]] = ["command", "tty_size", "stdin", "disableTty"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -74,7 +66,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -83,10 +76,10 @@ def to_dict(self) -> Dict[str, Any]: ) # override the default output from pydantic by calling `to_dict()` of tty_size if self.tty_size: - _dict["tty_size"] = self.tty_size.to_dict() + _dict['tty_size'] = self.tty_size.to_dict() # override the default output from pydantic by calling `to_dict()` of stdin if self.stdin: - _dict["stdin"] = self.stdin.to_dict() + _dict['stdin'] = self.stdin.to_dict() return _dict @classmethod @@ -98,20 +91,12 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "command": obj.get("command"), - "tty_size": ( - ExecCommandRequestTerminalSize.from_dict(obj["tty_size"]) - if obj.get("tty_size") is not None - else None - ), - "stdin": ( - ExecCommandIO.from_dict(obj["stdin"]) - if obj.get("stdin") is not None - else None - ), - "disableTty": obj.get("disableTty"), - } - ) + _obj = cls.model_validate({ + "command": obj.get("command"), + "tty_size": ExecCommandRequestTerminalSize.from_dict(obj["tty_size"]) if obj.get("tty_size") is not None else None, + "stdin": ExecCommandIO.from_dict(obj["stdin"]) if obj.get("stdin") is not None else None, + "disableTty": obj.get("disableTty") + }) return _obj + + diff --git a/koyeb/api/models/exec_command_request_id_type.py b/koyeb/api/models/exec_command_request_id_type.py index c7e45305..9893c9dc 100644 --- a/koyeb/api/models/exec_command_request_id_type.py +++ b/koyeb/api/models/exec_command_request_id_type.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -26,11 +26,13 @@ class ExecCommandRequestIdType(str, Enum): """ allowed enum values """ - INVALID = "INVALID" - INSTANCE_ID = "INSTANCE_ID" - SERVICE_ID = "SERVICE_ID" + INVALID = 'INVALID' + INSTANCE_ID = 'INSTANCE_ID' + SERVICE_ID = 'SERVICE_ID' @classmethod def from_json(cls, json_str: str) -> Self: """Create an instance of ExecCommandRequestIdType from a JSON string""" return cls(json.loads(json_str)) + + diff --git a/koyeb/api/models/exec_command_request_terminal_size.py b/koyeb/api/models/exec_command_request_terminal_size.py index 2b634a0d..c0834f4d 100644 --- a/koyeb/api/models/exec_command_request_terminal_size.py +++ b/koyeb/api/models/exec_command_request_terminal_size.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -21,31 +21,31 @@ from typing import Any, ClassVar, Dict, List, Optional from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class ExecCommandRequestTerminalSize(BaseModel): """ ExecCommandRequestTerminalSize - """ # noqa: E501 - + """ # noqa: E501 height: Optional[StrictInt] = None width: Optional[StrictInt] = None __properties: ClassVar[List[str]] = ["height", "width"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -62,7 +62,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -80,7 +81,10 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - {"height": obj.get("height"), "width": obj.get("width")} - ) + _obj = cls.model_validate({ + "height": obj.get("height"), + "width": obj.get("width") + }) return _obj + + diff --git a/koyeb/api/models/gcp_container_registry_configuration.py b/koyeb/api/models/gcp_container_registry_configuration.py index 4341c857..2afa4c13 100644 --- a/koyeb/api/models/gcp_container_registry_configuration.py +++ b/koyeb/api/models/gcp_container_registry_configuration.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -21,31 +21,31 @@ from typing import Any, ClassVar, Dict, List, Optional from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class GCPContainerRegistryConfiguration(BaseModel): """ GCPContainerRegistryConfiguration - """ # noqa: E501 - + """ # noqa: E501 keyfile_content: Optional[StrictStr] = None url: Optional[StrictStr] = None __properties: ClassVar[List[str]] = ["keyfile_content", "url"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -62,7 +62,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -80,7 +81,10 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - {"keyfile_content": obj.get("keyfile_content"), "url": obj.get("url")} - ) + _obj = cls.model_validate({ + "keyfile_content": obj.get("keyfile_content"), + "url": obj.get("url") + }) return _obj + + diff --git a/koyeb/api/models/get_app_reply.py b/koyeb/api/models/get_app_reply.py index 315d6068..62077d85 100644 --- a/koyeb/api/models/get_app_reply.py +++ b/koyeb/api/models/get_app_reply.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -22,30 +22,30 @@ from koyeb.api.models.app import App from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class GetAppReply(BaseModel): """ GetAppReply - """ # noqa: E501 - + """ # noqa: E501 app: Optional[App] = None __properties: ClassVar[List[str]] = ["app"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -62,7 +62,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -71,7 +72,7 @@ def to_dict(self) -> Dict[str, Any]: ) # override the default output from pydantic by calling `to_dict()` of app if self.app: - _dict["app"] = self.app.to_dict() + _dict['app'] = self.app.to_dict() return _dict @classmethod @@ -83,7 +84,9 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - {"app": App.from_dict(obj["app"]) if obj.get("app") is not None else None} - ) + _obj = cls.model_validate({ + "app": App.from_dict(obj["app"]) if obj.get("app") is not None else None + }) return _obj + + diff --git a/koyeb/api/models/get_budget_reply.py b/koyeb/api/models/get_budget_reply.py index 725427ef..23d21ec8 100644 --- a/koyeb/api/models/get_budget_reply.py +++ b/koyeb/api/models/get_budget_reply.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -22,30 +22,30 @@ from koyeb.api.models.budget import Budget from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class GetBudgetReply(BaseModel): """ GetBudgetReply - """ # noqa: E501 - + """ # noqa: E501 budget: Optional[Budget] = None __properties: ClassVar[List[str]] = ["budget"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -62,7 +62,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -71,7 +72,7 @@ def to_dict(self) -> Dict[str, Any]: ) # override the default output from pydantic by calling `to_dict()` of budget if self.budget: - _dict["budget"] = self.budget.to_dict() + _dict['budget'] = self.budget.to_dict() return _dict @classmethod @@ -83,13 +84,9 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "budget": ( - Budget.from_dict(obj["budget"]) - if obj.get("budget") is not None - else None - ) - } - ) + _obj = cls.model_validate({ + "budget": Budget.from_dict(obj["budget"]) if obj.get("budget") is not None else None + }) return _obj + + diff --git a/koyeb/api/models/get_catalog_instance_reply.py b/koyeb/api/models/get_catalog_instance_reply.py index dd8fb2bb..ae39eec1 100644 --- a/koyeb/api/models/get_catalog_instance_reply.py +++ b/koyeb/api/models/get_catalog_instance_reply.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -22,30 +22,30 @@ from koyeb.api.models.catalog_instance import CatalogInstance from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class GetCatalogInstanceReply(BaseModel): """ GetCatalogInstanceReply - """ # noqa: E501 - + """ # noqa: E501 instance: Optional[CatalogInstance] = None __properties: ClassVar[List[str]] = ["instance"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -62,7 +62,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -71,7 +72,7 @@ def to_dict(self) -> Dict[str, Any]: ) # override the default output from pydantic by calling `to_dict()` of instance if self.instance: - _dict["instance"] = self.instance.to_dict() + _dict['instance'] = self.instance.to_dict() return _dict @classmethod @@ -83,13 +84,9 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "instance": ( - CatalogInstance.from_dict(obj["instance"]) - if obj.get("instance") is not None - else None - ) - } - ) + _obj = cls.model_validate({ + "instance": CatalogInstance.from_dict(obj["instance"]) if obj.get("instance") is not None else None + }) return _obj + + diff --git a/koyeb/api/models/get_credential_reply.py b/koyeb/api/models/get_credential_reply.py index 35d351b5..ce85864e 100644 --- a/koyeb/api/models/get_credential_reply.py +++ b/koyeb/api/models/get_credential_reply.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -22,30 +22,30 @@ from koyeb.api.models.credential import Credential from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class GetCredentialReply(BaseModel): """ GetCredentialReply - """ # noqa: E501 - + """ # noqa: E501 credential: Optional[Credential] = None __properties: ClassVar[List[str]] = ["credential"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -62,7 +62,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -71,7 +72,7 @@ def to_dict(self) -> Dict[str, Any]: ) # override the default output from pydantic by calling `to_dict()` of credential if self.credential: - _dict["credential"] = self.credential.to_dict() + _dict['credential'] = self.credential.to_dict() return _dict @classmethod @@ -83,13 +84,9 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "credential": ( - Credential.from_dict(obj["credential"]) - if obj.get("credential") is not None - else None - ) - } - ) + _obj = cls.model_validate({ + "credential": Credential.from_dict(obj["credential"]) if obj.get("credential") is not None else None + }) return _obj + + diff --git a/koyeb/api/models/get_deployment_reply.py b/koyeb/api/models/get_deployment_reply.py index 4cdb287b..3520e23b 100644 --- a/koyeb/api/models/get_deployment_reply.py +++ b/koyeb/api/models/get_deployment_reply.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -22,30 +22,30 @@ from koyeb.api.models.deployment import Deployment from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class GetDeploymentReply(BaseModel): """ GetDeploymentReply - """ # noqa: E501 - + """ # noqa: E501 deployment: Optional[Deployment] = None __properties: ClassVar[List[str]] = ["deployment"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -62,7 +62,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -71,7 +72,7 @@ def to_dict(self) -> Dict[str, Any]: ) # override the default output from pydantic by calling `to_dict()` of deployment if self.deployment: - _dict["deployment"] = self.deployment.to_dict() + _dict['deployment'] = self.deployment.to_dict() return _dict @classmethod @@ -83,13 +84,9 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "deployment": ( - Deployment.from_dict(obj["deployment"]) - if obj.get("deployment") is not None - else None - ) - } - ) + _obj = cls.model_validate({ + "deployment": Deployment.from_dict(obj["deployment"]) if obj.get("deployment") is not None else None + }) return _obj + + diff --git a/koyeb/api/models/get_deployment_scaling_reply.py b/koyeb/api/models/get_deployment_scaling_reply.py index 2d1f7fe4..ca24e214 100644 --- a/koyeb/api/models/get_deployment_scaling_reply.py +++ b/koyeb/api/models/get_deployment_scaling_reply.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -19,35 +19,33 @@ from pydantic import BaseModel, ConfigDict from typing import Any, ClassVar, Dict, List, Optional -from koyeb.api.models.get_deployment_scaling_reply_item import ( - GetDeploymentScalingReplyItem, -) +from koyeb.api.models.get_deployment_scaling_reply_item import GetDeploymentScalingReplyItem from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class GetDeploymentScalingReply(BaseModel): """ GetDeploymentScalingReply - """ # noqa: E501 - + """ # noqa: E501 replicas: Optional[List[GetDeploymentScalingReplyItem]] = None __properties: ClassVar[List[str]] = ["replicas"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -64,7 +62,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -77,7 +76,7 @@ def to_dict(self) -> Dict[str, Any]: for _item_replicas in self.replicas: if _item_replicas: _items.append(_item_replicas.to_dict()) - _dict["replicas"] = _items + _dict['replicas'] = _items return _dict @classmethod @@ -89,16 +88,9 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "replicas": ( - [ - GetDeploymentScalingReplyItem.from_dict(_item) - for _item in obj["replicas"] - ] - if obj.get("replicas") is not None - else None - ) - } - ) + _obj = cls.model_validate({ + "replicas": [GetDeploymentScalingReplyItem.from_dict(_item) for _item in obj["replicas"]] if obj.get("replicas") is not None else None + }) return _obj + + diff --git a/koyeb/api/models/get_deployment_scaling_reply_item.py b/koyeb/api/models/get_deployment_scaling_reply_item.py index 1faac741..da35b5ea 100644 --- a/koyeb/api/models/get_deployment_scaling_reply_item.py +++ b/koyeb/api/models/get_deployment_scaling_reply_item.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -22,35 +22,32 @@ from koyeb.api.models.instance import Instance from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class GetDeploymentScalingReplyItem(BaseModel): """ GetDeploymentScalingReplyItem - """ # noqa: E501 - + """ # noqa: E501 region: Optional[StrictStr] = None replica_index: Optional[StrictInt] = None - instances: Optional[List[Instance]] = Field( - default=None, - description="An array of `active` and `starting` instances. Status of the active instance (and if none the most recent instance) string status = 4; Status message of the active instance (and if none the most recent instance) string message = 5;", - ) + instances: Optional[List[Instance]] = Field(default=None, description="An array of `active` and `starting` instances. Status of the active instance (and if none the most recent instance) string status = 4; Status message of the active instance (and if none the most recent instance) string message = 5;") __properties: ClassVar[List[str]] = ["region", "replica_index", "instances"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -67,7 +64,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -80,7 +78,7 @@ def to_dict(self) -> Dict[str, Any]: for _item_instances in self.instances: if _item_instances: _items.append(_item_instances.to_dict()) - _dict["instances"] = _items + _dict['instances'] = _items return _dict @classmethod @@ -92,15 +90,11 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "region": obj.get("region"), - "replica_index": obj.get("replica_index"), - "instances": ( - [Instance.from_dict(_item) for _item in obj["instances"]] - if obj.get("instances") is not None - else None - ), - } - ) + _obj = cls.model_validate({ + "region": obj.get("region"), + "replica_index": obj.get("replica_index"), + "instances": [Instance.from_dict(_item) for _item in obj["instances"]] if obj.get("instances") is not None else None + }) return _obj + + diff --git a/koyeb/api/models/get_domain_reply.py b/koyeb/api/models/get_domain_reply.py index 1eb9bccc..c22995dc 100644 --- a/koyeb/api/models/get_domain_reply.py +++ b/koyeb/api/models/get_domain_reply.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -22,30 +22,30 @@ from koyeb.api.models.domain import Domain from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class GetDomainReply(BaseModel): """ GetDomainReply - """ # noqa: E501 - + """ # noqa: E501 domain: Optional[Domain] = None __properties: ClassVar[List[str]] = ["domain"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -62,7 +62,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -71,7 +72,7 @@ def to_dict(self) -> Dict[str, Any]: ) # override the default output from pydantic by calling `to_dict()` of domain if self.domain: - _dict["domain"] = self.domain.to_dict() + _dict['domain'] = self.domain.to_dict() return _dict @classmethod @@ -83,13 +84,9 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "domain": ( - Domain.from_dict(obj["domain"]) - if obj.get("domain") is not None - else None - ) - } - ) + _obj = cls.model_validate({ + "domain": Domain.from_dict(obj["domain"]) if obj.get("domain") is not None else None + }) return _obj + + diff --git a/koyeb/api/models/get_github_installation_reply.py b/koyeb/api/models/get_github_installation_reply.py index 2e1d7581..4ebeef8d 100644 --- a/koyeb/api/models/get_github_installation_reply.py +++ b/koyeb/api/models/get_github_installation_reply.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -20,60 +20,43 @@ from datetime import datetime from pydantic import BaseModel, ConfigDict, StrictInt, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from koyeb.api.models.kgitproxy_github_installation_status import ( - KgitproxyGithubInstallationStatus, -) +from koyeb.api.models.kgitproxy_github_installation_status import KgitproxyGithubInstallationStatus from koyeb.api.models.kgitproxy_indexing_status import KgitproxyIndexingStatus from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class GetGithubInstallationReply(BaseModel): """ GetGithubInstallationReply - """ # noqa: E501 - + """ # noqa: E501 installation_id: Optional[StrictStr] = None installation_url: Optional[StrictStr] = None name: Optional[StrictStr] = None avatar_url: Optional[StrictStr] = None - status: Optional[KgitproxyGithubInstallationStatus] = ( - KgitproxyGithubInstallationStatus.INVALID - ) + status: Optional[KgitproxyGithubInstallationStatus] = KgitproxyGithubInstallationStatus.INVALID installed_at: Optional[datetime] = None suspended_at: Optional[datetime] = None - indexing_status: Optional[KgitproxyIndexingStatus] = ( - KgitproxyIndexingStatus.INVALID_INDEXING_STATUS - ) + indexing_status: Optional[KgitproxyIndexingStatus] = KgitproxyIndexingStatus.INVALID_INDEXING_STATUS indexed_repositories: Optional[StrictInt] = None total_repositories: Optional[StrictInt] = None - __properties: ClassVar[List[str]] = [ - "installation_id", - "installation_url", - "name", - "avatar_url", - "status", - "installed_at", - "suspended_at", - "indexing_status", - "indexed_repositories", - "total_repositories", - ] + __properties: ClassVar[List[str]] = ["installation_id", "installation_url", "name", "avatar_url", "status", "installed_at", "suspended_at", "indexing_status", "indexed_repositories", "total_repositories"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -90,7 +73,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -108,26 +92,18 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "installation_id": obj.get("installation_id"), - "installation_url": obj.get("installation_url"), - "name": obj.get("name"), - "avatar_url": obj.get("avatar_url"), - "status": ( - obj.get("status") - if obj.get("status") is not None - else KgitproxyGithubInstallationStatus.INVALID - ), - "installed_at": obj.get("installed_at"), - "suspended_at": obj.get("suspended_at"), - "indexing_status": ( - obj.get("indexing_status") - if obj.get("indexing_status") is not None - else KgitproxyIndexingStatus.INVALID_INDEXING_STATUS - ), - "indexed_repositories": obj.get("indexed_repositories"), - "total_repositories": obj.get("total_repositories"), - } - ) + _obj = cls.model_validate({ + "installation_id": obj.get("installation_id"), + "installation_url": obj.get("installation_url"), + "name": obj.get("name"), + "avatar_url": obj.get("avatar_url"), + "status": obj.get("status") if obj.get("status") is not None else KgitproxyGithubInstallationStatus.INVALID, + "installed_at": obj.get("installed_at"), + "suspended_at": obj.get("suspended_at"), + "indexing_status": obj.get("indexing_status") if obj.get("indexing_status") is not None else KgitproxyIndexingStatus.INVALID_INDEXING_STATUS, + "indexed_repositories": obj.get("indexed_repositories"), + "total_repositories": obj.get("total_repositories") + }) return _obj + + diff --git a/koyeb/api/models/get_idenfy_token_reply.py b/koyeb/api/models/get_idenfy_token_reply.py index d180873d..68f867f4 100644 --- a/koyeb/api/models/get_idenfy_token_reply.py +++ b/koyeb/api/models/get_idenfy_token_reply.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -21,30 +21,30 @@ from typing import Any, ClassVar, Dict, List, Optional from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class GetIdenfyTokenReply(BaseModel): """ GetIdenfyTokenReply - """ # noqa: E501 - + """ # noqa: E501 auth_token: Optional[StrictStr] = None __properties: ClassVar[List[str]] = ["auth_token"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -61,7 +61,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -79,5 +80,9 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({"auth_token": obj.get("auth_token")}) + _obj = cls.model_validate({ + "auth_token": obj.get("auth_token") + }) return _obj + + diff --git a/koyeb/api/models/get_instance_reply.py b/koyeb/api/models/get_instance_reply.py index 76397a9c..d97cd273 100644 --- a/koyeb/api/models/get_instance_reply.py +++ b/koyeb/api/models/get_instance_reply.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -22,30 +22,30 @@ from koyeb.api.models.instance import Instance from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class GetInstanceReply(BaseModel): """ GetInstanceReply - """ # noqa: E501 - + """ # noqa: E501 instance: Optional[Instance] = None __properties: ClassVar[List[str]] = ["instance"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -62,7 +62,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -71,7 +72,7 @@ def to_dict(self) -> Dict[str, Any]: ) # override the default output from pydantic by calling `to_dict()` of instance if self.instance: - _dict["instance"] = self.instance.to_dict() + _dict['instance'] = self.instance.to_dict() return _dict @classmethod @@ -83,13 +84,9 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "instance": ( - Instance.from_dict(obj["instance"]) - if obj.get("instance") is not None - else None - ) - } - ) + _obj = cls.model_validate({ + "instance": Instance.from_dict(obj["instance"]) if obj.get("instance") is not None else None + }) return _obj + + diff --git a/koyeb/api/models/get_intercom_profile_reply.py b/koyeb/api/models/get_intercom_profile_reply.py index 4c50c0f0..0c201cb7 100644 --- a/koyeb/api/models/get_intercom_profile_reply.py +++ b/koyeb/api/models/get_intercom_profile_reply.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -21,30 +21,30 @@ from typing import Any, ClassVar, Dict, List, Optional from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class GetIntercomProfileReply(BaseModel): """ GetIntercomProfileReply - """ # noqa: E501 - + """ # noqa: E501 hash: Optional[StrictStr] = None __properties: ClassVar[List[str]] = ["hash"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -61,7 +61,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -79,5 +80,9 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({"hash": obj.get("hash")}) + _obj = cls.model_validate({ + "hash": obj.get("hash") + }) return _obj + + diff --git a/koyeb/api/models/get_metrics_reply.py b/koyeb/api/models/get_metrics_reply.py index 56471c5b..00fd5359 100644 --- a/koyeb/api/models/get_metrics_reply.py +++ b/koyeb/api/models/get_metrics_reply.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -22,30 +22,30 @@ from koyeb.api.models.get_metrics_reply_metric import GetMetricsReplyMetric from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class GetMetricsReply(BaseModel): """ GetMetricsReply - """ # noqa: E501 - + """ # noqa: E501 metrics: Optional[List[GetMetricsReplyMetric]] = None __properties: ClassVar[List[str]] = ["metrics"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -62,7 +62,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -75,7 +76,7 @@ def to_dict(self) -> Dict[str, Any]: for _item_metrics in self.metrics: if _item_metrics: _items.append(_item_metrics.to_dict()) - _dict["metrics"] = _items + _dict['metrics'] = _items return _dict @classmethod @@ -87,13 +88,9 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "metrics": ( - [GetMetricsReplyMetric.from_dict(_item) for _item in obj["metrics"]] - if obj.get("metrics") is not None - else None - ) - } - ) + _obj = cls.model_validate({ + "metrics": [GetMetricsReplyMetric.from_dict(_item) for _item in obj["metrics"]] if obj.get("metrics") is not None else None + }) return _obj + + diff --git a/koyeb/api/models/get_metrics_reply_metric.py b/koyeb/api/models/get_metrics_reply_metric.py index c054b97f..c4e03bae 100644 --- a/koyeb/api/models/get_metrics_reply_metric.py +++ b/koyeb/api/models/get_metrics_reply_metric.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -22,31 +22,31 @@ from koyeb.api.models.sample import Sample from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class GetMetricsReplyMetric(BaseModel): """ GetMetricsReplyMetric - """ # noqa: E501 - + """ # noqa: E501 labels: Optional[Dict[str, StrictStr]] = None samples: Optional[List[Sample]] = None __properties: ClassVar[List[str]] = ["labels", "samples"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -63,7 +63,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -76,7 +77,7 @@ def to_dict(self) -> Dict[str, Any]: for _item_samples in self.samples: if _item_samples: _items.append(_item_samples.to_dict()) - _dict["samples"] = _items + _dict['samples'] = _items return _dict @classmethod @@ -88,14 +89,10 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "labels": obj.get("labels"), - "samples": ( - [Sample.from_dict(_item) for _item in obj["samples"]] - if obj.get("samples") is not None - else None - ), - } - ) + _obj = cls.model_validate({ + "labels": obj.get("labels"), + "samples": [Sample.from_dict(_item) for _item in obj["samples"]] if obj.get("samples") is not None else None + }) return _obj + + diff --git a/koyeb/api/models/get_o_auth_options_reply.py b/koyeb/api/models/get_o_auth_options_reply.py index 07929973..c2b77d1a 100644 --- a/koyeb/api/models/get_o_auth_options_reply.py +++ b/koyeb/api/models/get_o_auth_options_reply.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -22,30 +22,30 @@ from koyeb.api.models.o_auth_provider import OAuthProvider from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class GetOAuthOptionsReply(BaseModel): """ A list of providers which you can use for single sign-on. - """ # noqa: E501 - + """ # noqa: E501 oauth_providers: Optional[List[OAuthProvider]] = None __properties: ClassVar[List[str]] = ["oauth_providers"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -62,7 +62,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -75,7 +76,7 @@ def to_dict(self) -> Dict[str, Any]: for _item_oauth_providers in self.oauth_providers: if _item_oauth_providers: _items.append(_item_oauth_providers.to_dict()) - _dict["oauth_providers"] = _items + _dict['oauth_providers'] = _items return _dict @classmethod @@ -87,13 +88,9 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "oauth_providers": ( - [OAuthProvider.from_dict(_item) for _item in obj["oauth_providers"]] - if obj.get("oauth_providers") is not None - else None - ) - } - ) + _obj = cls.model_validate({ + "oauth_providers": [OAuthProvider.from_dict(_item) for _item in obj["oauth_providers"]] if obj.get("oauth_providers") is not None else None + }) return _obj + + diff --git a/koyeb/api/models/get_organization_invitation_reply.py b/koyeb/api/models/get_organization_invitation_reply.py index a2d987b0..7f738882 100644 --- a/koyeb/api/models/get_organization_invitation_reply.py +++ b/koyeb/api/models/get_organization_invitation_reply.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -22,30 +22,30 @@ from koyeb.api.models.organization_invitation import OrganizationInvitation from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class GetOrganizationInvitationReply(BaseModel): """ GetOrganizationInvitationReply - """ # noqa: E501 - + """ # noqa: E501 invitation: Optional[OrganizationInvitation] = None __properties: ClassVar[List[str]] = ["invitation"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -62,7 +62,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -71,7 +72,7 @@ def to_dict(self) -> Dict[str, Any]: ) # override the default output from pydantic by calling `to_dict()` of invitation if self.invitation: - _dict["invitation"] = self.invitation.to_dict() + _dict['invitation'] = self.invitation.to_dict() return _dict @classmethod @@ -83,13 +84,9 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "invitation": ( - OrganizationInvitation.from_dict(obj["invitation"]) - if obj.get("invitation") is not None - else None - ) - } - ) + _obj = cls.model_validate({ + "invitation": OrganizationInvitation.from_dict(obj["invitation"]) if obj.get("invitation") is not None else None + }) return _obj + + diff --git a/koyeb/api/models/get_organization_reply.py b/koyeb/api/models/get_organization_reply.py index 1f2f378f..721a75a7 100644 --- a/koyeb/api/models/get_organization_reply.py +++ b/koyeb/api/models/get_organization_reply.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -22,30 +22,30 @@ from koyeb.api.models.organization import Organization from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class GetOrganizationReply(BaseModel): """ GetOrganizationReply - """ # noqa: E501 - + """ # noqa: E501 organization: Optional[Organization] = None __properties: ClassVar[List[str]] = ["organization"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -62,7 +62,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -71,7 +72,7 @@ def to_dict(self) -> Dict[str, Any]: ) # override the default output from pydantic by calling `to_dict()` of organization if self.organization: - _dict["organization"] = self.organization.to_dict() + _dict['organization'] = self.organization.to_dict() return _dict @classmethod @@ -83,13 +84,9 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "organization": ( - Organization.from_dict(obj["organization"]) - if obj.get("organization") is not None - else None - ) - } - ) + _obj = cls.model_validate({ + "organization": Organization.from_dict(obj["organization"]) if obj.get("organization") is not None else None + }) return _obj + + diff --git a/koyeb/api/models/get_organization_summary_reply.py b/koyeb/api/models/get_organization_summary_reply.py index d4fcb8f8..81f25bef 100644 --- a/koyeb/api/models/get_organization_summary_reply.py +++ b/koyeb/api/models/get_organization_summary_reply.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -22,30 +22,30 @@ from koyeb.api.models.organization_summary import OrganizationSummary from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class GetOrganizationSummaryReply(BaseModel): """ GetOrganizationSummaryReply - """ # noqa: E501 - + """ # noqa: E501 summary: Optional[OrganizationSummary] = None __properties: ClassVar[List[str]] = ["summary"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -62,7 +62,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -71,7 +72,7 @@ def to_dict(self) -> Dict[str, Any]: ) # override the default output from pydantic by calling `to_dict()` of summary if self.summary: - _dict["summary"] = self.summary.to_dict() + _dict['summary'] = self.summary.to_dict() return _dict @classmethod @@ -83,13 +84,9 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "summary": ( - OrganizationSummary.from_dict(obj["summary"]) - if obj.get("summary") is not None - else None - ) - } - ) + _obj = cls.model_validate({ + "summary": OrganizationSummary.from_dict(obj["summary"]) if obj.get("summary") is not None else None + }) return _obj + + diff --git a/koyeb/api/models/get_organization_usage_details_reply.py b/koyeb/api/models/get_organization_usage_details_reply.py index cdb25087..be402a8f 100644 --- a/koyeb/api/models/get_organization_usage_details_reply.py +++ b/koyeb/api/models/get_organization_usage_details_reply.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -23,42 +23,35 @@ from koyeb.api.models.usage_details import UsageDetails from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class GetOrganizationUsageDetailsReply(BaseModel): """ GetOrganizationUsageDetailsReply - """ # noqa: E501 - + """ # noqa: E501 usage_details: Optional[List[UsageDetails]] = None database_details: Optional[List[DatabaseUsageDetails]] = None limit: Optional[StrictInt] = None offset: Optional[StrictInt] = None count: Optional[StrictInt] = None order: Optional[StrictStr] = None - __properties: ClassVar[List[str]] = [ - "usage_details", - "database_details", - "limit", - "offset", - "count", - "order", - ] + __properties: ClassVar[List[str]] = ["usage_details", "database_details", "limit", "offset", "count", "order"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -75,7 +68,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -88,14 +82,14 @@ def to_dict(self) -> Dict[str, Any]: for _item_usage_details in self.usage_details: if _item_usage_details: _items.append(_item_usage_details.to_dict()) - _dict["usage_details"] = _items + _dict['usage_details'] = _items # override the default output from pydantic by calling `to_dict()` of each item in database_details (list) _items = [] if self.database_details: for _item_database_details in self.database_details: if _item_database_details: _items.append(_item_database_details.to_dict()) - _dict["database_details"] = _items + _dict['database_details'] = _items return _dict @classmethod @@ -107,25 +101,14 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "usage_details": ( - [UsageDetails.from_dict(_item) for _item in obj["usage_details"]] - if obj.get("usage_details") is not None - else None - ), - "database_details": ( - [ - DatabaseUsageDetails.from_dict(_item) - for _item in obj["database_details"] - ] - if obj.get("database_details") is not None - else None - ), - "limit": obj.get("limit"), - "offset": obj.get("offset"), - "count": obj.get("count"), - "order": obj.get("order"), - } - ) + _obj = cls.model_validate({ + "usage_details": [UsageDetails.from_dict(_item) for _item in obj["usage_details"]] if obj.get("usage_details") is not None else None, + "database_details": [DatabaseUsageDetails.from_dict(_item) for _item in obj["database_details"]] if obj.get("database_details") is not None else None, + "limit": obj.get("limit"), + "offset": obj.get("offset"), + "count": obj.get("count"), + "order": obj.get("order") + }) return _obj + + diff --git a/koyeb/api/models/get_organization_usage_reply.py b/koyeb/api/models/get_organization_usage_reply.py index a78e7519..acf39b56 100644 --- a/koyeb/api/models/get_organization_usage_reply.py +++ b/koyeb/api/models/get_organization_usage_reply.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -22,30 +22,30 @@ from koyeb.api.models.usage import Usage from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class GetOrganizationUsageReply(BaseModel): """ GetOrganizationUsageReply - """ # noqa: E501 - + """ # noqa: E501 usage: Optional[Usage] = None __properties: ClassVar[List[str]] = ["usage"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -62,7 +62,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -71,7 +72,7 @@ def to_dict(self) -> Dict[str, Any]: ) # override the default output from pydantic by calling `to_dict()` of usage if self.usage: - _dict["usage"] = self.usage.to_dict() + _dict['usage'] = self.usage.to_dict() return _dict @classmethod @@ -83,13 +84,9 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "usage": ( - Usage.from_dict(obj["usage"]) - if obj.get("usage") is not None - else None - ) - } - ) + _obj = cls.model_validate({ + "usage": Usage.from_dict(obj["usage"]) if obj.get("usage") is not None else None + }) return _obj + + diff --git a/koyeb/api/models/get_payment_method_reply.py b/koyeb/api/models/get_payment_method_reply.py index 75a00c2a..396b0b68 100644 --- a/koyeb/api/models/get_payment_method_reply.py +++ b/koyeb/api/models/get_payment_method_reply.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -22,30 +22,30 @@ from koyeb.api.models.payment_method import PaymentMethod from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class GetPaymentMethodReply(BaseModel): """ GetPaymentMethodReply - """ # noqa: E501 - + """ # noqa: E501 payment_method: Optional[PaymentMethod] = None __properties: ClassVar[List[str]] = ["payment_method"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -62,7 +62,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -71,7 +72,7 @@ def to_dict(self) -> Dict[str, Any]: ) # override the default output from pydantic by calling `to_dict()` of payment_method if self.payment_method: - _dict["payment_method"] = self.payment_method.to_dict() + _dict['payment_method'] = self.payment_method.to_dict() return _dict @classmethod @@ -83,13 +84,9 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "payment_method": ( - PaymentMethod.from_dict(obj["payment_method"]) - if obj.get("payment_method") is not None - else None - ) - } - ) + _obj = cls.model_validate({ + "payment_method": PaymentMethod.from_dict(obj["payment_method"]) if obj.get("payment_method") is not None else None + }) return _obj + + diff --git a/koyeb/api/models/get_persistent_volume_reply.py b/koyeb/api/models/get_persistent_volume_reply.py index ea691ea3..7f641fb9 100644 --- a/koyeb/api/models/get_persistent_volume_reply.py +++ b/koyeb/api/models/get_persistent_volume_reply.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -22,30 +22,30 @@ from koyeb.api.models.persistent_volume import PersistentVolume from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class GetPersistentVolumeReply(BaseModel): """ GetPersistentVolumeReply - """ # noqa: E501 - + """ # noqa: E501 volume: Optional[PersistentVolume] = None __properties: ClassVar[List[str]] = ["volume"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -62,7 +62,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -71,7 +72,7 @@ def to_dict(self) -> Dict[str, Any]: ) # override the default output from pydantic by calling `to_dict()` of volume if self.volume: - _dict["volume"] = self.volume.to_dict() + _dict['volume'] = self.volume.to_dict() return _dict @classmethod @@ -83,13 +84,9 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "volume": ( - PersistentVolume.from_dict(obj["volume"]) - if obj.get("volume") is not None - else None - ) - } - ) + _obj = cls.model_validate({ + "volume": PersistentVolume.from_dict(obj["volume"]) if obj.get("volume") is not None else None + }) return _obj + + diff --git a/koyeb/api/models/get_project_reply.py b/koyeb/api/models/get_project_reply.py new file mode 100644 index 00000000..384d04ee --- /dev/null +++ b/koyeb/api/models/get_project_reply.py @@ -0,0 +1,92 @@ +# coding: utf-8 + +""" + Koyeb Rest API + + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict +from typing import Any, ClassVar, Dict, List, Optional +from koyeb.api.models.project import Project +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class GetProjectReply(BaseModel): + """ + GetProjectReply + """ # noqa: E501 + project: Optional[Project] = None + __properties: ClassVar[List[str]] = ["project"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of GetProjectReply from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of project + if self.project: + _dict['project'] = self.project.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of GetProjectReply from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "project": Project.from_dict(obj["project"]) if obj.get("project") is not None else None + }) + return _obj + + diff --git a/koyeb/api/models/get_quotas_reply.py b/koyeb/api/models/get_quotas_reply.py index fc0b9b7c..a78691af 100644 --- a/koyeb/api/models/get_quotas_reply.py +++ b/koyeb/api/models/get_quotas_reply.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -22,30 +22,30 @@ from koyeb.api.models.quotas import Quotas from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class GetQuotasReply(BaseModel): """ GetQuotasReply - """ # noqa: E501 - + """ # noqa: E501 quotas: Optional[Quotas] = None __properties: ClassVar[List[str]] = ["quotas"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -62,7 +62,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -71,7 +72,7 @@ def to_dict(self) -> Dict[str, Any]: ) # override the default output from pydantic by calling `to_dict()` of quotas if self.quotas: - _dict["quotas"] = self.quotas.to_dict() + _dict['quotas'] = self.quotas.to_dict() return _dict @classmethod @@ -83,13 +84,9 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "quotas": ( - Quotas.from_dict(obj["quotas"]) - if obj.get("quotas") is not None - else None - ) - } - ) + _obj = cls.model_validate({ + "quotas": Quotas.from_dict(obj["quotas"]) if obj.get("quotas") is not None else None + }) return _obj + + diff --git a/koyeb/api/models/get_region_reply.py b/koyeb/api/models/get_region_reply.py index afaa42f0..276e9997 100644 --- a/koyeb/api/models/get_region_reply.py +++ b/koyeb/api/models/get_region_reply.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -22,30 +22,30 @@ from koyeb.api.models.region import Region from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class GetRegionReply(BaseModel): """ GetRegionReply - """ # noqa: E501 - + """ # noqa: E501 region: Optional[Region] = None __properties: ClassVar[List[str]] = ["region"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -62,7 +62,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -71,7 +72,7 @@ def to_dict(self) -> Dict[str, Any]: ) # override the default output from pydantic by calling `to_dict()` of region if self.region: - _dict["region"] = self.region.to_dict() + _dict['region'] = self.region.to_dict() return _dict @classmethod @@ -83,13 +84,9 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "region": ( - Region.from_dict(obj["region"]) - if obj.get("region") is not None - else None - ) - } - ) + _obj = cls.model_validate({ + "region": Region.from_dict(obj["region"]) if obj.get("region") is not None else None + }) return _obj + + diff --git a/koyeb/api/models/get_regional_deployment_reply.py b/koyeb/api/models/get_regional_deployment_reply.py index bd5777a2..02193ea0 100644 --- a/koyeb/api/models/get_regional_deployment_reply.py +++ b/koyeb/api/models/get_regional_deployment_reply.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -22,30 +22,30 @@ from koyeb.api.models.regional_deployment import RegionalDeployment from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class GetRegionalDeploymentReply(BaseModel): """ GetRegionalDeploymentReply - """ # noqa: E501 - + """ # noqa: E501 regional_deployment: Optional[RegionalDeployment] = None __properties: ClassVar[List[str]] = ["regional_deployment"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -62,7 +62,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -71,7 +72,7 @@ def to_dict(self) -> Dict[str, Any]: ) # override the default output from pydantic by calling `to_dict()` of regional_deployment if self.regional_deployment: - _dict["regional_deployment"] = self.regional_deployment.to_dict() + _dict['regional_deployment'] = self.regional_deployment.to_dict() return _dict @classmethod @@ -83,13 +84,9 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "regional_deployment": ( - RegionalDeployment.from_dict(obj["regional_deployment"]) - if obj.get("regional_deployment") is not None - else None - ) - } - ) + _obj = cls.model_validate({ + "regional_deployment": RegionalDeployment.from_dict(obj["regional_deployment"]) if obj.get("regional_deployment") is not None else None + }) return _obj + + diff --git a/koyeb/api/models/get_secret_reply.py b/koyeb/api/models/get_secret_reply.py index 4b93a9d1..c9c989f9 100644 --- a/koyeb/api/models/get_secret_reply.py +++ b/koyeb/api/models/get_secret_reply.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -22,30 +22,30 @@ from koyeb.api.models.secret import Secret from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class GetSecretReply(BaseModel): """ GetSecretReply - """ # noqa: E501 - + """ # noqa: E501 secret: Optional[Secret] = None __properties: ClassVar[List[str]] = ["secret"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -62,7 +62,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -71,7 +72,7 @@ def to_dict(self) -> Dict[str, Any]: ) # override the default output from pydantic by calling `to_dict()` of secret if self.secret: - _dict["secret"] = self.secret.to_dict() + _dict['secret'] = self.secret.to_dict() return _dict @classmethod @@ -83,13 +84,9 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "secret": ( - Secret.from_dict(obj["secret"]) - if obj.get("secret") is not None - else None - ) - } - ) + _obj = cls.model_validate({ + "secret": Secret.from_dict(obj["secret"]) if obj.get("secret") is not None else None + }) return _obj + + diff --git a/koyeb/api/models/get_service_reply.py b/koyeb/api/models/get_service_reply.py index a582cbe2..7e0aca9c 100644 --- a/koyeb/api/models/get_service_reply.py +++ b/koyeb/api/models/get_service_reply.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -22,30 +22,30 @@ from koyeb.api.models.service import Service from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class GetServiceReply(BaseModel): """ GetServiceReply - """ # noqa: E501 - + """ # noqa: E501 service: Optional[Service] = None __properties: ClassVar[List[str]] = ["service"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -62,7 +62,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -71,7 +72,7 @@ def to_dict(self) -> Dict[str, Any]: ) # override the default output from pydantic by calling `to_dict()` of service if self.service: - _dict["service"] = self.service.to_dict() + _dict['service'] = self.service.to_dict() return _dict @classmethod @@ -83,13 +84,9 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "service": ( - Service.from_dict(obj["service"]) - if obj.get("service") is not None - else None - ) - } - ) + _obj = cls.model_validate({ + "service": Service.from_dict(obj["service"]) if obj.get("service") is not None else None + }) return _obj + + diff --git a/koyeb/api/models/get_service_scaling_reply.py b/koyeb/api/models/get_service_scaling_reply.py new file mode 100644 index 00000000..247682de --- /dev/null +++ b/koyeb/api/models/get_service_scaling_reply.py @@ -0,0 +1,96 @@ +# coding: utf-8 + +""" + Koyeb Rest API + + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict +from typing import Any, ClassVar, Dict, List, Optional +from koyeb.api.models.manual_service_scaling import ManualServiceScaling +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class GetServiceScalingReply(BaseModel): + """ + GetServiceScalingReply + """ # noqa: E501 + scalings: Optional[List[ManualServiceScaling]] = None + __properties: ClassVar[List[str]] = ["scalings"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of GetServiceScalingReply from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in scalings (list) + _items = [] + if self.scalings: + for _item_scalings in self.scalings: + if _item_scalings: + _items.append(_item_scalings.to_dict()) + _dict['scalings'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of GetServiceScalingReply from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "scalings": [ManualServiceScaling.from_dict(_item) for _item in obj["scalings"]] if obj.get("scalings") is not None else None + }) + return _obj + + diff --git a/koyeb/api/models/get_snapshot_reply.py b/koyeb/api/models/get_snapshot_reply.py index b8e198dd..84f13759 100644 --- a/koyeb/api/models/get_snapshot_reply.py +++ b/koyeb/api/models/get_snapshot_reply.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -22,30 +22,30 @@ from koyeb.api.models.snapshot import Snapshot from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class GetSnapshotReply(BaseModel): """ GetSnapshotReply - """ # noqa: E501 - + """ # noqa: E501 snapshot: Optional[Snapshot] = None __properties: ClassVar[List[str]] = ["snapshot"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -62,7 +62,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -71,7 +72,7 @@ def to_dict(self) -> Dict[str, Any]: ) # override the default output from pydantic by calling `to_dict()` of snapshot if self.snapshot: - _dict["snapshot"] = self.snapshot.to_dict() + _dict['snapshot'] = self.snapshot.to_dict() return _dict @classmethod @@ -83,13 +84,9 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "snapshot": ( - Snapshot.from_dict(obj["snapshot"]) - if obj.get("snapshot") is not None - else None - ) - } - ) + _obj = cls.model_validate({ + "snapshot": Snapshot.from_dict(obj["snapshot"]) if obj.get("snapshot") is not None else None + }) return _obj + + diff --git a/koyeb/api/models/get_subscription_reply.py b/koyeb/api/models/get_subscription_reply.py index fac64633..7fd742f0 100644 --- a/koyeb/api/models/get_subscription_reply.py +++ b/koyeb/api/models/get_subscription_reply.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -22,30 +22,30 @@ from koyeb.api.models.subscription import Subscription from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class GetSubscriptionReply(BaseModel): """ GetSubscriptionReply - """ # noqa: E501 - + """ # noqa: E501 subscription: Optional[Subscription] = None __properties: ClassVar[List[str]] = ["subscription"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -62,7 +62,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -71,7 +72,7 @@ def to_dict(self) -> Dict[str, Any]: ) # override the default output from pydantic by calling `to_dict()` of subscription if self.subscription: - _dict["subscription"] = self.subscription.to_dict() + _dict['subscription'] = self.subscription.to_dict() return _dict @classmethod @@ -83,13 +84,9 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "subscription": ( - Subscription.from_dict(obj["subscription"]) - if obj.get("subscription") is not None - else None - ) - } - ) + _obj = cls.model_validate({ + "subscription": Subscription.from_dict(obj["subscription"]) if obj.get("subscription") is not None else None + }) return _obj + + diff --git a/koyeb/api/models/get_user_organization_invitation_reply.py b/koyeb/api/models/get_user_organization_invitation_reply.py index 594975a1..4146afba 100644 --- a/koyeb/api/models/get_user_organization_invitation_reply.py +++ b/koyeb/api/models/get_user_organization_invitation_reply.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -22,30 +22,30 @@ from koyeb.api.models.organization_invitation import OrganizationInvitation from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class GetUserOrganizationInvitationReply(BaseModel): """ GetUserOrganizationInvitationReply - """ # noqa: E501 - + """ # noqa: E501 invitation: Optional[OrganizationInvitation] = None __properties: ClassVar[List[str]] = ["invitation"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -62,7 +62,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -71,7 +72,7 @@ def to_dict(self) -> Dict[str, Any]: ) # override the default output from pydantic by calling `to_dict()` of invitation if self.invitation: - _dict["invitation"] = self.invitation.to_dict() + _dict['invitation'] = self.invitation.to_dict() return _dict @classmethod @@ -83,13 +84,9 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "invitation": ( - OrganizationInvitation.from_dict(obj["invitation"]) - if obj.get("invitation") is not None - else None - ) - } - ) + _obj = cls.model_validate({ + "invitation": OrganizationInvitation.from_dict(obj["invitation"]) if obj.get("invitation") is not None else None + }) return _obj + + diff --git a/koyeb/api/models/get_user_settings_reply.py b/koyeb/api/models/get_user_settings_reply.py index 69a478b8..4057ff42 100644 --- a/koyeb/api/models/get_user_settings_reply.py +++ b/koyeb/api/models/get_user_settings_reply.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -22,30 +22,30 @@ from koyeb.api.models.user_settings import UserSettings from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class GetUserSettingsReply(BaseModel): """ GetUserSettingsReply - """ # noqa: E501 - + """ # noqa: E501 settings: Optional[UserSettings] = None __properties: ClassVar[List[str]] = ["settings"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -62,7 +62,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -71,7 +72,7 @@ def to_dict(self) -> Dict[str, Any]: ) # override the default output from pydantic by calling `to_dict()` of settings if self.settings: - _dict["settings"] = self.settings.to_dict() + _dict['settings'] = self.settings.to_dict() return _dict @classmethod @@ -83,13 +84,9 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "settings": ( - UserSettings.from_dict(obj["settings"]) - if obj.get("settings") is not None - else None - ) - } - ) + _obj = cls.model_validate({ + "settings": UserSettings.from_dict(obj["settings"]) if obj.get("settings") is not None else None + }) return _obj + + diff --git a/koyeb/api/models/git_deployment_metadata.py b/koyeb/api/models/git_deployment_metadata.py index 484de4ae..52db3dcb 100644 --- a/koyeb/api/models/git_deployment_metadata.py +++ b/koyeb/api/models/git_deployment_metadata.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -22,31 +22,31 @@ from koyeb.api.models.git_env_deployment_metadata import GitEnvDeploymentMetadata from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class GitDeploymentMetadata(BaseModel): """ GitDeploymentMetadata - """ # noqa: E501 - + """ # noqa: E501 last_provisioned_deployment_id: Optional[StrictStr] = None git_env: Optional[GitEnvDeploymentMetadata] = None __properties: ClassVar[List[str]] = ["last_provisioned_deployment_id", "git_env"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -63,7 +63,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -72,7 +73,7 @@ def to_dict(self) -> Dict[str, Any]: ) # override the default output from pydantic by calling `to_dict()` of git_env if self.git_env: - _dict["git_env"] = self.git_env.to_dict() + _dict['git_env'] = self.git_env.to_dict() return _dict @classmethod @@ -84,16 +85,10 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "last_provisioned_deployment_id": obj.get( - "last_provisioned_deployment_id" - ), - "git_env": ( - GitEnvDeploymentMetadata.from_dict(obj["git_env"]) - if obj.get("git_env") is not None - else None - ), - } - ) + _obj = cls.model_validate({ + "last_provisioned_deployment_id": obj.get("last_provisioned_deployment_id"), + "git_env": GitEnvDeploymentMetadata.from_dict(obj["git_env"]) if obj.get("git_env") is not None else None + }) return _obj + + diff --git a/koyeb/api/models/git_env_deployment_metadata.py b/koyeb/api/models/git_env_deployment_metadata.py index 96de36b9..8a7a5710 100644 --- a/koyeb/api/models/git_env_deployment_metadata.py +++ b/koyeb/api/models/git_env_deployment_metadata.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -21,32 +21,32 @@ from typing import Any, ClassVar, Dict, List, Optional from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class GitEnvDeploymentMetadata(BaseModel): """ GitEnvDeploymentMetadata - """ # noqa: E501 - + """ # noqa: E501 sha: Optional[StrictStr] = None commit_author: Optional[StrictStr] = None commit_message: Optional[StrictStr] = None __properties: ClassVar[List[str]] = ["sha", "commit_author", "commit_message"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -63,7 +63,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -81,11 +82,11 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "sha": obj.get("sha"), - "commit_author": obj.get("commit_author"), - "commit_message": obj.get("commit_message"), - } - ) + _obj = cls.model_validate({ + "sha": obj.get("sha"), + "commit_author": obj.get("commit_author"), + "commit_message": obj.get("commit_message") + }) return _obj + + diff --git a/koyeb/api/models/git_hub_registry_configuration.py b/koyeb/api/models/git_hub_registry_configuration.py index cc78a454..ca3244ad 100644 --- a/koyeb/api/models/git_hub_registry_configuration.py +++ b/koyeb/api/models/git_hub_registry_configuration.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -21,31 +21,31 @@ from typing import Any, ClassVar, Dict, List, Optional from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class GitHubRegistryConfiguration(BaseModel): """ GitHubRegistryConfiguration - """ # noqa: E501 - + """ # noqa: E501 username: Optional[StrictStr] = None password: Optional[StrictStr] = None __properties: ClassVar[List[str]] = ["username", "password"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -62,7 +62,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -80,7 +81,10 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - {"username": obj.get("username"), "password": obj.get("password")} - ) + _obj = cls.model_validate({ + "username": obj.get("username"), + "password": obj.get("password") + }) return _obj + + diff --git a/koyeb/api/models/git_lab_registry_configuration.py b/koyeb/api/models/git_lab_registry_configuration.py index 48b03c02..0b792b9a 100644 --- a/koyeb/api/models/git_lab_registry_configuration.py +++ b/koyeb/api/models/git_lab_registry_configuration.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -21,31 +21,31 @@ from typing import Any, ClassVar, Dict, List, Optional from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class GitLabRegistryConfiguration(BaseModel): """ GitLabRegistryConfiguration - """ # noqa: E501 - + """ # noqa: E501 username: Optional[StrictStr] = None password: Optional[StrictStr] = None __properties: ClassVar[List[str]] = ["username", "password"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -62,7 +62,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -80,7 +81,10 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - {"username": obj.get("username"), "password": obj.get("password")} - ) + _obj = cls.model_validate({ + "username": obj.get("username"), + "password": obj.get("password") + }) return _obj + + diff --git a/koyeb/api/models/git_source.py b/koyeb/api/models/git_source.py index ba381a46..c805eb01 100644 --- a/koyeb/api/models/git_source.py +++ b/koyeb/api/models/git_source.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -23,17 +23,13 @@ from koyeb.api.models.docker_builder import DockerBuilder from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class GitSource(BaseModel): """ GitSource - """ # noqa: E501 - - repository: Optional[StrictStr] = Field( - default=None, - description="A url to a git repository (contains the provider as well) .e.g: github.com/koyeb/test.", - ) + """ # noqa: E501 + repository: Optional[StrictStr] = Field(default=None, description="A url to a git repository (contains the provider as well) .e.g: github.com/koyeb/test.") branch: Optional[StrictStr] = None tag: Optional[StrictStr] = None sha: Optional[StrictStr] = None @@ -43,33 +39,23 @@ class GitSource(BaseModel): workdir: Optional[StrictStr] = None buildpack: Optional[BuildpackBuilder] = None docker: Optional[DockerBuilder] = None - __properties: ClassVar[List[str]] = [ - "repository", - "branch", - "tag", - "sha", - "build_command", - "run_command", - "no_deploy_on_push", - "workdir", - "buildpack", - "docker", - ] + __properties: ClassVar[List[str]] = ["repository", "branch", "tag", "sha", "build_command", "run_command", "no_deploy_on_push", "workdir", "buildpack", "docker"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -86,7 +72,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -95,10 +82,10 @@ def to_dict(self) -> Dict[str, Any]: ) # override the default output from pydantic by calling `to_dict()` of buildpack if self.buildpack: - _dict["buildpack"] = self.buildpack.to_dict() + _dict['buildpack'] = self.buildpack.to_dict() # override the default output from pydantic by calling `to_dict()` of docker if self.docker: - _dict["docker"] = self.docker.to_dict() + _dict['docker'] = self.docker.to_dict() return _dict @classmethod @@ -110,26 +97,18 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "repository": obj.get("repository"), - "branch": obj.get("branch"), - "tag": obj.get("tag"), - "sha": obj.get("sha"), - "build_command": obj.get("build_command"), - "run_command": obj.get("run_command"), - "no_deploy_on_push": obj.get("no_deploy_on_push"), - "workdir": obj.get("workdir"), - "buildpack": ( - BuildpackBuilder.from_dict(obj["buildpack"]) - if obj.get("buildpack") is not None - else None - ), - "docker": ( - DockerBuilder.from_dict(obj["docker"]) - if obj.get("docker") is not None - else None - ), - } - ) + _obj = cls.model_validate({ + "repository": obj.get("repository"), + "branch": obj.get("branch"), + "tag": obj.get("tag"), + "sha": obj.get("sha"), + "build_command": obj.get("build_command"), + "run_command": obj.get("run_command"), + "no_deploy_on_push": obj.get("no_deploy_on_push"), + "workdir": obj.get("workdir"), + "buildpack": BuildpackBuilder.from_dict(obj["buildpack"]) if obj.get("buildpack") is not None else None, + "docker": DockerBuilder.from_dict(obj["docker"]) if obj.get("docker") is not None else None + }) return _obj + + diff --git a/koyeb/api/models/github_installation_reply.py b/koyeb/api/models/github_installation_reply.py index b800aaa5..210ea082 100644 --- a/koyeb/api/models/github_installation_reply.py +++ b/koyeb/api/models/github_installation_reply.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -21,13 +21,12 @@ from typing import Any, ClassVar, Dict, List, Optional from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class GithubInstallationReply(BaseModel): """ GithubInstallationReply - """ # noqa: E501 - + """ # noqa: E501 app_name: Optional[StrictStr] = None app_id: Optional[StrictStr] = None url: Optional[StrictStr] = None @@ -35,19 +34,20 @@ class GithubInstallationReply(BaseModel): __properties: ClassVar[List[str]] = ["app_name", "app_id", "url", "state"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -64,7 +64,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -82,12 +83,12 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "app_name": obj.get("app_name"), - "app_id": obj.get("app_id"), - "url": obj.get("url"), - "state": obj.get("state"), - } - ) + _obj = cls.model_validate({ + "app_name": obj.get("app_name"), + "app_id": obj.get("app_id"), + "url": obj.get("url"), + "state": obj.get("state") + }) return _obj + + diff --git a/koyeb/api/models/github_installation_request.py b/koyeb/api/models/github_installation_request.py index 3ddd8051..046aee5a 100644 --- a/koyeb/api/models/github_installation_request.py +++ b/koyeb/api/models/github_installation_request.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -21,30 +21,30 @@ from typing import Any, ClassVar, Dict, List, Optional from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class GithubInstallationRequest(BaseModel): """ GithubInstallationRequest - """ # noqa: E501 - + """ # noqa: E501 metadata: Optional[StrictStr] = None __properties: ClassVar[List[str]] = ["metadata"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -61,7 +61,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -79,5 +80,9 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({"metadata": obj.get("metadata")}) + _obj = cls.model_validate({ + "metadata": obj.get("metadata") + }) return _obj + + diff --git a/koyeb/api/models/google_protobuf_any.py b/koyeb/api/models/google_protobuf_any.py index 6769bd51..445ff6a9 100644 --- a/koyeb/api/models/google_protobuf_any.py +++ b/koyeb/api/models/google_protobuf_any.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -21,31 +21,31 @@ from typing import Any, ClassVar, Dict, List, Optional from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class GoogleProtobufAny(BaseModel): """ GoogleProtobufAny - """ # noqa: E501 - + """ # noqa: E501 type: Optional[StrictStr] = Field(default=None, alias="@type") additional_properties: Dict[str, Any] = {} __properties: ClassVar[List[str]] = ["@type"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -63,11 +63,9 @@ def to_dict(self) -> Dict[str, Any]: are ignored. * Fields in `self.additional_properties` are added to the output dict. """ - excluded_fields: Set[str] = set( - [ - "additional_properties", - ] - ) + excluded_fields: Set[str] = set([ + "additional_properties", + ]) _dict = self.model_dump( by_alias=True, @@ -90,10 +88,14 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({"@type": obj.get("@type")}) + _obj = cls.model_validate({ + "@type": obj.get("@type") + }) # store additional fields in additional_properties for _key in obj.keys(): if _key not in cls.__properties: _obj.additional_properties[_key] = obj.get(_key) return _obj + + diff --git a/koyeb/api/models/google_protobuf_null_value.py b/koyeb/api/models/google_protobuf_null_value.py index 52e4bfdb..3b72b255 100644 --- a/koyeb/api/models/google_protobuf_null_value.py +++ b/koyeb/api/models/google_protobuf_null_value.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -26,9 +26,11 @@ class GoogleProtobufNullValue(str, Enum): """ allowed enum values """ - NULL_VALUE = "NULL_VALUE" + NULL_VALUE = 'NULL_VALUE' @classmethod def from_json(cls, json_str: str) -> Self: """Create an instance of GoogleProtobufNullValue from a JSON string""" return cls(json.loads(json_str)) + + diff --git a/koyeb/api/models/google_rpc_status.py b/koyeb/api/models/google_rpc_status.py index f3217432..9cc093ba 100644 --- a/koyeb/api/models/google_rpc_status.py +++ b/koyeb/api/models/google_rpc_status.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -22,32 +22,32 @@ from koyeb.api.models.google_protobuf_any import GoogleProtobufAny from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class GoogleRpcStatus(BaseModel): """ GoogleRpcStatus - """ # noqa: E501 - + """ # noqa: E501 code: Optional[StrictInt] = None message: Optional[StrictStr] = None details: Optional[List[GoogleProtobufAny]] = None __properties: ClassVar[List[str]] = ["code", "message", "details"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -64,7 +64,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -77,7 +78,7 @@ def to_dict(self) -> Dict[str, Any]: for _item_details in self.details: if _item_details: _items.append(_item_details.to_dict()) - _dict["details"] = _items + _dict['details'] = _items return _dict @classmethod @@ -89,15 +90,11 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "code": obj.get("code"), - "message": obj.get("message"), - "details": ( - [GoogleProtobufAny.from_dict(_item) for _item in obj["details"]] - if obj.get("details") is not None - else None - ), - } - ) + _obj = cls.model_validate({ + "code": obj.get("code"), + "message": obj.get("message"), + "details": [GoogleProtobufAny.from_dict(_item) for _item in obj["details"]] if obj.get("details") is not None else None + }) return _obj + + diff --git a/koyeb/api/models/has_unpaid_invoices_reply.py b/koyeb/api/models/has_unpaid_invoices_reply.py index 55d38692..55faf7bb 100644 --- a/koyeb/api/models/has_unpaid_invoices_reply.py +++ b/koyeb/api/models/has_unpaid_invoices_reply.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -21,30 +21,30 @@ from typing import Any, ClassVar, Dict, List, Optional from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class HasUnpaidInvoicesReply(BaseModel): """ HasUnpaidInvoicesReply - """ # noqa: E501 - + """ # noqa: E501 has_unpaid_invoices: Optional[StrictBool] = None __properties: ClassVar[List[str]] = ["has_unpaid_invoices"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -61,7 +61,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -79,7 +80,9 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - {"has_unpaid_invoices": obj.get("has_unpaid_invoices")} - ) + _obj = cls.model_validate({ + "has_unpaid_invoices": obj.get("has_unpaid_invoices") + }) return _obj + + diff --git a/koyeb/api/models/http_header.py b/koyeb/api/models/http_header.py index 9b009168..063a5a75 100644 --- a/koyeb/api/models/http_header.py +++ b/koyeb/api/models/http_header.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -21,31 +21,31 @@ from typing import Any, ClassVar, Dict, List, Optional from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class HTTPHeader(BaseModel): """ HTTPHeader - """ # noqa: E501 - + """ # noqa: E501 key: Optional[StrictStr] = None value: Optional[StrictStr] = None __properties: ClassVar[List[str]] = ["key", "value"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -62,7 +62,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -80,5 +81,10 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({"key": obj.get("key"), "value": obj.get("value")}) + _obj = cls.model_validate({ + "key": obj.get("key"), + "value": obj.get("value") + }) return _obj + + diff --git a/koyeb/api/models/http_health_check.py b/koyeb/api/models/http_health_check.py index 9f6bff3b..5613f06d 100644 --- a/koyeb/api/models/http_health_check.py +++ b/koyeb/api/models/http_health_check.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -22,13 +22,12 @@ from koyeb.api.models.http_header import HTTPHeader from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class HTTPHealthCheck(BaseModel): """ HTTPHealthCheck - """ # noqa: E501 - + """ # noqa: E501 port: Optional[StrictInt] = None path: Optional[StrictStr] = None method: Optional[StrictStr] = None @@ -36,19 +35,20 @@ class HTTPHealthCheck(BaseModel): __properties: ClassVar[List[str]] = ["port", "path", "method", "headers"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -65,7 +65,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -78,7 +79,7 @@ def to_dict(self) -> Dict[str, Any]: for _item_headers in self.headers: if _item_headers: _items.append(_item_headers.to_dict()) - _dict["headers"] = _items + _dict['headers'] = _items return _dict @classmethod @@ -90,16 +91,12 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "port": obj.get("port"), - "path": obj.get("path"), - "method": obj.get("method"), - "headers": ( - [HTTPHeader.from_dict(_item) for _item in obj["headers"]] - if obj.get("headers") is not None - else None - ), - } - ) + _obj = cls.model_validate({ + "port": obj.get("port"), + "path": obj.get("path"), + "method": obj.get("method"), + "headers": [HTTPHeader.from_dict(_item) for _item in obj["headers"]] if obj.get("headers") is not None else None + }) return _obj + + diff --git a/koyeb/api/models/instance.py b/koyeb/api/models/instance.py index 8b60cb0b..0843d9a5 100644 --- a/koyeb/api/models/instance.py +++ b/koyeb/api/models/instance.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -23,13 +23,12 @@ from koyeb.api.models.instance_status import InstanceStatus from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class Instance(BaseModel): """ Instance - """ # noqa: E501 - + """ # noqa: E501 id: Optional[StrictStr] = None created_at: Optional[datetime] = None updated_at: Optional[datetime] = None @@ -48,46 +47,24 @@ class Instance(BaseModel): started_at: Optional[datetime] = None succeeded_at: Optional[datetime] = None terminated_at: Optional[datetime] = None - xyz_deployment_id: Optional[StrictStr] = Field( - default=None, - description="WARNING: Please don't use the following attribute. Koyeb doesn't guarantee backwards compatible breaking change and reserve the right to completely drop it without notice. USE AT YOUR OWN RISK.", - ) - __properties: ClassVar[List[str]] = [ - "id", - "created_at", - "updated_at", - "organization_id", - "app_id", - "service_id", - "regional_deployment_id", - "allocation_id", - "type", - "replica_index", - "region", - "datacenter", - "hypervisor", - "status", - "messages", - "started_at", - "succeeded_at", - "terminated_at", - "xyz_deployment_id", - ] + xyz_deployment_id: Optional[StrictStr] = Field(default=None, description="WARNING: Please don't use the following attribute. Koyeb doesn't guarantee backwards compatible breaking change and reserve the right to completely drop it without notice. USE AT YOUR OWN RISK.") + __properties: ClassVar[List[str]] = ["id", "created_at", "updated_at", "organization_id", "app_id", "service_id", "regional_deployment_id", "allocation_id", "type", "replica_index", "region", "datacenter", "hypervisor", "status", "messages", "started_at", "succeeded_at", "terminated_at", "xyz_deployment_id"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -104,7 +81,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -122,31 +100,27 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "id": obj.get("id"), - "created_at": obj.get("created_at"), - "updated_at": obj.get("updated_at"), - "organization_id": obj.get("organization_id"), - "app_id": obj.get("app_id"), - "service_id": obj.get("service_id"), - "regional_deployment_id": obj.get("regional_deployment_id"), - "allocation_id": obj.get("allocation_id"), - "type": obj.get("type"), - "replica_index": obj.get("replica_index"), - "region": obj.get("region"), - "datacenter": obj.get("datacenter"), - "hypervisor": obj.get("hypervisor"), - "status": ( - obj.get("status") - if obj.get("status") is not None - else InstanceStatus.ALLOCATING - ), - "messages": obj.get("messages"), - "started_at": obj.get("started_at"), - "succeeded_at": obj.get("succeeded_at"), - "terminated_at": obj.get("terminated_at"), - "xyz_deployment_id": obj.get("xyz_deployment_id"), - } - ) + _obj = cls.model_validate({ + "id": obj.get("id"), + "created_at": obj.get("created_at"), + "updated_at": obj.get("updated_at"), + "organization_id": obj.get("organization_id"), + "app_id": obj.get("app_id"), + "service_id": obj.get("service_id"), + "regional_deployment_id": obj.get("regional_deployment_id"), + "allocation_id": obj.get("allocation_id"), + "type": obj.get("type"), + "replica_index": obj.get("replica_index"), + "region": obj.get("region"), + "datacenter": obj.get("datacenter"), + "hypervisor": obj.get("hypervisor"), + "status": obj.get("status") if obj.get("status") is not None else InstanceStatus.ALLOCATING, + "messages": obj.get("messages"), + "started_at": obj.get("started_at"), + "succeeded_at": obj.get("succeeded_at"), + "terminated_at": obj.get("terminated_at"), + "xyz_deployment_id": obj.get("xyz_deployment_id") + }) return _obj + + diff --git a/koyeb/api/models/instance_availability.py b/koyeb/api/models/instance_availability.py index ab3aba85..fbce4994 100644 --- a/koyeb/api/models/instance_availability.py +++ b/koyeb/api/models/instance_availability.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -23,31 +23,31 @@ from koyeb.api.models.region_availability import RegionAvailability from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class InstanceAvailability(BaseModel): """ InstanceAvailability - """ # noqa: E501 - + """ # noqa: E501 regions: Optional[Dict[str, RegionAvailability]] = None availability: Optional[AvailabilityLevel] = AvailabilityLevel.UNKNOWN __properties: ClassVar[List[str]] = ["regions", "availability"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -64,7 +64,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -77,7 +78,7 @@ def to_dict(self) -> Dict[str, Any]: for _key_regions in self.regions: if self.regions[_key_regions]: _field_dict[_key_regions] = self.regions[_key_regions].to_dict() - _dict["regions"] = _field_dict + _dict['regions'] = _field_dict return _dict @classmethod @@ -89,21 +90,15 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "regions": ( - dict( - (_k, RegionAvailability.from_dict(_v)) - for _k, _v in obj["regions"].items() - ) - if obj.get("regions") is not None - else None - ), - "availability": ( - obj.get("availability") - if obj.get("availability") is not None - else AvailabilityLevel.UNKNOWN - ), - } - ) + _obj = cls.model_validate({ + "regions": dict( + (_k, RegionAvailability.from_dict(_v)) + for _k, _v in obj["regions"].items() + ) + if obj.get("regions") is not None + else None, + "availability": obj.get("availability") if obj.get("availability") is not None else AvailabilityLevel.UNKNOWN + }) return _obj + + diff --git a/koyeb/api/models/instance_event.py b/koyeb/api/models/instance_event.py index fb8ff082..da3ac224 100644 --- a/koyeb/api/models/instance_event.py +++ b/koyeb/api/models/instance_event.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -22,13 +22,12 @@ from typing import Any, ClassVar, Dict, List, Optional from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class InstanceEvent(BaseModel): """ InstanceEvent - """ # noqa: E501 - + """ # noqa: E501 id: Optional[StrictStr] = None when: Optional[datetime] = None organization_id: Optional[StrictStr] = None @@ -36,30 +35,23 @@ class InstanceEvent(BaseModel): type: Optional[StrictStr] = None message: Optional[StrictStr] = None metadata: Optional[Dict[str, Any]] = None - __properties: ClassVar[List[str]] = [ - "id", - "when", - "organization_id", - "instance_id", - "type", - "message", - "metadata", - ] + __properties: ClassVar[List[str]] = ["id", "when", "organization_id", "instance_id", "type", "message", "metadata"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -76,7 +68,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -94,15 +87,15 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "id": obj.get("id"), - "when": obj.get("when"), - "organization_id": obj.get("organization_id"), - "instance_id": obj.get("instance_id"), - "type": obj.get("type"), - "message": obj.get("message"), - "metadata": obj.get("metadata"), - } - ) + _obj = cls.model_validate({ + "id": obj.get("id"), + "when": obj.get("when"), + "organization_id": obj.get("organization_id"), + "instance_id": obj.get("instance_id"), + "type": obj.get("type"), + "message": obj.get("message"), + "metadata": obj.get("metadata") + }) return _obj + + diff --git a/koyeb/api/models/instance_list_item.py b/koyeb/api/models/instance_list_item.py index 982f1b6f..2a3a23ea 100644 --- a/koyeb/api/models/instance_list_item.py +++ b/koyeb/api/models/instance_list_item.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -23,13 +23,12 @@ from koyeb.api.models.instance_status import InstanceStatus from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class InstanceListItem(BaseModel): """ InstanceListItem - """ # noqa: E501 - + """ # noqa: E501 id: Optional[StrictStr] = None created_at: Optional[datetime] = None updated_at: Optional[datetime] = None @@ -44,42 +43,24 @@ class InstanceListItem(BaseModel): datacenter: Optional[StrictStr] = None status: Optional[InstanceStatus] = InstanceStatus.ALLOCATING messages: Optional[List[StrictStr]] = None - xyz_deployment_id: Optional[StrictStr] = Field( - default=None, - description="WARNING: Please don't use the following attribute. Koyeb doesn't guarantee backwards compatible breaking change and reserve the right to completely drop it without notice. USE AT YOUR OWN RISK.", - ) - __properties: ClassVar[List[str]] = [ - "id", - "created_at", - "updated_at", - "organization_id", - "app_id", - "service_id", - "regional_deployment_id", - "allocation_id", - "type", - "replica_index", - "region", - "datacenter", - "status", - "messages", - "xyz_deployment_id", - ] + xyz_deployment_id: Optional[StrictStr] = Field(default=None, description="WARNING: Please don't use the following attribute. Koyeb doesn't guarantee backwards compatible breaking change and reserve the right to completely drop it without notice. USE AT YOUR OWN RISK.") + __properties: ClassVar[List[str]] = ["id", "created_at", "updated_at", "organization_id", "app_id", "service_id", "regional_deployment_id", "allocation_id", "type", "replica_index", "region", "datacenter", "status", "messages", "xyz_deployment_id"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -96,7 +77,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -114,27 +96,23 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "id": obj.get("id"), - "created_at": obj.get("created_at"), - "updated_at": obj.get("updated_at"), - "organization_id": obj.get("organization_id"), - "app_id": obj.get("app_id"), - "service_id": obj.get("service_id"), - "regional_deployment_id": obj.get("regional_deployment_id"), - "allocation_id": obj.get("allocation_id"), - "type": obj.get("type"), - "replica_index": obj.get("replica_index"), - "region": obj.get("region"), - "datacenter": obj.get("datacenter"), - "status": ( - obj.get("status") - if obj.get("status") is not None - else InstanceStatus.ALLOCATING - ), - "messages": obj.get("messages"), - "xyz_deployment_id": obj.get("xyz_deployment_id"), - } - ) + _obj = cls.model_validate({ + "id": obj.get("id"), + "created_at": obj.get("created_at"), + "updated_at": obj.get("updated_at"), + "organization_id": obj.get("organization_id"), + "app_id": obj.get("app_id"), + "service_id": obj.get("service_id"), + "regional_deployment_id": obj.get("regional_deployment_id"), + "allocation_id": obj.get("allocation_id"), + "type": obj.get("type"), + "replica_index": obj.get("replica_index"), + "region": obj.get("region"), + "datacenter": obj.get("datacenter"), + "status": obj.get("status") if obj.get("status") is not None else InstanceStatus.ALLOCATING, + "messages": obj.get("messages"), + "xyz_deployment_id": obj.get("xyz_deployment_id") + }) return _obj + + diff --git a/koyeb/api/models/instance_status.py b/koyeb/api/models/instance_status.py index f1eb8fba..10443720 100644 --- a/koyeb/api/models/instance_status.py +++ b/koyeb/api/models/instance_status.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -26,16 +26,18 @@ class InstanceStatus(str, Enum): """ allowed enum values """ - ALLOCATING = "ALLOCATING" - STARTING = "STARTING" - HEALTHY = "HEALTHY" - UNHEALTHY = "UNHEALTHY" - STOPPING = "STOPPING" - STOPPED = "STOPPED" - ERROR = "ERROR" - SLEEPING = "SLEEPING" + ALLOCATING = 'ALLOCATING' + STARTING = 'STARTING' + HEALTHY = 'HEALTHY' + UNHEALTHY = 'UNHEALTHY' + STOPPING = 'STOPPING' + STOPPED = 'STOPPED' + ERROR = 'ERROR' + SLEEPING = 'SLEEPING' @classmethod def from_json(cls, json_str: str) -> Self: """Create an instance of InstanceStatus from a JSON string""" return cls(json.loads(json_str)) + + diff --git a/koyeb/api/models/instance_usage.py b/koyeb/api/models/instance_usage.py index da5e3ab6..e63b0799 100644 --- a/koyeb/api/models/instance_usage.py +++ b/koyeb/api/models/instance_usage.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -21,30 +21,30 @@ from typing import Any, ClassVar, Dict, List, Optional from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class InstanceUsage(BaseModel): """ InstanceUsage - """ # noqa: E501 - + """ # noqa: E501 duration_seconds: Optional[StrictInt] = None __properties: ClassVar[List[str]] = ["duration_seconds"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -61,7 +61,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -79,5 +80,9 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({"duration_seconds": obj.get("duration_seconds")}) + _obj = cls.model_validate({ + "duration_seconds": obj.get("duration_seconds") + }) return _obj + + diff --git a/koyeb/api/models/instances_summary.py b/koyeb/api/models/instances_summary.py index 7baae165..982376b8 100644 --- a/koyeb/api/models/instances_summary.py +++ b/koyeb/api/models/instances_summary.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -21,31 +21,31 @@ from typing import Any, ClassVar, Dict, List, Optional from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class InstancesSummary(BaseModel): """ InstancesSummary - """ # noqa: E501 - + """ # noqa: E501 total: Optional[StrictStr] = None by_type: Optional[Dict[str, StrictStr]] = None __properties: ClassVar[List[str]] = ["total", "by_type"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -62,7 +62,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -80,7 +81,10 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - {"total": obj.get("total"), "by_type": obj.get("by_type")} - ) + _obj = cls.model_validate({ + "total": obj.get("total"), + "by_type": obj.get("by_type") + }) return _obj + + diff --git a/koyeb/api/models/invite_user_request.py b/koyeb/api/models/invite_user_request.py index f06099c0..6c05f27e 100644 --- a/koyeb/api/models/invite_user_request.py +++ b/koyeb/api/models/invite_user_request.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -21,32 +21,32 @@ from typing import Any, ClassVar, Dict, List, Optional from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class InviteUserRequest(BaseModel): """ InviteUserRequest - """ # noqa: E501 - + """ # noqa: E501 email: Optional[StrictStr] = None name: Optional[StrictStr] = None message: Optional[StrictStr] = None __properties: ClassVar[List[str]] = ["email", "name", "message"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -63,7 +63,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -81,11 +82,11 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "email": obj.get("email"), - "name": obj.get("name"), - "message": obj.get("message"), - } - ) + _obj = cls.model_validate({ + "email": obj.get("email"), + "name": obj.get("name"), + "message": obj.get("message") + }) return _obj + + diff --git a/koyeb/api/models/kgitproxy_branch.py b/koyeb/api/models/kgitproxy_branch.py index 105a572e..6137452d 100644 --- a/koyeb/api/models/kgitproxy_branch.py +++ b/koyeb/api/models/kgitproxy_branch.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -22,46 +22,36 @@ from koyeb.api.models.kgitproxy_repository_provider import KgitproxyRepositoryProvider from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class KgitproxyBranch(BaseModel): """ KgitproxyBranch - """ # noqa: E501 - + """ # noqa: E501 id: Optional[StrictStr] = None organization_id: Optional[StrictStr] = None repository_id: Optional[StrictStr] = None name: Optional[StrictStr] = None is_default: Optional[StrictBool] = None is_protected: Optional[StrictBool] = None - provider: Optional[KgitproxyRepositoryProvider] = ( - KgitproxyRepositoryProvider.INVALID_PROVIDER - ) - __properties: ClassVar[List[str]] = [ - "id", - "organization_id", - "repository_id", - "name", - "is_default", - "is_protected", - "provider", - ] + provider: Optional[KgitproxyRepositoryProvider] = KgitproxyRepositoryProvider.INVALID_PROVIDER + __properties: ClassVar[List[str]] = ["id", "organization_id", "repository_id", "name", "is_default", "is_protected", "provider"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -78,7 +68,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -96,19 +87,15 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "id": obj.get("id"), - "organization_id": obj.get("organization_id"), - "repository_id": obj.get("repository_id"), - "name": obj.get("name"), - "is_default": obj.get("is_default"), - "is_protected": obj.get("is_protected"), - "provider": ( - obj.get("provider") - if obj.get("provider") is not None - else KgitproxyRepositoryProvider.INVALID_PROVIDER - ), - } - ) + _obj = cls.model_validate({ + "id": obj.get("id"), + "organization_id": obj.get("organization_id"), + "repository_id": obj.get("repository_id"), + "name": obj.get("name"), + "is_default": obj.get("is_default"), + "is_protected": obj.get("is_protected"), + "provider": obj.get("provider") if obj.get("provider") is not None else KgitproxyRepositoryProvider.INVALID_PROVIDER + }) return _obj + + diff --git a/koyeb/api/models/kgitproxy_git_hub_repository.py b/koyeb/api/models/kgitproxy_git_hub_repository.py index 05a2db4d..caa94569 100644 --- a/koyeb/api/models/kgitproxy_git_hub_repository.py +++ b/koyeb/api/models/kgitproxy_git_hub_repository.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -21,30 +21,30 @@ from typing import Any, ClassVar, Dict, List, Optional from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class KgitproxyGitHubRepository(BaseModel): """ KgitproxyGitHubRepository - """ # noqa: E501 - + """ # noqa: E501 github_id: Optional[StrictStr] = None __properties: ClassVar[List[str]] = ["github_id"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -61,7 +61,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -79,5 +80,9 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({"github_id": obj.get("github_id")}) + _obj = cls.model_validate({ + "github_id": obj.get("github_id") + }) return _obj + + diff --git a/koyeb/api/models/kgitproxy_github_installation_status.py b/koyeb/api/models/kgitproxy_github_installation_status.py index a534e6de..9d281028 100644 --- a/koyeb/api/models/kgitproxy_github_installation_status.py +++ b/koyeb/api/models/kgitproxy_github_installation_status.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -26,12 +26,14 @@ class KgitproxyGithubInstallationStatus(str, Enum): """ allowed enum values """ - INVALID = "INVALID" - INSTALLED = "INSTALLED" - SUSPENDED = "SUSPENDED" - DELETED = "DELETED" + INVALID = 'INVALID' + INSTALLED = 'INSTALLED' + SUSPENDED = 'SUSPENDED' + DELETED = 'DELETED' @classmethod def from_json(cls, json_str: str) -> Self: """Create an instance of KgitproxyGithubInstallationStatus from a JSON string""" return cls(json.loads(json_str)) + + diff --git a/koyeb/api/models/kgitproxy_indexing_status.py b/koyeb/api/models/kgitproxy_indexing_status.py index 428a53ec..50cf2426 100644 --- a/koyeb/api/models/kgitproxy_indexing_status.py +++ b/koyeb/api/models/kgitproxy_indexing_status.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -26,12 +26,14 @@ class KgitproxyIndexingStatus(str, Enum): """ allowed enum values """ - INVALID_INDEXING_STATUS = "INVALID_INDEXING_STATUS" - NOT_STARTED = "NOT_STARTED" - IN_PROGRESS = "IN_PROGRESS" - COMPLETED = "COMPLETED" + INVALID_INDEXING_STATUS = 'INVALID_INDEXING_STATUS' + NOT_STARTED = 'NOT_STARTED' + IN_PROGRESS = 'IN_PROGRESS' + COMPLETED = 'COMPLETED' @classmethod def from_json(cls, json_str: str) -> Self: """Create an instance of KgitproxyIndexingStatus from a JSON string""" return cls(json.loads(json_str)) + + diff --git a/koyeb/api/models/kgitproxy_list_branches_reply.py b/koyeb/api/models/kgitproxy_list_branches_reply.py index cc892d81..db9af09a 100644 --- a/koyeb/api/models/kgitproxy_list_branches_reply.py +++ b/koyeb/api/models/kgitproxy_list_branches_reply.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -22,41 +22,33 @@ from koyeb.api.models.kgitproxy_branch import KgitproxyBranch from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class KgitproxyListBranchesReply(BaseModel): """ KgitproxyListBranchesReply - """ # noqa: E501 - - branches: Optional[List[KgitproxyBranch]] = Field( - default=None, description="The collection of branches." - ) - limit: Optional[StrictInt] = Field( - default=None, description="The limit in the request." - ) - offset: Optional[StrictInt] = Field( - default=None, description="The offset in the request." - ) - count: Optional[StrictInt] = Field( - default=None, description="The total number of items." - ) + """ # noqa: E501 + branches: Optional[List[KgitproxyBranch]] = Field(default=None, description="The collection of branches.") + limit: Optional[StrictInt] = Field(default=None, description="The limit in the request.") + offset: Optional[StrictInt] = Field(default=None, description="The offset in the request.") + count: Optional[StrictInt] = Field(default=None, description="The total number of items.") __properties: ClassVar[List[str]] = ["branches", "limit", "offset", "count"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -73,7 +65,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -86,7 +79,7 @@ def to_dict(self) -> Dict[str, Any]: for _item_branches in self.branches: if _item_branches: _items.append(_item_branches.to_dict()) - _dict["branches"] = _items + _dict['branches'] = _items return _dict @classmethod @@ -98,16 +91,12 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "branches": ( - [KgitproxyBranch.from_dict(_item) for _item in obj["branches"]] - if obj.get("branches") is not None - else None - ), - "limit": obj.get("limit"), - "offset": obj.get("offset"), - "count": obj.get("count"), - } - ) + _obj = cls.model_validate({ + "branches": [KgitproxyBranch.from_dict(_item) for _item in obj["branches"]] if obj.get("branches") is not None else None, + "limit": obj.get("limit"), + "offset": obj.get("offset"), + "count": obj.get("count") + }) return _obj + + diff --git a/koyeb/api/models/kgitproxy_list_repositories_reply.py b/koyeb/api/models/kgitproxy_list_repositories_reply.py index 07acf144..5294c346 100644 --- a/koyeb/api/models/kgitproxy_list_repositories_reply.py +++ b/koyeb/api/models/kgitproxy_list_repositories_reply.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -22,41 +22,33 @@ from koyeb.api.models.kgitproxy_repository import KgitproxyRepository from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class KgitproxyListRepositoriesReply(BaseModel): """ KgitproxyListRepositoriesReply - """ # noqa: E501 - - repositories: Optional[List[KgitproxyRepository]] = Field( - default=None, description="The collection of repositories." - ) - limit: Optional[StrictInt] = Field( - default=None, description="The limit in the request." - ) - offset: Optional[StrictInt] = Field( - default=None, description="The offset in the request." - ) - count: Optional[StrictInt] = Field( - default=None, description="The total number of items." - ) + """ # noqa: E501 + repositories: Optional[List[KgitproxyRepository]] = Field(default=None, description="The collection of repositories.") + limit: Optional[StrictInt] = Field(default=None, description="The limit in the request.") + offset: Optional[StrictInt] = Field(default=None, description="The offset in the request.") + count: Optional[StrictInt] = Field(default=None, description="The total number of items.") __properties: ClassVar[List[str]] = ["repositories", "limit", "offset", "count"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -73,7 +65,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -86,7 +79,7 @@ def to_dict(self) -> Dict[str, Any]: for _item_repositories in self.repositories: if _item_repositories: _items.append(_item_repositories.to_dict()) - _dict["repositories"] = _items + _dict['repositories'] = _items return _dict @classmethod @@ -98,19 +91,12 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "repositories": ( - [ - KgitproxyRepository.from_dict(_item) - for _item in obj["repositories"] - ] - if obj.get("repositories") is not None - else None - ), - "limit": obj.get("limit"), - "offset": obj.get("offset"), - "count": obj.get("count"), - } - ) + _obj = cls.model_validate({ + "repositories": [KgitproxyRepository.from_dict(_item) for _item in obj["repositories"]] if obj.get("repositories") is not None else None, + "limit": obj.get("limit"), + "offset": obj.get("offset"), + "count": obj.get("count") + }) return _obj + + diff --git a/koyeb/api/models/kgitproxy_repository.py b/koyeb/api/models/kgitproxy_repository.py index 5daab974..da6ce2e7 100644 --- a/koyeb/api/models/kgitproxy_repository.py +++ b/koyeb/api/models/kgitproxy_repository.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -24,13 +24,12 @@ from koyeb.api.models.kgitproxy_repository_provider import KgitproxyRepositoryProvider from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class KgitproxyRepository(BaseModel): """ KgitproxyRepository - """ # noqa: E501 - + """ # noqa: E501 id: Optional[StrictStr] = None organization_id: Optional[StrictStr] = None name: Optional[StrictStr] = None @@ -39,39 +38,26 @@ class KgitproxyRepository(BaseModel): is_private: Optional[StrictBool] = None is_disabled: Optional[StrictBool] = None default_branch: Optional[StrictStr] = None - provider: Optional[KgitproxyRepositoryProvider] = ( - KgitproxyRepositoryProvider.INVALID_PROVIDER - ) + provider: Optional[KgitproxyRepositoryProvider] = KgitproxyRepositoryProvider.INVALID_PROVIDER last_push_date: Optional[datetime] = None github: Optional[KgitproxyGitHubRepository] = None - __properties: ClassVar[List[str]] = [ - "id", - "organization_id", - "name", - "url", - "description", - "is_private", - "is_disabled", - "default_branch", - "provider", - "last_push_date", - "github", - ] + __properties: ClassVar[List[str]] = ["id", "organization_id", "name", "url", "description", "is_private", "is_disabled", "default_branch", "provider", "last_push_date", "github"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -88,7 +74,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -97,7 +84,7 @@ def to_dict(self) -> Dict[str, Any]: ) # override the default output from pydantic by calling `to_dict()` of github if self.github: - _dict["github"] = self.github.to_dict() + _dict['github'] = self.github.to_dict() return _dict @classmethod @@ -109,27 +96,19 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "id": obj.get("id"), - "organization_id": obj.get("organization_id"), - "name": obj.get("name"), - "url": obj.get("url"), - "description": obj.get("description"), - "is_private": obj.get("is_private"), - "is_disabled": obj.get("is_disabled"), - "default_branch": obj.get("default_branch"), - "provider": ( - obj.get("provider") - if obj.get("provider") is not None - else KgitproxyRepositoryProvider.INVALID_PROVIDER - ), - "last_push_date": obj.get("last_push_date"), - "github": ( - KgitproxyGitHubRepository.from_dict(obj["github"]) - if obj.get("github") is not None - else None - ), - } - ) + _obj = cls.model_validate({ + "id": obj.get("id"), + "organization_id": obj.get("organization_id"), + "name": obj.get("name"), + "url": obj.get("url"), + "description": obj.get("description"), + "is_private": obj.get("is_private"), + "is_disabled": obj.get("is_disabled"), + "default_branch": obj.get("default_branch"), + "provider": obj.get("provider") if obj.get("provider") is not None else KgitproxyRepositoryProvider.INVALID_PROVIDER, + "last_push_date": obj.get("last_push_date"), + "github": KgitproxyGitHubRepository.from_dict(obj["github"]) if obj.get("github") is not None else None + }) return _obj + + diff --git a/koyeb/api/models/kgitproxy_repository_provider.py b/koyeb/api/models/kgitproxy_repository_provider.py index 53913b60..123d8ee8 100644 --- a/koyeb/api/models/kgitproxy_repository_provider.py +++ b/koyeb/api/models/kgitproxy_repository_provider.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -26,10 +26,12 @@ class KgitproxyRepositoryProvider(str, Enum): """ allowed enum values """ - INVALID_PROVIDER = "INVALID_PROVIDER" - GITHUB = "GITHUB" + INVALID_PROVIDER = 'INVALID_PROVIDER' + GITHUB = 'GITHUB' @classmethod def from_json(cls, json_str: str) -> Self: """Create an instance of KgitproxyRepositoryProvider from a JSON string""" return cls(json.loads(json_str)) + + diff --git a/koyeb/api/models/ksearch_app.py b/koyeb/api/models/ksearch_app.py index 0d18ba4f..a7dca43b 100644 --- a/koyeb/api/models/ksearch_app.py +++ b/koyeb/api/models/ksearch_app.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -21,32 +21,32 @@ from typing import Any, ClassVar, Dict, List, Optional from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class KsearchApp(BaseModel): """ KsearchApp - """ # noqa: E501 - + """ # noqa: E501 id: Optional[StrictStr] = None organization_id: Optional[StrictStr] = None name: Optional[StrictStr] = None __properties: ClassVar[List[str]] = ["id", "organization_id", "name"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -63,7 +63,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -81,11 +82,11 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "id": obj.get("id"), - "organization_id": obj.get("organization_id"), - "name": obj.get("name"), - } - ) + _obj = cls.model_validate({ + "id": obj.get("id"), + "organization_id": obj.get("organization_id"), + "name": obj.get("name") + }) return _obj + + diff --git a/koyeb/api/models/ksearch_global_deployment.py b/koyeb/api/models/ksearch_global_deployment.py index bf9c1629..61edf644 100644 --- a/koyeb/api/models/ksearch_global_deployment.py +++ b/koyeb/api/models/ksearch_global_deployment.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -21,38 +21,33 @@ from typing import Any, ClassVar, Dict, List, Optional from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class KsearchGlobalDeployment(BaseModel): """ KsearchGlobalDeployment - """ # noqa: E501 - + """ # noqa: E501 id: Optional[StrictStr] = None organization_id: Optional[StrictStr] = None app_id: Optional[StrictStr] = None service_id: Optional[StrictStr] = None - __properties: ClassVar[List[str]] = [ - "id", - "organization_id", - "app_id", - "service_id", - ] + __properties: ClassVar[List[str]] = ["id", "organization_id", "app_id", "service_id"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -69,7 +64,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -87,12 +83,12 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "id": obj.get("id"), - "organization_id": obj.get("organization_id"), - "app_id": obj.get("app_id"), - "service_id": obj.get("service_id"), - } - ) + _obj = cls.model_validate({ + "id": obj.get("id"), + "organization_id": obj.get("organization_id"), + "app_id": obj.get("app_id"), + "service_id": obj.get("service_id") + }) return _obj + + diff --git a/koyeb/api/models/ksearch_instance.py b/koyeb/api/models/ksearch_instance.py index 221d567b..e451f836 100644 --- a/koyeb/api/models/ksearch_instance.py +++ b/koyeb/api/models/ksearch_instance.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -21,40 +21,34 @@ from typing import Any, ClassVar, Dict, List, Optional from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class KsearchInstance(BaseModel): """ KsearchInstance - """ # noqa: E501 - + """ # noqa: E501 id: Optional[StrictStr] = None organization_id: Optional[StrictStr] = None app_id: Optional[StrictStr] = None service_id: Optional[StrictStr] = None allocation_id: Optional[StrictStr] = None - __properties: ClassVar[List[str]] = [ - "id", - "organization_id", - "app_id", - "service_id", - "allocation_id", - ] + __properties: ClassVar[List[str]] = ["id", "organization_id", "app_id", "service_id", "allocation_id"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -71,7 +65,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -89,13 +84,13 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "id": obj.get("id"), - "organization_id": obj.get("organization_id"), - "app_id": obj.get("app_id"), - "service_id": obj.get("service_id"), - "allocation_id": obj.get("allocation_id"), - } - ) + _obj = cls.model_validate({ + "id": obj.get("id"), + "organization_id": obj.get("organization_id"), + "app_id": obj.get("app_id"), + "service_id": obj.get("service_id"), + "allocation_id": obj.get("allocation_id") + }) return _obj + + diff --git a/koyeb/api/models/ksearch_organization.py b/koyeb/api/models/ksearch_organization.py index 7f87d995..5a0da6fd 100644 --- a/koyeb/api/models/ksearch_organization.py +++ b/koyeb/api/models/ksearch_organization.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -21,31 +21,31 @@ from typing import Any, ClassVar, Dict, List, Optional from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class KsearchOrganization(BaseModel): """ KsearchOrganization - """ # noqa: E501 - + """ # noqa: E501 id: Optional[StrictStr] = None name: Optional[StrictStr] = None __properties: ClassVar[List[str]] = ["id", "name"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -62,7 +62,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -80,5 +81,10 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({"id": obj.get("id"), "name": obj.get("name")}) + _obj = cls.model_validate({ + "id": obj.get("id"), + "name": obj.get("name") + }) return _obj + + diff --git a/koyeb/api/models/ksearch_regional_deployment.py b/koyeb/api/models/ksearch_regional_deployment.py index 0c352cdb..1761256b 100644 --- a/koyeb/api/models/ksearch_regional_deployment.py +++ b/koyeb/api/models/ksearch_regional_deployment.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -21,40 +21,34 @@ from typing import Any, ClassVar, Dict, List, Optional from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class KsearchRegionalDeployment(BaseModel): """ KsearchRegionalDeployment - """ # noqa: E501 - + """ # noqa: E501 id: Optional[StrictStr] = None organization_id: Optional[StrictStr] = None app_id: Optional[StrictStr] = None service_id: Optional[StrictStr] = None region: Optional[StrictStr] = None - __properties: ClassVar[List[str]] = [ - "id", - "organization_id", - "app_id", - "service_id", - "region", - ] + __properties: ClassVar[List[str]] = ["id", "organization_id", "app_id", "service_id", "region"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -71,7 +65,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -89,13 +84,13 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "id": obj.get("id"), - "organization_id": obj.get("organization_id"), - "app_id": obj.get("app_id"), - "service_id": obj.get("service_id"), - "region": obj.get("region"), - } - ) + _obj = cls.model_validate({ + "id": obj.get("id"), + "organization_id": obj.get("organization_id"), + "app_id": obj.get("app_id"), + "service_id": obj.get("service_id"), + "region": obj.get("region") + }) return _obj + + diff --git a/koyeb/api/models/ksearch_search_reply.py b/koyeb/api/models/ksearch_search_reply.py index 9a70f216..9b27dc2e 100644 --- a/koyeb/api/models/ksearch_search_reply.py +++ b/koyeb/api/models/ksearch_search_reply.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -28,13 +28,12 @@ from koyeb.api.models.ksearch_user import KsearchUser from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class KsearchSearchReply(BaseModel): """ KsearchSearchReply - """ # noqa: E501 - + """ # noqa: E501 organizations: Optional[List[KsearchOrganization]] = None users: Optional[List[KsearchUser]] = None apps: Optional[List[KsearchApp]] = None @@ -42,30 +41,23 @@ class KsearchSearchReply(BaseModel): global_deployments: Optional[List[KsearchGlobalDeployment]] = None regional_deployments: Optional[List[KsearchRegionalDeployment]] = None instances: Optional[List[KsearchInstance]] = None - __properties: ClassVar[List[str]] = [ - "organizations", - "users", - "apps", - "services", - "global_deployments", - "regional_deployments", - "instances", - ] + __properties: ClassVar[List[str]] = ["organizations", "users", "apps", "services", "global_deployments", "regional_deployments", "instances"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -82,7 +74,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -95,49 +88,49 @@ def to_dict(self) -> Dict[str, Any]: for _item_organizations in self.organizations: if _item_organizations: _items.append(_item_organizations.to_dict()) - _dict["organizations"] = _items + _dict['organizations'] = _items # override the default output from pydantic by calling `to_dict()` of each item in users (list) _items = [] if self.users: for _item_users in self.users: if _item_users: _items.append(_item_users.to_dict()) - _dict["users"] = _items + _dict['users'] = _items # override the default output from pydantic by calling `to_dict()` of each item in apps (list) _items = [] if self.apps: for _item_apps in self.apps: if _item_apps: _items.append(_item_apps.to_dict()) - _dict["apps"] = _items + _dict['apps'] = _items # override the default output from pydantic by calling `to_dict()` of each item in services (list) _items = [] if self.services: for _item_services in self.services: if _item_services: _items.append(_item_services.to_dict()) - _dict["services"] = _items + _dict['services'] = _items # override the default output from pydantic by calling `to_dict()` of each item in global_deployments (list) _items = [] if self.global_deployments: for _item_global_deployments in self.global_deployments: if _item_global_deployments: _items.append(_item_global_deployments.to_dict()) - _dict["global_deployments"] = _items + _dict['global_deployments'] = _items # override the default output from pydantic by calling `to_dict()` of each item in regional_deployments (list) _items = [] if self.regional_deployments: for _item_regional_deployments in self.regional_deployments: if _item_regional_deployments: _items.append(_item_regional_deployments.to_dict()) - _dict["regional_deployments"] = _items + _dict['regional_deployments'] = _items # override the default output from pydantic by calling `to_dict()` of each item in instances (list) _items = [] if self.instances: for _item_instances in self.instances: if _item_instances: _items.append(_item_instances.to_dict()) - _dict["instances"] = _items + _dict['instances'] = _items return _dict @classmethod @@ -149,52 +142,15 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "organizations": ( - [ - KsearchOrganization.from_dict(_item) - for _item in obj["organizations"] - ] - if obj.get("organizations") is not None - else None - ), - "users": ( - [KsearchUser.from_dict(_item) for _item in obj["users"]] - if obj.get("users") is not None - else None - ), - "apps": ( - [KsearchApp.from_dict(_item) for _item in obj["apps"]] - if obj.get("apps") is not None - else None - ), - "services": ( - [KsearchService.from_dict(_item) for _item in obj["services"]] - if obj.get("services") is not None - else None - ), - "global_deployments": ( - [ - KsearchGlobalDeployment.from_dict(_item) - for _item in obj["global_deployments"] - ] - if obj.get("global_deployments") is not None - else None - ), - "regional_deployments": ( - [ - KsearchRegionalDeployment.from_dict(_item) - for _item in obj["regional_deployments"] - ] - if obj.get("regional_deployments") is not None - else None - ), - "instances": ( - [KsearchInstance.from_dict(_item) for _item in obj["instances"]] - if obj.get("instances") is not None - else None - ), - } - ) + _obj = cls.model_validate({ + "organizations": [KsearchOrganization.from_dict(_item) for _item in obj["organizations"]] if obj.get("organizations") is not None else None, + "users": [KsearchUser.from_dict(_item) for _item in obj["users"]] if obj.get("users") is not None else None, + "apps": [KsearchApp.from_dict(_item) for _item in obj["apps"]] if obj.get("apps") is not None else None, + "services": [KsearchService.from_dict(_item) for _item in obj["services"]] if obj.get("services") is not None else None, + "global_deployments": [KsearchGlobalDeployment.from_dict(_item) for _item in obj["global_deployments"]] if obj.get("global_deployments") is not None else None, + "regional_deployments": [KsearchRegionalDeployment.from_dict(_item) for _item in obj["regional_deployments"]] if obj.get("regional_deployments") is not None else None, + "instances": [KsearchInstance.from_dict(_item) for _item in obj["instances"]] if obj.get("instances") is not None else None + }) return _obj + + diff --git a/koyeb/api/models/ksearch_service.py b/koyeb/api/models/ksearch_service.py index 9adfd0f2..b2c9c7d2 100644 --- a/koyeb/api/models/ksearch_service.py +++ b/koyeb/api/models/ksearch_service.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -21,13 +21,12 @@ from typing import Any, ClassVar, Dict, List, Optional from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class KsearchService(BaseModel): """ KsearchService - """ # noqa: E501 - + """ # noqa: E501 id: Optional[StrictStr] = None organization_id: Optional[StrictStr] = None app_id: Optional[StrictStr] = None @@ -35,19 +34,20 @@ class KsearchService(BaseModel): __properties: ClassVar[List[str]] = ["id", "organization_id", "app_id", "name"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -64,7 +64,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -82,12 +83,12 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "id": obj.get("id"), - "organization_id": obj.get("organization_id"), - "app_id": obj.get("app_id"), - "name": obj.get("name"), - } - ) + _obj = cls.model_validate({ + "id": obj.get("id"), + "organization_id": obj.get("organization_id"), + "app_id": obj.get("app_id"), + "name": obj.get("name") + }) return _obj + + diff --git a/koyeb/api/models/ksearch_user.py b/koyeb/api/models/ksearch_user.py index 03458a61..93668832 100644 --- a/koyeb/api/models/ksearch_user.py +++ b/koyeb/api/models/ksearch_user.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -21,13 +21,12 @@ from typing import Any, ClassVar, Dict, List, Optional from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class KsearchUser(BaseModel): """ KsearchUser - """ # noqa: E501 - + """ # noqa: E501 id: Optional[StrictStr] = None email: Optional[StrictStr] = None name: Optional[StrictStr] = None @@ -35,19 +34,20 @@ class KsearchUser(BaseModel): __properties: ClassVar[List[str]] = ["id", "email", "name", "github_user"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -64,7 +64,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -82,12 +83,12 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "id": obj.get("id"), - "email": obj.get("email"), - "name": obj.get("name"), - "github_user": obj.get("github_user"), - } - ) + _obj = cls.model_validate({ + "id": obj.get("id"), + "email": obj.get("email"), + "name": obj.get("name"), + "github_user": obj.get("github_user") + }) return _obj + + diff --git a/koyeb/api/models/lifecycle_quotas.py b/koyeb/api/models/lifecycle_quotas.py new file mode 100644 index 00000000..543beefb --- /dev/null +++ b/koyeb/api/models/lifecycle_quotas.py @@ -0,0 +1,94 @@ +# coding: utf-8 + +""" + Koyeb Rest API + + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictInt +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class LifecycleQuotas(BaseModel): + """ + LifecycleQuotas + """ # noqa: E501 + delete_after_sleep_min: Optional[StrictInt] = None + delete_after_sleep_max: Optional[StrictInt] = None + delete_after_create_min: Optional[StrictInt] = None + delete_after_create_max: Optional[StrictInt] = None + __properties: ClassVar[List[str]] = ["delete_after_sleep_min", "delete_after_sleep_max", "delete_after_create_min", "delete_after_create_max"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of LifecycleQuotas from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of LifecycleQuotas from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "delete_after_sleep_min": obj.get("delete_after_sleep_min"), + "delete_after_sleep_max": obj.get("delete_after_sleep_max"), + "delete_after_create_min": obj.get("delete_after_create_min"), + "delete_after_create_max": obj.get("delete_after_create_max") + }) + return _obj + + diff --git a/koyeb/api/models/list_app_events_reply.py b/koyeb/api/models/list_app_events_reply.py index b97a2065..7e927df6 100644 --- a/koyeb/api/models/list_app_events_reply.py +++ b/koyeb/api/models/list_app_events_reply.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -22,40 +22,34 @@ from koyeb.api.models.app_event import AppEvent from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class ListAppEventsReply(BaseModel): """ ListAppEventsReply - """ # noqa: E501 - + """ # noqa: E501 events: Optional[List[AppEvent]] = None limit: Optional[StrictInt] = None offset: Optional[StrictInt] = None order: Optional[StrictStr] = None has_next: Optional[StrictBool] = None - __properties: ClassVar[List[str]] = [ - "events", - "limit", - "offset", - "order", - "has_next", - ] + __properties: ClassVar[List[str]] = ["events", "limit", "offset", "order", "has_next"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -72,7 +66,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -85,7 +80,7 @@ def to_dict(self) -> Dict[str, Any]: for _item_events in self.events: if _item_events: _items.append(_item_events.to_dict()) - _dict["events"] = _items + _dict['events'] = _items return _dict @classmethod @@ -97,17 +92,13 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "events": ( - [AppEvent.from_dict(_item) for _item in obj["events"]] - if obj.get("events") is not None - else None - ), - "limit": obj.get("limit"), - "offset": obj.get("offset"), - "order": obj.get("order"), - "has_next": obj.get("has_next"), - } - ) + _obj = cls.model_validate({ + "events": [AppEvent.from_dict(_item) for _item in obj["events"]] if obj.get("events") is not None else None, + "limit": obj.get("limit"), + "offset": obj.get("offset"), + "order": obj.get("order"), + "has_next": obj.get("has_next") + }) return _obj + + diff --git a/koyeb/api/models/list_apps_reply.py b/koyeb/api/models/list_apps_reply.py index 1f19caac..70ad1b9a 100644 --- a/koyeb/api/models/list_apps_reply.py +++ b/koyeb/api/models/list_apps_reply.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -22,13 +22,12 @@ from koyeb.api.models.app_list_item import AppListItem from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class ListAppsReply(BaseModel): """ ListAppsReply - """ # noqa: E501 - + """ # noqa: E501 apps: Optional[List[AppListItem]] = None limit: Optional[StrictInt] = None offset: Optional[StrictInt] = None @@ -37,19 +36,20 @@ class ListAppsReply(BaseModel): __properties: ClassVar[List[str]] = ["apps", "limit", "offset", "count", "has_next"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -66,7 +66,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -79,7 +80,7 @@ def to_dict(self) -> Dict[str, Any]: for _item_apps in self.apps: if _item_apps: _items.append(_item_apps.to_dict()) - _dict["apps"] = _items + _dict['apps'] = _items return _dict @classmethod @@ -91,17 +92,13 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "apps": ( - [AppListItem.from_dict(_item) for _item in obj["apps"]] - if obj.get("apps") is not None - else None - ), - "limit": obj.get("limit"), - "offset": obj.get("offset"), - "count": obj.get("count"), - "has_next": obj.get("has_next"), - } - ) + _obj = cls.model_validate({ + "apps": [AppListItem.from_dict(_item) for _item in obj["apps"]] if obj.get("apps") is not None else None, + "limit": obj.get("limit"), + "offset": obj.get("offset"), + "count": obj.get("count"), + "has_next": obj.get("has_next") + }) return _obj + + diff --git a/koyeb/api/models/list_catalog_instances_reply.py b/koyeb/api/models/list_catalog_instances_reply.py index ac6b53fb..7bf6547b 100644 --- a/koyeb/api/models/list_catalog_instances_reply.py +++ b/koyeb/api/models/list_catalog_instances_reply.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -22,13 +22,12 @@ from koyeb.api.models.catalog_instance_list_item import CatalogInstanceListItem from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class ListCatalogInstancesReply(BaseModel): """ ListCatalogInstancesReply - """ # noqa: E501 - + """ # noqa: E501 instances: Optional[List[CatalogInstanceListItem]] = None limit: Optional[StrictInt] = None offset: Optional[StrictInt] = None @@ -36,19 +35,20 @@ class ListCatalogInstancesReply(BaseModel): __properties: ClassVar[List[str]] = ["instances", "limit", "offset", "count"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -65,7 +65,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -78,7 +79,7 @@ def to_dict(self) -> Dict[str, Any]: for _item_instances in self.instances: if _item_instances: _items.append(_item_instances.to_dict()) - _dict["instances"] = _items + _dict['instances'] = _items return _dict @classmethod @@ -90,19 +91,12 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "instances": ( - [ - CatalogInstanceListItem.from_dict(_item) - for _item in obj["instances"] - ] - if obj.get("instances") is not None - else None - ), - "limit": obj.get("limit"), - "offset": obj.get("offset"), - "count": obj.get("count"), - } - ) + _obj = cls.model_validate({ + "instances": [CatalogInstanceListItem.from_dict(_item) for _item in obj["instances"]] if obj.get("instances") is not None else None, + "limit": obj.get("limit"), + "offset": obj.get("offset"), + "count": obj.get("count") + }) return _obj + + diff --git a/koyeb/api/models/list_credentials_reply.py b/koyeb/api/models/list_credentials_reply.py index d5156d1a..0330c7d0 100644 --- a/koyeb/api/models/list_credentials_reply.py +++ b/koyeb/api/models/list_credentials_reply.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -22,13 +22,12 @@ from koyeb.api.models.credential import Credential from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class ListCredentialsReply(BaseModel): """ ListCredentialsReply - """ # noqa: E501 - + """ # noqa: E501 credentials: Optional[List[Credential]] = None limit: Optional[StrictInt] = None offset: Optional[StrictInt] = None @@ -36,19 +35,20 @@ class ListCredentialsReply(BaseModel): __properties: ClassVar[List[str]] = ["credentials", "limit", "offset", "count"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -65,7 +65,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -78,7 +79,7 @@ def to_dict(self) -> Dict[str, Any]: for _item_credentials in self.credentials: if _item_credentials: _items.append(_item_credentials.to_dict()) - _dict["credentials"] = _items + _dict['credentials'] = _items return _dict @classmethod @@ -90,16 +91,12 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "credentials": ( - [Credential.from_dict(_item) for _item in obj["credentials"]] - if obj.get("credentials") is not None - else None - ), - "limit": obj.get("limit"), - "offset": obj.get("offset"), - "count": obj.get("count"), - } - ) + _obj = cls.model_validate({ + "credentials": [Credential.from_dict(_item) for _item in obj["credentials"]] if obj.get("credentials") is not None else None, + "limit": obj.get("limit"), + "offset": obj.get("offset"), + "count": obj.get("count") + }) return _obj + + diff --git a/koyeb/api/models/list_datacenters_reply.py b/koyeb/api/models/list_datacenters_reply.py index e913ddad..b0db3e93 100644 --- a/koyeb/api/models/list_datacenters_reply.py +++ b/koyeb/api/models/list_datacenters_reply.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -22,30 +22,30 @@ from koyeb.api.models.datacenter_list_item import DatacenterListItem from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class ListDatacentersReply(BaseModel): """ ListDatacentersReply - """ # noqa: E501 - + """ # noqa: E501 datacenters: Optional[List[DatacenterListItem]] = None __properties: ClassVar[List[str]] = ["datacenters"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -62,7 +62,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -75,7 +76,7 @@ def to_dict(self) -> Dict[str, Any]: for _item_datacenters in self.datacenters: if _item_datacenters: _items.append(_item_datacenters.to_dict()) - _dict["datacenters"] = _items + _dict['datacenters'] = _items return _dict @classmethod @@ -87,16 +88,9 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "datacenters": ( - [ - DatacenterListItem.from_dict(_item) - for _item in obj["datacenters"] - ] - if obj.get("datacenters") is not None - else None - ) - } - ) + _obj = cls.model_validate({ + "datacenters": [DatacenterListItem.from_dict(_item) for _item in obj["datacenters"]] if obj.get("datacenters") is not None else None + }) return _obj + + diff --git a/koyeb/api/models/list_deployment_events_reply.py b/koyeb/api/models/list_deployment_events_reply.py index 0a0c3335..6cfc89da 100644 --- a/koyeb/api/models/list_deployment_events_reply.py +++ b/koyeb/api/models/list_deployment_events_reply.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -22,40 +22,34 @@ from koyeb.api.models.deployment_event import DeploymentEvent from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class ListDeploymentEventsReply(BaseModel): """ ListDeploymentEventsReply - """ # noqa: E501 - + """ # noqa: E501 events: Optional[List[DeploymentEvent]] = None limit: Optional[StrictInt] = None offset: Optional[StrictInt] = None order: Optional[StrictStr] = None has_next: Optional[StrictBool] = None - __properties: ClassVar[List[str]] = [ - "events", - "limit", - "offset", - "order", - "has_next", - ] + __properties: ClassVar[List[str]] = ["events", "limit", "offset", "order", "has_next"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -72,7 +66,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -85,7 +80,7 @@ def to_dict(self) -> Dict[str, Any]: for _item_events in self.events: if _item_events: _items.append(_item_events.to_dict()) - _dict["events"] = _items + _dict['events'] = _items return _dict @classmethod @@ -97,17 +92,13 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "events": ( - [DeploymentEvent.from_dict(_item) for _item in obj["events"]] - if obj.get("events") is not None - else None - ), - "limit": obj.get("limit"), - "offset": obj.get("offset"), - "order": obj.get("order"), - "has_next": obj.get("has_next"), - } - ) + _obj = cls.model_validate({ + "events": [DeploymentEvent.from_dict(_item) for _item in obj["events"]] if obj.get("events") is not None else None, + "limit": obj.get("limit"), + "offset": obj.get("offset"), + "order": obj.get("order"), + "has_next": obj.get("has_next") + }) return _obj + + diff --git a/koyeb/api/models/list_deployments_reply.py b/koyeb/api/models/list_deployments_reply.py index f072b58c..ca0a6975 100644 --- a/koyeb/api/models/list_deployments_reply.py +++ b/koyeb/api/models/list_deployments_reply.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -22,40 +22,34 @@ from koyeb.api.models.deployment_list_item import DeploymentListItem from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class ListDeploymentsReply(BaseModel): """ ListDeploymentsReply - """ # noqa: E501 - + """ # noqa: E501 deployments: Optional[List[DeploymentListItem]] = None limit: Optional[StrictInt] = None offset: Optional[StrictInt] = None count: Optional[StrictInt] = None has_next: Optional[StrictBool] = None - __properties: ClassVar[List[str]] = [ - "deployments", - "limit", - "offset", - "count", - "has_next", - ] + __properties: ClassVar[List[str]] = ["deployments", "limit", "offset", "count", "has_next"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -72,7 +66,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -85,7 +80,7 @@ def to_dict(self) -> Dict[str, Any]: for _item_deployments in self.deployments: if _item_deployments: _items.append(_item_deployments.to_dict()) - _dict["deployments"] = _items + _dict['deployments'] = _items return _dict @classmethod @@ -97,20 +92,13 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "deployments": ( - [ - DeploymentListItem.from_dict(_item) - for _item in obj["deployments"] - ] - if obj.get("deployments") is not None - else None - ), - "limit": obj.get("limit"), - "offset": obj.get("offset"), - "count": obj.get("count"), - "has_next": obj.get("has_next"), - } - ) + _obj = cls.model_validate({ + "deployments": [DeploymentListItem.from_dict(_item) for _item in obj["deployments"]] if obj.get("deployments") is not None else None, + "limit": obj.get("limit"), + "offset": obj.get("offset"), + "count": obj.get("count"), + "has_next": obj.get("has_next") + }) return _obj + + diff --git a/koyeb/api/models/list_domains_reply.py b/koyeb/api/models/list_domains_reply.py index 26cbab01..1554e3e4 100644 --- a/koyeb/api/models/list_domains_reply.py +++ b/koyeb/api/models/list_domains_reply.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -22,13 +22,12 @@ from koyeb.api.models.domain import Domain from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class ListDomainsReply(BaseModel): """ ListDomainsReply - """ # noqa: E501 - + """ # noqa: E501 domains: Optional[List[Domain]] = None limit: Optional[StrictInt] = None offset: Optional[StrictInt] = None @@ -36,19 +35,20 @@ class ListDomainsReply(BaseModel): __properties: ClassVar[List[str]] = ["domains", "limit", "offset", "count"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -65,7 +65,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -78,7 +79,7 @@ def to_dict(self) -> Dict[str, Any]: for _item_domains in self.domains: if _item_domains: _items.append(_item_domains.to_dict()) - _dict["domains"] = _items + _dict['domains'] = _items return _dict @classmethod @@ -90,16 +91,12 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "domains": ( - [Domain.from_dict(_item) for _item in obj["domains"]] - if obj.get("domains") is not None - else None - ), - "limit": obj.get("limit"), - "offset": obj.get("offset"), - "count": obj.get("count"), - } - ) + _obj = cls.model_validate({ + "domains": [Domain.from_dict(_item) for _item in obj["domains"]] if obj.get("domains") is not None else None, + "limit": obj.get("limit"), + "offset": obj.get("offset"), + "count": obj.get("count") + }) return _obj + + diff --git a/koyeb/api/models/list_instance_events_reply.py b/koyeb/api/models/list_instance_events_reply.py index 29fc8ead..8575504a 100644 --- a/koyeb/api/models/list_instance_events_reply.py +++ b/koyeb/api/models/list_instance_events_reply.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -22,40 +22,34 @@ from koyeb.api.models.instance_event import InstanceEvent from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class ListInstanceEventsReply(BaseModel): """ ListInstanceEventsReply - """ # noqa: E501 - + """ # noqa: E501 events: Optional[List[InstanceEvent]] = None limit: Optional[StrictInt] = None offset: Optional[StrictInt] = None order: Optional[StrictStr] = None has_next: Optional[StrictBool] = None - __properties: ClassVar[List[str]] = [ - "events", - "limit", - "offset", - "order", - "has_next", - ] + __properties: ClassVar[List[str]] = ["events", "limit", "offset", "order", "has_next"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -72,7 +66,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -85,7 +80,7 @@ def to_dict(self) -> Dict[str, Any]: for _item_events in self.events: if _item_events: _items.append(_item_events.to_dict()) - _dict["events"] = _items + _dict['events'] = _items return _dict @classmethod @@ -97,17 +92,13 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "events": ( - [InstanceEvent.from_dict(_item) for _item in obj["events"]] - if obj.get("events") is not None - else None - ), - "limit": obj.get("limit"), - "offset": obj.get("offset"), - "order": obj.get("order"), - "has_next": obj.get("has_next"), - } - ) + _obj = cls.model_validate({ + "events": [InstanceEvent.from_dict(_item) for _item in obj["events"]] if obj.get("events") is not None else None, + "limit": obj.get("limit"), + "offset": obj.get("offset"), + "order": obj.get("order"), + "has_next": obj.get("has_next") + }) return _obj + + diff --git a/koyeb/api/models/list_instances_reply.py b/koyeb/api/models/list_instances_reply.py index 65414566..9cdf3fc0 100644 --- a/koyeb/api/models/list_instances_reply.py +++ b/koyeb/api/models/list_instances_reply.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -22,40 +22,34 @@ from koyeb.api.models.instance_list_item import InstanceListItem from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class ListInstancesReply(BaseModel): """ ListInstancesReply - """ # noqa: E501 - + """ # noqa: E501 instances: Optional[List[InstanceListItem]] = None limit: Optional[StrictInt] = None offset: Optional[StrictInt] = None count: Optional[StrictInt] = None order: Optional[StrictStr] = None - __properties: ClassVar[List[str]] = [ - "instances", - "limit", - "offset", - "count", - "order", - ] + __properties: ClassVar[List[str]] = ["instances", "limit", "offset", "count", "order"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -72,7 +66,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -85,7 +80,7 @@ def to_dict(self) -> Dict[str, Any]: for _item_instances in self.instances: if _item_instances: _items.append(_item_instances.to_dict()) - _dict["instances"] = _items + _dict['instances'] = _items return _dict @classmethod @@ -97,17 +92,13 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "instances": ( - [InstanceListItem.from_dict(_item) for _item in obj["instances"]] - if obj.get("instances") is not None - else None - ), - "limit": obj.get("limit"), - "offset": obj.get("offset"), - "count": obj.get("count"), - "order": obj.get("order"), - } - ) + _obj = cls.model_validate({ + "instances": [InstanceListItem.from_dict(_item) for _item in obj["instances"]] if obj.get("instances") is not None else None, + "limit": obj.get("limit"), + "offset": obj.get("offset"), + "count": obj.get("count"), + "order": obj.get("order") + }) return _obj + + diff --git a/koyeb/api/models/list_organization_invitations_reply.py b/koyeb/api/models/list_organization_invitations_reply.py index d4346c53..a20cd41c 100644 --- a/koyeb/api/models/list_organization_invitations_reply.py +++ b/koyeb/api/models/list_organization_invitations_reply.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -22,13 +22,12 @@ from koyeb.api.models.organization_invitation import OrganizationInvitation from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class ListOrganizationInvitationsReply(BaseModel): """ ListOrganizationInvitationsReply - """ # noqa: E501 - + """ # noqa: E501 invitations: Optional[List[OrganizationInvitation]] = None limit: Optional[StrictInt] = None offset: Optional[StrictInt] = None @@ -36,19 +35,20 @@ class ListOrganizationInvitationsReply(BaseModel): __properties: ClassVar[List[str]] = ["invitations", "limit", "offset", "count"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -65,7 +65,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -78,7 +79,7 @@ def to_dict(self) -> Dict[str, Any]: for _item_invitations in self.invitations: if _item_invitations: _items.append(_item_invitations.to_dict()) - _dict["invitations"] = _items + _dict['invitations'] = _items return _dict @classmethod @@ -90,19 +91,12 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "invitations": ( - [ - OrganizationInvitation.from_dict(_item) - for _item in obj["invitations"] - ] - if obj.get("invitations") is not None - else None - ), - "limit": obj.get("limit"), - "offset": obj.get("offset"), - "count": obj.get("count"), - } - ) + _obj = cls.model_validate({ + "invitations": [OrganizationInvitation.from_dict(_item) for _item in obj["invitations"]] if obj.get("invitations") is not None else None, + "limit": obj.get("limit"), + "offset": obj.get("offset"), + "count": obj.get("count") + }) return _obj + + diff --git a/koyeb/api/models/list_organization_members_reply.py b/koyeb/api/models/list_organization_members_reply.py index 8e3a8874..aaf8f406 100644 --- a/koyeb/api/models/list_organization_members_reply.py +++ b/koyeb/api/models/list_organization_members_reply.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -22,13 +22,12 @@ from koyeb.api.models.organization_member import OrganizationMember from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class ListOrganizationMembersReply(BaseModel): """ ListOrganizationMembersReply - """ # noqa: E501 - + """ # noqa: E501 members: Optional[List[OrganizationMember]] = None limit: Optional[StrictInt] = None offset: Optional[StrictInt] = None @@ -36,19 +35,20 @@ class ListOrganizationMembersReply(BaseModel): __properties: ClassVar[List[str]] = ["members", "limit", "offset", "count"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -65,7 +65,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -78,7 +79,7 @@ def to_dict(self) -> Dict[str, Any]: for _item_members in self.members: if _item_members: _items.append(_item_members.to_dict()) - _dict["members"] = _items + _dict['members'] = _items return _dict @classmethod @@ -90,16 +91,12 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "members": ( - [OrganizationMember.from_dict(_item) for _item in obj["members"]] - if obj.get("members") is not None - else None - ), - "limit": obj.get("limit"), - "offset": obj.get("offset"), - "count": obj.get("count"), - } - ) + _obj = cls.model_validate({ + "members": [OrganizationMember.from_dict(_item) for _item in obj["members"]] if obj.get("members") is not None else None, + "limit": obj.get("limit"), + "offset": obj.get("offset"), + "count": obj.get("count") + }) return _obj + + diff --git a/koyeb/api/models/list_payment_methods_reply.py b/koyeb/api/models/list_payment_methods_reply.py index a66bf8a7..fa5d21d4 100644 --- a/koyeb/api/models/list_payment_methods_reply.py +++ b/koyeb/api/models/list_payment_methods_reply.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -22,13 +22,12 @@ from koyeb.api.models.payment_method import PaymentMethod from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class ListPaymentMethodsReply(BaseModel): """ ListPaymentMethodsReply - """ # noqa: E501 - + """ # noqa: E501 payment_methods: Optional[List[PaymentMethod]] = None limit: Optional[StrictInt] = None offset: Optional[StrictInt] = None @@ -36,19 +35,20 @@ class ListPaymentMethodsReply(BaseModel): __properties: ClassVar[List[str]] = ["payment_methods", "limit", "offset", "count"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -65,7 +65,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -78,7 +79,7 @@ def to_dict(self) -> Dict[str, Any]: for _item_payment_methods in self.payment_methods: if _item_payment_methods: _items.append(_item_payment_methods.to_dict()) - _dict["payment_methods"] = _items + _dict['payment_methods'] = _items return _dict @classmethod @@ -90,16 +91,12 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "payment_methods": ( - [PaymentMethod.from_dict(_item) for _item in obj["payment_methods"]] - if obj.get("payment_methods") is not None - else None - ), - "limit": obj.get("limit"), - "offset": obj.get("offset"), - "count": obj.get("count"), - } - ) + _obj = cls.model_validate({ + "payment_methods": [PaymentMethod.from_dict(_item) for _item in obj["payment_methods"]] if obj.get("payment_methods") is not None else None, + "limit": obj.get("limit"), + "offset": obj.get("offset"), + "count": obj.get("count") + }) return _obj + + diff --git a/koyeb/api/models/list_persistent_volume_events_reply.py b/koyeb/api/models/list_persistent_volume_events_reply.py index a512f9ab..eddda864 100644 --- a/koyeb/api/models/list_persistent_volume_events_reply.py +++ b/koyeb/api/models/list_persistent_volume_events_reply.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -22,40 +22,34 @@ from koyeb.api.models.persistent_volume_event import PersistentVolumeEvent from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class ListPersistentVolumeEventsReply(BaseModel): """ ListPersistentVolumeEventsReply - """ # noqa: E501 - + """ # noqa: E501 events: Optional[List[PersistentVolumeEvent]] = None limit: Optional[StrictInt] = None offset: Optional[StrictInt] = None order: Optional[StrictStr] = None has_next: Optional[StrictBool] = None - __properties: ClassVar[List[str]] = [ - "events", - "limit", - "offset", - "order", - "has_next", - ] + __properties: ClassVar[List[str]] = ["events", "limit", "offset", "order", "has_next"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -72,7 +66,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -85,7 +80,7 @@ def to_dict(self) -> Dict[str, Any]: for _item_events in self.events: if _item_events: _items.append(_item_events.to_dict()) - _dict["events"] = _items + _dict['events'] = _items return _dict @classmethod @@ -97,17 +92,13 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "events": ( - [PersistentVolumeEvent.from_dict(_item) for _item in obj["events"]] - if obj.get("events") is not None - else None - ), - "limit": obj.get("limit"), - "offset": obj.get("offset"), - "order": obj.get("order"), - "has_next": obj.get("has_next"), - } - ) + _obj = cls.model_validate({ + "events": [PersistentVolumeEvent.from_dict(_item) for _item in obj["events"]] if obj.get("events") is not None else None, + "limit": obj.get("limit"), + "offset": obj.get("offset"), + "order": obj.get("order"), + "has_next": obj.get("has_next") + }) return _obj + + diff --git a/koyeb/api/models/list_persistent_volumes_reply.py b/koyeb/api/models/list_persistent_volumes_reply.py index 933c770d..bf65a92d 100644 --- a/koyeb/api/models/list_persistent_volumes_reply.py +++ b/koyeb/api/models/list_persistent_volumes_reply.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -22,13 +22,12 @@ from koyeb.api.models.persistent_volume import PersistentVolume from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class ListPersistentVolumesReply(BaseModel): """ ListPersistentVolumesReply - """ # noqa: E501 - + """ # noqa: E501 volumes: Optional[List[PersistentVolume]] = None limit: Optional[StrictInt] = None offset: Optional[StrictInt] = None @@ -36,19 +35,20 @@ class ListPersistentVolumesReply(BaseModel): __properties: ClassVar[List[str]] = ["volumes", "limit", "offset", "has_next"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -65,7 +65,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -78,7 +79,7 @@ def to_dict(self) -> Dict[str, Any]: for _item_volumes in self.volumes: if _item_volumes: _items.append(_item_volumes.to_dict()) - _dict["volumes"] = _items + _dict['volumes'] = _items return _dict @classmethod @@ -90,16 +91,12 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "volumes": ( - [PersistentVolume.from_dict(_item) for _item in obj["volumes"]] - if obj.get("volumes") is not None - else None - ), - "limit": obj.get("limit"), - "offset": obj.get("offset"), - "has_next": obj.get("has_next"), - } - ) + _obj = cls.model_validate({ + "volumes": [PersistentVolume.from_dict(_item) for _item in obj["volumes"]] if obj.get("volumes") is not None else None, + "limit": obj.get("limit"), + "offset": obj.get("offset"), + "has_next": obj.get("has_next") + }) return _obj + + diff --git a/koyeb/api/models/list_projects_reply.py b/koyeb/api/models/list_projects_reply.py new file mode 100644 index 00000000..39a7204f --- /dev/null +++ b/koyeb/api/models/list_projects_reply.py @@ -0,0 +1,100 @@ +# coding: utf-8 + +""" + Koyeb Rest API + + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictInt +from typing import Any, ClassVar, Dict, List, Optional +from koyeb.api.models.project import Project +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class ListProjectsReply(BaseModel): + """ + ListProjectsReply + """ # noqa: E501 + projects: Optional[List[Project]] = None + limit: Optional[StrictInt] = None + offset: Optional[StrictInt] = None + __properties: ClassVar[List[str]] = ["projects", "limit", "offset"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ListProjectsReply from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in projects (list) + _items = [] + if self.projects: + for _item_projects in self.projects: + if _item_projects: + _items.append(_item_projects.to_dict()) + _dict['projects'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ListProjectsReply from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "projects": [Project.from_dict(_item) for _item in obj["projects"]] if obj.get("projects") is not None else None, + "limit": obj.get("limit"), + "offset": obj.get("offset") + }) + return _obj + + diff --git a/koyeb/api/models/list_regional_deployment_events_reply.py b/koyeb/api/models/list_regional_deployment_events_reply.py index 0c520e09..de103b11 100644 --- a/koyeb/api/models/list_regional_deployment_events_reply.py +++ b/koyeb/api/models/list_regional_deployment_events_reply.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -22,40 +22,34 @@ from koyeb.api.models.regional_deployment_event import RegionalDeploymentEvent from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class ListRegionalDeploymentEventsReply(BaseModel): """ ListRegionalDeploymentEventsReply - """ # noqa: E501 - + """ # noqa: E501 events: Optional[List[RegionalDeploymentEvent]] = None limit: Optional[StrictInt] = None offset: Optional[StrictInt] = None order: Optional[StrictStr] = None has_next: Optional[StrictBool] = None - __properties: ClassVar[List[str]] = [ - "events", - "limit", - "offset", - "order", - "has_next", - ] + __properties: ClassVar[List[str]] = ["events", "limit", "offset", "order", "has_next"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -72,7 +66,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -85,7 +80,7 @@ def to_dict(self) -> Dict[str, Any]: for _item_events in self.events: if _item_events: _items.append(_item_events.to_dict()) - _dict["events"] = _items + _dict['events'] = _items return _dict @classmethod @@ -97,20 +92,13 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "events": ( - [ - RegionalDeploymentEvent.from_dict(_item) - for _item in obj["events"] - ] - if obj.get("events") is not None - else None - ), - "limit": obj.get("limit"), - "offset": obj.get("offset"), - "order": obj.get("order"), - "has_next": obj.get("has_next"), - } - ) + _obj = cls.model_validate({ + "events": [RegionalDeploymentEvent.from_dict(_item) for _item in obj["events"]] if obj.get("events") is not None else None, + "limit": obj.get("limit"), + "offset": obj.get("offset"), + "order": obj.get("order"), + "has_next": obj.get("has_next") + }) return _obj + + diff --git a/koyeb/api/models/list_regional_deployments_reply.py b/koyeb/api/models/list_regional_deployments_reply.py index e5ddf263..5a9bc37b 100644 --- a/koyeb/api/models/list_regional_deployments_reply.py +++ b/koyeb/api/models/list_regional_deployments_reply.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -22,40 +22,34 @@ from koyeb.api.models.regional_deployment_list_item import RegionalDeploymentListItem from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class ListRegionalDeploymentsReply(BaseModel): """ ListRegionalDeploymentsReply - """ # noqa: E501 - + """ # noqa: E501 regional_deployments: Optional[List[RegionalDeploymentListItem]] = None limit: Optional[StrictInt] = None offset: Optional[StrictInt] = None count: Optional[StrictInt] = None has_next: Optional[StrictBool] = None - __properties: ClassVar[List[str]] = [ - "regional_deployments", - "limit", - "offset", - "count", - "has_next", - ] + __properties: ClassVar[List[str]] = ["regional_deployments", "limit", "offset", "count", "has_next"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -72,7 +66,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -85,7 +80,7 @@ def to_dict(self) -> Dict[str, Any]: for _item_regional_deployments in self.regional_deployments: if _item_regional_deployments: _items.append(_item_regional_deployments.to_dict()) - _dict["regional_deployments"] = _items + _dict['regional_deployments'] = _items return _dict @classmethod @@ -97,20 +92,13 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "regional_deployments": ( - [ - RegionalDeploymentListItem.from_dict(_item) - for _item in obj["regional_deployments"] - ] - if obj.get("regional_deployments") is not None - else None - ), - "limit": obj.get("limit"), - "offset": obj.get("offset"), - "count": obj.get("count"), - "has_next": obj.get("has_next"), - } - ) + _obj = cls.model_validate({ + "regional_deployments": [RegionalDeploymentListItem.from_dict(_item) for _item in obj["regional_deployments"]] if obj.get("regional_deployments") is not None else None, + "limit": obj.get("limit"), + "offset": obj.get("offset"), + "count": obj.get("count"), + "has_next": obj.get("has_next") + }) return _obj + + diff --git a/koyeb/api/models/list_regions_reply.py b/koyeb/api/models/list_regions_reply.py index 68c90606..4f69df6f 100644 --- a/koyeb/api/models/list_regions_reply.py +++ b/koyeb/api/models/list_regions_reply.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -22,13 +22,12 @@ from koyeb.api.models.region_list_item import RegionListItem from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class ListRegionsReply(BaseModel): """ ListRegionsReply - """ # noqa: E501 - + """ # noqa: E501 regions: Optional[List[RegionListItem]] = None limit: Optional[StrictInt] = None offset: Optional[StrictInt] = None @@ -36,19 +35,20 @@ class ListRegionsReply(BaseModel): __properties: ClassVar[List[str]] = ["regions", "limit", "offset", "count"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -65,7 +65,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -78,7 +79,7 @@ def to_dict(self) -> Dict[str, Any]: for _item_regions in self.regions: if _item_regions: _items.append(_item_regions.to_dict()) - _dict["regions"] = _items + _dict['regions'] = _items return _dict @classmethod @@ -90,16 +91,12 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "regions": ( - [RegionListItem.from_dict(_item) for _item in obj["regions"]] - if obj.get("regions") is not None - else None - ), - "limit": obj.get("limit"), - "offset": obj.get("offset"), - "count": obj.get("count"), - } - ) + _obj = cls.model_validate({ + "regions": [RegionListItem.from_dict(_item) for _item in obj["regions"]] if obj.get("regions") is not None else None, + "limit": obj.get("limit"), + "offset": obj.get("offset"), + "count": obj.get("count") + }) return _obj + + diff --git a/koyeb/api/models/list_secrets_reply.py b/koyeb/api/models/list_secrets_reply.py index 0a3efd39..e90b9460 100644 --- a/koyeb/api/models/list_secrets_reply.py +++ b/koyeb/api/models/list_secrets_reply.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -22,13 +22,12 @@ from koyeb.api.models.secret import Secret from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class ListSecretsReply(BaseModel): """ ListSecretsReply - """ # noqa: E501 - + """ # noqa: E501 secrets: Optional[List[Secret]] = None limit: Optional[StrictInt] = None offset: Optional[StrictInt] = None @@ -36,19 +35,20 @@ class ListSecretsReply(BaseModel): __properties: ClassVar[List[str]] = ["secrets", "limit", "offset", "count"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -65,7 +65,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -78,7 +79,7 @@ def to_dict(self) -> Dict[str, Any]: for _item_secrets in self.secrets: if _item_secrets: _items.append(_item_secrets.to_dict()) - _dict["secrets"] = _items + _dict['secrets'] = _items return _dict @classmethod @@ -90,16 +91,12 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "secrets": ( - [Secret.from_dict(_item) for _item in obj["secrets"]] - if obj.get("secrets") is not None - else None - ), - "limit": obj.get("limit"), - "offset": obj.get("offset"), - "count": obj.get("count"), - } - ) + _obj = cls.model_validate({ + "secrets": [Secret.from_dict(_item) for _item in obj["secrets"]] if obj.get("secrets") is not None else None, + "limit": obj.get("limit"), + "offset": obj.get("offset"), + "count": obj.get("count") + }) return _obj + + diff --git a/koyeb/api/models/list_service_events_reply.py b/koyeb/api/models/list_service_events_reply.py index 7d4d9321..f75bf1cc 100644 --- a/koyeb/api/models/list_service_events_reply.py +++ b/koyeb/api/models/list_service_events_reply.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -22,40 +22,34 @@ from koyeb.api.models.service_event import ServiceEvent from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class ListServiceEventsReply(BaseModel): """ ListServiceEventsReply - """ # noqa: E501 - + """ # noqa: E501 events: Optional[List[ServiceEvent]] = None limit: Optional[StrictInt] = None offset: Optional[StrictInt] = None order: Optional[StrictStr] = None has_next: Optional[StrictBool] = None - __properties: ClassVar[List[str]] = [ - "events", - "limit", - "offset", - "order", - "has_next", - ] + __properties: ClassVar[List[str]] = ["events", "limit", "offset", "order", "has_next"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -72,7 +66,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -85,7 +80,7 @@ def to_dict(self) -> Dict[str, Any]: for _item_events in self.events: if _item_events: _items.append(_item_events.to_dict()) - _dict["events"] = _items + _dict['events'] = _items return _dict @classmethod @@ -97,17 +92,13 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "events": ( - [ServiceEvent.from_dict(_item) for _item in obj["events"]] - if obj.get("events") is not None - else None - ), - "limit": obj.get("limit"), - "offset": obj.get("offset"), - "order": obj.get("order"), - "has_next": obj.get("has_next"), - } - ) + _obj = cls.model_validate({ + "events": [ServiceEvent.from_dict(_item) for _item in obj["events"]] if obj.get("events") is not None else None, + "limit": obj.get("limit"), + "offset": obj.get("offset"), + "order": obj.get("order"), + "has_next": obj.get("has_next") + }) return _obj + + diff --git a/koyeb/api/models/list_services_reply.py b/koyeb/api/models/list_services_reply.py index 20392061..f1e0b3ea 100644 --- a/koyeb/api/models/list_services_reply.py +++ b/koyeb/api/models/list_services_reply.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -22,40 +22,34 @@ from koyeb.api.models.service_list_item import ServiceListItem from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class ListServicesReply(BaseModel): """ ListServicesReply - """ # noqa: E501 - + """ # noqa: E501 services: Optional[List[ServiceListItem]] = None limit: Optional[StrictInt] = None offset: Optional[StrictInt] = None count: Optional[StrictInt] = None has_next: Optional[StrictBool] = None - __properties: ClassVar[List[str]] = [ - "services", - "limit", - "offset", - "count", - "has_next", - ] + __properties: ClassVar[List[str]] = ["services", "limit", "offset", "count", "has_next"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -72,7 +66,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -85,7 +80,7 @@ def to_dict(self) -> Dict[str, Any]: for _item_services in self.services: if _item_services: _items.append(_item_services.to_dict()) - _dict["services"] = _items + _dict['services'] = _items return _dict @classmethod @@ -97,17 +92,13 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "services": ( - [ServiceListItem.from_dict(_item) for _item in obj["services"]] - if obj.get("services") is not None - else None - ), - "limit": obj.get("limit"), - "offset": obj.get("offset"), - "count": obj.get("count"), - "has_next": obj.get("has_next"), - } - ) + _obj = cls.model_validate({ + "services": [ServiceListItem.from_dict(_item) for _item in obj["services"]] if obj.get("services") is not None else None, + "limit": obj.get("limit"), + "offset": obj.get("offset"), + "count": obj.get("count"), + "has_next": obj.get("has_next") + }) return _obj + + diff --git a/koyeb/api/models/list_snapshots_reply.py b/koyeb/api/models/list_snapshots_reply.py index 7c047a4e..43d2e698 100644 --- a/koyeb/api/models/list_snapshots_reply.py +++ b/koyeb/api/models/list_snapshots_reply.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -22,13 +22,12 @@ from koyeb.api.models.snapshot import Snapshot from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class ListSnapshotsReply(BaseModel): """ ListSnapshotsReply - """ # noqa: E501 - + """ # noqa: E501 snapshots: Optional[List[Snapshot]] = None limit: Optional[StrictInt] = None offset: Optional[StrictInt] = None @@ -36,19 +35,20 @@ class ListSnapshotsReply(BaseModel): __properties: ClassVar[List[str]] = ["snapshots", "limit", "offset", "has_next"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -65,7 +65,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -78,7 +79,7 @@ def to_dict(self) -> Dict[str, Any]: for _item_snapshots in self.snapshots: if _item_snapshots: _items.append(_item_snapshots.to_dict()) - _dict["snapshots"] = _items + _dict['snapshots'] = _items return _dict @classmethod @@ -90,16 +91,12 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "snapshots": ( - [Snapshot.from_dict(_item) for _item in obj["snapshots"]] - if obj.get("snapshots") is not None - else None - ), - "limit": obj.get("limit"), - "offset": obj.get("offset"), - "has_next": obj.get("has_next"), - } - ) + _obj = cls.model_validate({ + "snapshots": [Snapshot.from_dict(_item) for _item in obj["snapshots"]] if obj.get("snapshots") is not None else None, + "limit": obj.get("limit"), + "offset": obj.get("offset"), + "has_next": obj.get("has_next") + }) return _obj + + diff --git a/koyeb/api/models/list_usage_reply.py b/koyeb/api/models/list_usage_reply.py index 1a860c66..aeedbfea 100644 --- a/koyeb/api/models/list_usage_reply.py +++ b/koyeb/api/models/list_usage_reply.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -22,30 +22,30 @@ from koyeb.api.models.catalog_usage import CatalogUsage from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class ListUsageReply(BaseModel): """ ListUsageReply - """ # noqa: E501 - + """ # noqa: E501 usage: Optional[CatalogUsage] = None __properties: ClassVar[List[str]] = ["usage"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -62,7 +62,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -71,7 +72,7 @@ def to_dict(self) -> Dict[str, Any]: ) # override the default output from pydantic by calling `to_dict()` of usage if self.usage: - _dict["usage"] = self.usage.to_dict() + _dict['usage'] = self.usage.to_dict() return _dict @classmethod @@ -83,13 +84,9 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "usage": ( - CatalogUsage.from_dict(obj["usage"]) - if obj.get("usage") is not None - else None - ) - } - ) + _obj = cls.model_validate({ + "usage": CatalogUsage.from_dict(obj["usage"]) if obj.get("usage") is not None else None + }) return _obj + + diff --git a/koyeb/api/models/list_user_organization_invitations_reply.py b/koyeb/api/models/list_user_organization_invitations_reply.py index 6bd0adfa..c1227061 100644 --- a/koyeb/api/models/list_user_organization_invitations_reply.py +++ b/koyeb/api/models/list_user_organization_invitations_reply.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -22,13 +22,12 @@ from koyeb.api.models.organization_invitation import OrganizationInvitation from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class ListUserOrganizationInvitationsReply(BaseModel): """ ListUserOrganizationInvitationsReply - """ # noqa: E501 - + """ # noqa: E501 invitations: Optional[List[OrganizationInvitation]] = None limit: Optional[StrictInt] = None offset: Optional[StrictInt] = None @@ -36,19 +35,20 @@ class ListUserOrganizationInvitationsReply(BaseModel): __properties: ClassVar[List[str]] = ["invitations", "limit", "offset", "count"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -65,7 +65,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -78,7 +79,7 @@ def to_dict(self) -> Dict[str, Any]: for _item_invitations in self.invitations: if _item_invitations: _items.append(_item_invitations.to_dict()) - _dict["invitations"] = _items + _dict['invitations'] = _items return _dict @classmethod @@ -90,19 +91,12 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "invitations": ( - [ - OrganizationInvitation.from_dict(_item) - for _item in obj["invitations"] - ] - if obj.get("invitations") is not None - else None - ), - "limit": obj.get("limit"), - "offset": obj.get("offset"), - "count": obj.get("count"), - } - ) + _obj = cls.model_validate({ + "invitations": [OrganizationInvitation.from_dict(_item) for _item in obj["invitations"]] if obj.get("invitations") is not None else None, + "limit": obj.get("limit"), + "offset": obj.get("offset"), + "count": obj.get("count") + }) return _obj + + diff --git a/koyeb/api/models/list_user_organizations_reply.py b/koyeb/api/models/list_user_organizations_reply.py index ad411166..6a2f76b7 100644 --- a/koyeb/api/models/list_user_organizations_reply.py +++ b/koyeb/api/models/list_user_organizations_reply.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -22,13 +22,12 @@ from koyeb.api.models.organization import Organization from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class ListUserOrganizationsReply(BaseModel): """ ListUserOrganizationsReply - """ # noqa: E501 - + """ # noqa: E501 organizations: Optional[List[Organization]] = None limit: Optional[StrictInt] = None offset: Optional[StrictInt] = None @@ -36,19 +35,20 @@ class ListUserOrganizationsReply(BaseModel): __properties: ClassVar[List[str]] = ["organizations", "limit", "offset", "has_next"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -65,7 +65,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -78,7 +79,7 @@ def to_dict(self) -> Dict[str, Any]: for _item_organizations in self.organizations: if _item_organizations: _items.append(_item_organizations.to_dict()) - _dict["organizations"] = _items + _dict['organizations'] = _items return _dict @classmethod @@ -90,16 +91,12 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "organizations": ( - [Organization.from_dict(_item) for _item in obj["organizations"]] - if obj.get("organizations") is not None - else None - ), - "limit": obj.get("limit"), - "offset": obj.get("offset"), - "has_next": obj.get("has_next"), - } - ) + _obj = cls.model_validate({ + "organizations": [Organization.from_dict(_item) for _item in obj["organizations"]] if obj.get("organizations") is not None else None, + "limit": obj.get("limit"), + "offset": obj.get("offset"), + "has_next": obj.get("has_next") + }) return _obj + + diff --git a/koyeb/api/models/log_entry.py b/koyeb/api/models/log_entry.py index 3c1230c5..ab3e7573 100644 --- a/koyeb/api/models/log_entry.py +++ b/koyeb/api/models/log_entry.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -22,32 +22,32 @@ from typing import Any, ClassVar, Dict, List, Optional from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class LogEntry(BaseModel): """ LogEntry - """ # noqa: E501 - + """ # noqa: E501 msg: Optional[StrictStr] = None created_at: Optional[datetime] = None labels: Optional[Dict[str, Any]] = None __properties: ClassVar[List[str]] = ["msg", "created_at", "labels"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -64,7 +64,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -82,11 +83,11 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "msg": obj.get("msg"), - "created_at": obj.get("created_at"), - "labels": obj.get("labels"), - } - ) + _obj = cls.model_validate({ + "msg": obj.get("msg"), + "created_at": obj.get("created_at"), + "labels": obj.get("labels") + }) return _obj + + diff --git a/koyeb/api/models/login_method_reply.py b/koyeb/api/models/login_method_reply.py index be1d0a1b..58fb6b3d 100644 --- a/koyeb/api/models/login_method_reply.py +++ b/koyeb/api/models/login_method_reply.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -22,30 +22,30 @@ from koyeb.api.models.login_method_reply_method import LoginMethodReplyMethod from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class LoginMethodReply(BaseModel): """ LoginMethodReply - """ # noqa: E501 - + """ # noqa: E501 method: Optional[LoginMethodReplyMethod] = LoginMethodReplyMethod.KOYEB __properties: ClassVar[List[str]] = ["method"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -62,7 +62,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -80,13 +81,9 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "method": ( - obj.get("method") - if obj.get("method") is not None - else LoginMethodReplyMethod.KOYEB - ) - } - ) + _obj = cls.model_validate({ + "method": obj.get("method") if obj.get("method") is not None else LoginMethodReplyMethod.KOYEB + }) return _obj + + diff --git a/koyeb/api/models/login_method_reply_method.py b/koyeb/api/models/login_method_reply_method.py index ae71be68..a27e8297 100644 --- a/koyeb/api/models/login_method_reply_method.py +++ b/koyeb/api/models/login_method_reply_method.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -26,10 +26,12 @@ class LoginMethodReplyMethod(str, Enum): """ allowed enum values """ - KOYEB = "KOYEB" - WORKOS = "WORKOS" + KOYEB = 'KOYEB' + WORKOS = 'WORKOS' @classmethod def from_json(cls, json_str: str) -> Self: """Create an instance of LoginMethodReplyMethod from a JSON string""" return cls(json.loads(json_str)) + + diff --git a/koyeb/api/models/login_reply.py b/koyeb/api/models/login_reply.py index 873a4c24..31e2c958 100644 --- a/koyeb/api/models/login_reply.py +++ b/koyeb/api/models/login_reply.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -22,30 +22,30 @@ from koyeb.api.models.token import Token from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class LoginReply(BaseModel): """ LoginReply - """ # noqa: E501 - + """ # noqa: E501 token: Optional[Token] = None __properties: ClassVar[List[str]] = ["token"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -62,7 +62,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -71,7 +72,7 @@ def to_dict(self) -> Dict[str, Any]: ) # override the default output from pydantic by calling `to_dict()` of token if self.token: - _dict["token"] = self.token.to_dict() + _dict['token'] = self.token.to_dict() return _dict @classmethod @@ -83,13 +84,9 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "token": ( - Token.from_dict(obj["token"]) - if obj.get("token") is not None - else None - ) - } - ) + _obj = cls.model_validate({ + "token": Token.from_dict(obj["token"]) if obj.get("token") is not None else None + }) return _obj + + diff --git a/koyeb/api/models/login_request.py b/koyeb/api/models/login_request.py index aab9b26b..8d89a070 100644 --- a/koyeb/api/models/login_request.py +++ b/koyeb/api/models/login_request.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -21,32 +21,32 @@ from typing import Any, ClassVar, Dict, List, Optional from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class LoginRequest(BaseModel): """ LoginRequest - """ # noqa: E501 - + """ # noqa: E501 email: Optional[StrictStr] = None password: Optional[StrictStr] = None organization_id: Optional[StrictStr] = None __properties: ClassVar[List[str]] = ["email", "password", "organization_id"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -63,7 +63,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -81,11 +82,11 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "email": obj.get("email"), - "password": obj.get("password"), - "organization_id": obj.get("organization_id"), - } - ) + _obj = cls.model_validate({ + "email": obj.get("email"), + "password": obj.get("password"), + "organization_id": obj.get("organization_id") + }) return _obj + + diff --git a/koyeb/api/models/manage_reply.py b/koyeb/api/models/manage_reply.py index d803618e..b997db88 100644 --- a/koyeb/api/models/manage_reply.py +++ b/koyeb/api/models/manage_reply.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -21,30 +21,30 @@ from typing import Any, ClassVar, Dict, List, Optional from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class ManageReply(BaseModel): """ ManageReply - """ # noqa: E501 - + """ # noqa: E501 url: Optional[StrictStr] = None __properties: ClassVar[List[str]] = ["url"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -61,7 +61,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -79,5 +80,9 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({"url": obj.get("url")}) + _obj = cls.model_validate({ + "url": obj.get("url") + }) return _obj + + diff --git a/koyeb/api/models/manual_service_scaling.py b/koyeb/api/models/manual_service_scaling.py new file mode 100644 index 00000000..4de83018 --- /dev/null +++ b/koyeb/api/models/manual_service_scaling.py @@ -0,0 +1,90 @@ +# coding: utf-8 + +""" + Koyeb Rest API + + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class ManualServiceScaling(BaseModel): + """ + ManualServiceScaling + """ # noqa: E501 + scopes: Optional[List[StrictStr]] = None + instances: Optional[StrictInt] = None + __properties: ClassVar[List[str]] = ["scopes", "instances"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ManualServiceScaling from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ManualServiceScaling from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "scopes": obj.get("scopes"), + "instances": obj.get("instances") + }) + return _obj + + diff --git a/koyeb/api/models/members_summary.py b/koyeb/api/models/members_summary.py index 5048ac70..740fd1f3 100644 --- a/koyeb/api/models/members_summary.py +++ b/koyeb/api/models/members_summary.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -21,31 +21,31 @@ from typing import Any, ClassVar, Dict, List, Optional from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class MembersSummary(BaseModel): """ MembersSummary - """ # noqa: E501 - + """ # noqa: E501 total: Optional[StrictStr] = None invitations_by_status: Optional[Dict[str, StrictStr]] = None __properties: ClassVar[List[str]] = ["total", "invitations_by_status"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -62,7 +62,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -80,10 +81,10 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "total": obj.get("total"), - "invitations_by_status": obj.get("invitations_by_status"), - } - ) + _obj = cls.model_validate({ + "total": obj.get("total"), + "invitations_by_status": obj.get("invitations_by_status") + }) return _obj + + diff --git a/koyeb/api/models/metric_name.py b/koyeb/api/models/metric_name.py index 330a64f8..34f66cf4 100644 --- a/koyeb/api/models/metric_name.py +++ b/koyeb/api/models/metric_name.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -26,18 +26,20 @@ class MetricName(str, Enum): """ allowed enum values """ - UNKNOWN = "UNKNOWN" - CPU_TOTAL_PERCENT = "CPU_TOTAL_PERCENT" - MEM_RSS = "MEM_RSS" - HTTP_THROUGHPUT = "HTTP_THROUGHPUT" - HTTP_RESPONSE_TIME_50_P = "HTTP_RESPONSE_TIME_50P" - HTTP_RESPONSE_TIME_90_P = "HTTP_RESPONSE_TIME_90P" - HTTP_RESPONSE_TIME_99_P = "HTTP_RESPONSE_TIME_99P" - HTTP_RESPONSE_TIME_MAX = "HTTP_RESPONSE_TIME_MAX" - PUBLIC_DATA_TRANSFER_IN = "PUBLIC_DATA_TRANSFER_IN" - PUBLIC_DATA_TRANSFER_OUT = "PUBLIC_DATA_TRANSFER_OUT" + UNKNOWN = 'UNKNOWN' + CPU_TOTAL_PERCENT = 'CPU_TOTAL_PERCENT' + MEM_RSS = 'MEM_RSS' + HTTP_THROUGHPUT = 'HTTP_THROUGHPUT' + HTTP_RESPONSE_TIME_50_P = 'HTTP_RESPONSE_TIME_50P' + HTTP_RESPONSE_TIME_90_P = 'HTTP_RESPONSE_TIME_90P' + HTTP_RESPONSE_TIME_99_P = 'HTTP_RESPONSE_TIME_99P' + HTTP_RESPONSE_TIME_MAX = 'HTTP_RESPONSE_TIME_MAX' + PUBLIC_DATA_TRANSFER_IN = 'PUBLIC_DATA_TRANSFER_IN' + PUBLIC_DATA_TRANSFER_OUT = 'PUBLIC_DATA_TRANSFER_OUT' @classmethod def from_json(cls, json_str: str) -> Self: """Create an instance of MetricName from a JSON string""" return cls(json.loads(json_str)) + + diff --git a/koyeb/api/models/neon_postgres_database.py b/koyeb/api/models/neon_postgres_database.py index 70aa0c6f..efd11e35 100644 --- a/koyeb/api/models/neon_postgres_database.py +++ b/koyeb/api/models/neon_postgres_database.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -19,48 +19,38 @@ from pydantic import BaseModel, ConfigDict, StrictInt, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from koyeb.api.models.neon_postgres_database_neon_database import ( - NeonPostgresDatabaseNeonDatabase, -) -from koyeb.api.models.neon_postgres_database_neon_role import ( - NeonPostgresDatabaseNeonRole, -) +from koyeb.api.models.neon_postgres_database_neon_database import NeonPostgresDatabaseNeonDatabase +from koyeb.api.models.neon_postgres_database_neon_role import NeonPostgresDatabaseNeonRole from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class NeonPostgresDatabase(BaseModel): """ NeonPostgresDatabase - """ # noqa: E501 - + """ # noqa: E501 pg_version: Optional[StrictInt] = None region: Optional[StrictStr] = None instance_type: Optional[StrictStr] = None roles: Optional[List[NeonPostgresDatabaseNeonRole]] = None databases: Optional[List[NeonPostgresDatabaseNeonDatabase]] = None - __properties: ClassVar[List[str]] = [ - "pg_version", - "region", - "instance_type", - "roles", - "databases", - ] + __properties: ClassVar[List[str]] = ["pg_version", "region", "instance_type", "roles", "databases"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -77,7 +67,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -90,14 +81,14 @@ def to_dict(self) -> Dict[str, Any]: for _item_roles in self.roles: if _item_roles: _items.append(_item_roles.to_dict()) - _dict["roles"] = _items + _dict['roles'] = _items # override the default output from pydantic by calling `to_dict()` of each item in databases (list) _items = [] if self.databases: for _item_databases in self.databases: if _item_databases: _items.append(_item_databases.to_dict()) - _dict["databases"] = _items + _dict['databases'] = _items return _dict @classmethod @@ -109,27 +100,13 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "pg_version": obj.get("pg_version"), - "region": obj.get("region"), - "instance_type": obj.get("instance_type"), - "roles": ( - [ - NeonPostgresDatabaseNeonRole.from_dict(_item) - for _item in obj["roles"] - ] - if obj.get("roles") is not None - else None - ), - "databases": ( - [ - NeonPostgresDatabaseNeonDatabase.from_dict(_item) - for _item in obj["databases"] - ] - if obj.get("databases") is not None - else None - ), - } - ) + _obj = cls.model_validate({ + "pg_version": obj.get("pg_version"), + "region": obj.get("region"), + "instance_type": obj.get("instance_type"), + "roles": [NeonPostgresDatabaseNeonRole.from_dict(_item) for _item in obj["roles"]] if obj.get("roles") is not None else None, + "databases": [NeonPostgresDatabaseNeonDatabase.from_dict(_item) for _item in obj["databases"]] if obj.get("databases") is not None else None + }) return _obj + + diff --git a/koyeb/api/models/neon_postgres_database_deployment_metadata.py b/koyeb/api/models/neon_postgres_database_deployment_metadata.py index f1220e99..a17b3601 100644 --- a/koyeb/api/models/neon_postgres_database_deployment_metadata.py +++ b/koyeb/api/models/neon_postgres_database_deployment_metadata.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -21,30 +21,30 @@ from typing import Any, ClassVar, Dict, List, Optional from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class NeonPostgresDatabaseDeploymentMetadata(BaseModel): """ NeonPostgresDatabaseDeploymentMetadata - """ # noqa: E501 - + """ # noqa: E501 reset_role_passwords: Optional[List[StrictStr]] = None __properties: ClassVar[List[str]] = ["reset_role_passwords"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -61,7 +61,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -79,7 +80,9 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - {"reset_role_passwords": obj.get("reset_role_passwords")} - ) + _obj = cls.model_validate({ + "reset_role_passwords": obj.get("reset_role_passwords") + }) return _obj + + diff --git a/koyeb/api/models/neon_postgres_database_neon_database.py b/koyeb/api/models/neon_postgres_database_neon_database.py index d41f7292..43beaaa5 100644 --- a/koyeb/api/models/neon_postgres_database_neon_database.py +++ b/koyeb/api/models/neon_postgres_database_neon_database.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -21,31 +21,31 @@ from typing import Any, ClassVar, Dict, List, Optional from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class NeonPostgresDatabaseNeonDatabase(BaseModel): """ NeonPostgresDatabaseNeonDatabase - """ # noqa: E501 - + """ # noqa: E501 name: Optional[StrictStr] = None owner: Optional[StrictStr] = None __properties: ClassVar[List[str]] = ["name", "owner"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -62,7 +62,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -80,5 +81,10 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({"name": obj.get("name"), "owner": obj.get("owner")}) + _obj = cls.model_validate({ + "name": obj.get("name"), + "owner": obj.get("owner") + }) return _obj + + diff --git a/koyeb/api/models/neon_postgres_database_neon_role.py b/koyeb/api/models/neon_postgres_database_neon_role.py index 63ad74b7..bfd2d65a 100644 --- a/koyeb/api/models/neon_postgres_database_neon_role.py +++ b/koyeb/api/models/neon_postgres_database_neon_role.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -21,31 +21,31 @@ from typing import Any, ClassVar, Dict, List, Optional from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class NeonPostgresDatabaseNeonRole(BaseModel): """ NeonPostgresDatabaseNeonRole - """ # noqa: E501 - + """ # noqa: E501 name: Optional[StrictStr] = None secret: Optional[StrictStr] = None __properties: ClassVar[List[str]] = ["name", "secret"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -62,7 +62,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -80,7 +81,10 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - {"name": obj.get("name"), "secret": obj.get("secret")} - ) + _obj = cls.model_validate({ + "name": obj.get("name"), + "secret": obj.get("secret") + }) return _obj + + diff --git a/koyeb/api/models/neon_postgres_summary.py b/koyeb/api/models/neon_postgres_summary.py index 3bd24e36..8994a6b2 100644 --- a/koyeb/api/models/neon_postgres_summary.py +++ b/koyeb/api/models/neon_postgres_summary.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -21,31 +21,31 @@ from typing import Any, ClassVar, Dict, List, Optional from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class NeonPostgresSummary(BaseModel): """ NeonPostgresSummary - """ # noqa: E501 - + """ # noqa: E501 total: Optional[StrictStr] = None by_instance_type: Optional[Dict[str, StrictStr]] = None __properties: ClassVar[List[str]] = ["total", "by_instance_type"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -62,7 +62,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -80,7 +81,10 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - {"total": obj.get("total"), "by_instance_type": obj.get("by_instance_type")} - ) + _obj = cls.model_validate({ + "total": obj.get("total"), + "by_instance_type": obj.get("by_instance_type") + }) return _obj + + diff --git a/koyeb/api/models/next_invoice_reply.py b/koyeb/api/models/next_invoice_reply.py index 8219505c..e8124577 100644 --- a/koyeb/api/models/next_invoice_reply.py +++ b/koyeb/api/models/next_invoice_reply.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -23,32 +23,32 @@ from koyeb.api.models.next_invoice_reply_line import NextInvoiceReplyLine from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class NextInvoiceReply(BaseModel): """ NextInvoiceReply - """ # noqa: E501 - + """ # noqa: E501 stripe_invoice: Optional[Dict[str, Any]] = None lines: Optional[List[NextInvoiceReplyLine]] = None discounts: Optional[List[NextInvoiceReplyDiscount]] = None __properties: ClassVar[List[str]] = ["stripe_invoice", "lines", "discounts"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -65,7 +65,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -78,14 +79,14 @@ def to_dict(self) -> Dict[str, Any]: for _item_lines in self.lines: if _item_lines: _items.append(_item_lines.to_dict()) - _dict["lines"] = _items + _dict['lines'] = _items # override the default output from pydantic by calling `to_dict()` of each item in discounts (list) _items = [] if self.discounts: for _item_discounts in self.discounts: if _item_discounts: _items.append(_item_discounts.to_dict()) - _dict["discounts"] = _items + _dict['discounts'] = _items return _dict @classmethod @@ -97,22 +98,11 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "stripe_invoice": obj.get("stripe_invoice"), - "lines": ( - [NextInvoiceReplyLine.from_dict(_item) for _item in obj["lines"]] - if obj.get("lines") is not None - else None - ), - "discounts": ( - [ - NextInvoiceReplyDiscount.from_dict(_item) - for _item in obj["discounts"] - ] - if obj.get("discounts") is not None - else None - ), - } - ) + _obj = cls.model_validate({ + "stripe_invoice": obj.get("stripe_invoice"), + "lines": [NextInvoiceReplyLine.from_dict(_item) for _item in obj["lines"]] if obj.get("lines") is not None else None, + "discounts": [NextInvoiceReplyDiscount.from_dict(_item) for _item in obj["discounts"]] if obj.get("discounts") is not None else None + }) return _obj + + diff --git a/koyeb/api/models/next_invoice_reply_discount.py b/koyeb/api/models/next_invoice_reply_discount.py index 7f365cfa..42c92b6c 100644 --- a/koyeb/api/models/next_invoice_reply_discount.py +++ b/koyeb/api/models/next_invoice_reply_discount.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -19,39 +19,35 @@ from pydantic import BaseModel, ConfigDict, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from koyeb.api.models.next_invoice_reply_discount_type import ( - NextInvoiceReplyDiscountType, -) +from koyeb.api.models.next_invoice_reply_discount_type import NextInvoiceReplyDiscountType from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class NextInvoiceReplyDiscount(BaseModel): """ NextInvoiceReplyDiscount - """ # noqa: E501 - - type: Optional[NextInvoiceReplyDiscountType] = ( - NextInvoiceReplyDiscountType.PERCENT_OFF - ) + """ # noqa: E501 + type: Optional[NextInvoiceReplyDiscountType] = NextInvoiceReplyDiscountType.PERCENT_OFF name: Optional[StrictStr] = None amount: Optional[StrictStr] = None __properties: ClassVar[List[str]] = ["type", "name", "amount"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -68,7 +64,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -86,15 +83,11 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "type": ( - obj.get("type") - if obj.get("type") is not None - else NextInvoiceReplyDiscountType.PERCENT_OFF - ), - "name": obj.get("name"), - "amount": obj.get("amount"), - } - ) + _obj = cls.model_validate({ + "type": obj.get("type") if obj.get("type") is not None else NextInvoiceReplyDiscountType.PERCENT_OFF, + "name": obj.get("name"), + "amount": obj.get("amount") + }) return _obj + + diff --git a/koyeb/api/models/next_invoice_reply_discount_type.py b/koyeb/api/models/next_invoice_reply_discount_type.py index baad6a52..482f2960 100644 --- a/koyeb/api/models/next_invoice_reply_discount_type.py +++ b/koyeb/api/models/next_invoice_reply_discount_type.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -26,10 +26,12 @@ class NextInvoiceReplyDiscountType(str, Enum): """ allowed enum values """ - PERCENT_OFF = "PERCENT_OFF" - AMOUNT_OFF = "AMOUNT_OFF" + PERCENT_OFF = 'PERCENT_OFF' + AMOUNT_OFF = 'AMOUNT_OFF' @classmethod def from_json(cls, json_str: str) -> Self: """Create an instance of NextInvoiceReplyDiscountType from a JSON string""" return cls(json.loads(json_str)) + + diff --git a/koyeb/api/models/next_invoice_reply_line.py b/koyeb/api/models/next_invoice_reply_line.py index 14e80e2d..d9938c9d 100644 --- a/koyeb/api/models/next_invoice_reply_line.py +++ b/koyeb/api/models/next_invoice_reply_line.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -23,40 +23,34 @@ from koyeb.api.models.next_invoice_reply_line_price import NextInvoiceReplyLinePrice from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class NextInvoiceReplyLine(BaseModel): """ NextInvoiceReplyLine - """ # noqa: E501 - + """ # noqa: E501 amount_excluding_tax: Optional[StrictInt] = None period: Optional[NextInvoiceReplyLinePeriod] = None plan_nickname: Optional[StrictStr] = None price: Optional[NextInvoiceReplyLinePrice] = None quantity: Optional[StrictInt] = None - __properties: ClassVar[List[str]] = [ - "amount_excluding_tax", - "period", - "plan_nickname", - "price", - "quantity", - ] + __properties: ClassVar[List[str]] = ["amount_excluding_tax", "period", "plan_nickname", "price", "quantity"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -73,7 +67,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -82,10 +77,10 @@ def to_dict(self) -> Dict[str, Any]: ) # override the default output from pydantic by calling `to_dict()` of period if self.period: - _dict["period"] = self.period.to_dict() + _dict['period'] = self.period.to_dict() # override the default output from pydantic by calling `to_dict()` of price if self.price: - _dict["price"] = self.price.to_dict() + _dict['price'] = self.price.to_dict() return _dict @classmethod @@ -97,21 +92,13 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "amount_excluding_tax": obj.get("amount_excluding_tax"), - "period": ( - NextInvoiceReplyLinePeriod.from_dict(obj["period"]) - if obj.get("period") is not None - else None - ), - "plan_nickname": obj.get("plan_nickname"), - "price": ( - NextInvoiceReplyLinePrice.from_dict(obj["price"]) - if obj.get("price") is not None - else None - ), - "quantity": obj.get("quantity"), - } - ) + _obj = cls.model_validate({ + "amount_excluding_tax": obj.get("amount_excluding_tax"), + "period": NextInvoiceReplyLinePeriod.from_dict(obj["period"]) if obj.get("period") is not None else None, + "plan_nickname": obj.get("plan_nickname"), + "price": NextInvoiceReplyLinePrice.from_dict(obj["price"]) if obj.get("price") is not None else None, + "quantity": obj.get("quantity") + }) return _obj + + diff --git a/koyeb/api/models/next_invoice_reply_line_period.py b/koyeb/api/models/next_invoice_reply_line_period.py index 30c528a0..df3334a7 100644 --- a/koyeb/api/models/next_invoice_reply_line_period.py +++ b/koyeb/api/models/next_invoice_reply_line_period.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -22,31 +22,31 @@ from typing import Any, ClassVar, Dict, List, Optional from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class NextInvoiceReplyLinePeriod(BaseModel): """ NextInvoiceReplyLinePeriod - """ # noqa: E501 - + """ # noqa: E501 start: Optional[datetime] = None end: Optional[datetime] = None __properties: ClassVar[List[str]] = ["start", "end"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -63,7 +63,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -81,5 +82,10 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({"start": obj.get("start"), "end": obj.get("end")}) + _obj = cls.model_validate({ + "start": obj.get("start"), + "end": obj.get("end") + }) return _obj + + diff --git a/koyeb/api/models/next_invoice_reply_line_price.py b/koyeb/api/models/next_invoice_reply_line_price.py index b26b1a8c..9ef340d7 100644 --- a/koyeb/api/models/next_invoice_reply_line_price.py +++ b/koyeb/api/models/next_invoice_reply_line_price.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -21,30 +21,30 @@ from typing import Any, ClassVar, Dict, List, Optional, Union from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class NextInvoiceReplyLinePrice(BaseModel): """ NextInvoiceReplyLinePrice - """ # noqa: E501 - + """ # noqa: E501 unit_amount_decimal: Optional[Union[StrictFloat, StrictInt]] = None __properties: ClassVar[List[str]] = ["unit_amount_decimal"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -61,7 +61,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -79,7 +80,9 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - {"unit_amount_decimal": obj.get("unit_amount_decimal")} - ) + _obj = cls.model_validate({ + "unit_amount_decimal": obj.get("unit_amount_decimal") + }) return _obj + + diff --git a/koyeb/api/models/notification.py b/koyeb/api/models/notification.py index cbd97965..28bf86c4 100644 --- a/koyeb/api/models/notification.py +++ b/koyeb/api/models/notification.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -23,40 +23,34 @@ from koyeb.api.models.activity import Activity from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class Notification(BaseModel): """ Notification - """ # noqa: E501 - + """ # noqa: E501 id: Optional[StrictStr] = None activity: Optional[Activity] = None is_read: Optional[StrictBool] = None is_seen: Optional[StrictBool] = None created_at: Optional[datetime] = None - __properties: ClassVar[List[str]] = [ - "id", - "activity", - "is_read", - "is_seen", - "created_at", - ] + __properties: ClassVar[List[str]] = ["id", "activity", "is_read", "is_seen", "created_at"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -73,7 +67,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -82,7 +77,7 @@ def to_dict(self) -> Dict[str, Any]: ) # override the default output from pydantic by calling `to_dict()` of activity if self.activity: - _dict["activity"] = self.activity.to_dict() + _dict['activity'] = self.activity.to_dict() return _dict @classmethod @@ -94,17 +89,13 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "id": obj.get("id"), - "activity": ( - Activity.from_dict(obj["activity"]) - if obj.get("activity") is not None - else None - ), - "is_read": obj.get("is_read"), - "is_seen": obj.get("is_seen"), - "created_at": obj.get("created_at"), - } - ) + _obj = cls.model_validate({ + "id": obj.get("id"), + "activity": Activity.from_dict(obj["activity"]) if obj.get("activity") is not None else None, + "is_read": obj.get("is_read"), + "is_seen": obj.get("is_seen"), + "created_at": obj.get("created_at") + }) return _obj + + diff --git a/koyeb/api/models/notification_list.py b/koyeb/api/models/notification_list.py index 70caedaa..0509e421 100644 --- a/koyeb/api/models/notification_list.py +++ b/koyeb/api/models/notification_list.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -22,13 +22,12 @@ from koyeb.api.models.notification import Notification from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class NotificationList(BaseModel): """ NotificationList - """ # noqa: E501 - + """ # noqa: E501 notifications: Optional[List[Notification]] = None limit: Optional[StrictInt] = None offset: Optional[StrictInt] = None @@ -37,31 +36,23 @@ class NotificationList(BaseModel): is_seen: Optional[StrictBool] = None unread: Optional[StrictInt] = None unseen: Optional[StrictInt] = None - __properties: ClassVar[List[str]] = [ - "notifications", - "limit", - "offset", - "count", - "is_read", - "is_seen", - "unread", - "unseen", - ] + __properties: ClassVar[List[str]] = ["notifications", "limit", "offset", "count", "is_read", "is_seen", "unread", "unseen"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -78,7 +69,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -91,7 +83,7 @@ def to_dict(self) -> Dict[str, Any]: for _item_notifications in self.notifications: if _item_notifications: _items.append(_item_notifications.to_dict()) - _dict["notifications"] = _items + _dict['notifications'] = _items return _dict @classmethod @@ -103,20 +95,16 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "notifications": ( - [Notification.from_dict(_item) for _item in obj["notifications"]] - if obj.get("notifications") is not None - else None - ), - "limit": obj.get("limit"), - "offset": obj.get("offset"), - "count": obj.get("count"), - "is_read": obj.get("is_read"), - "is_seen": obj.get("is_seen"), - "unread": obj.get("unread"), - "unseen": obj.get("unseen"), - } - ) + _obj = cls.model_validate({ + "notifications": [Notification.from_dict(_item) for _item in obj["notifications"]] if obj.get("notifications") is not None else None, + "limit": obj.get("limit"), + "offset": obj.get("offset"), + "count": obj.get("count"), + "is_read": obj.get("is_read"), + "is_seen": obj.get("is_seen"), + "unread": obj.get("unread"), + "unseen": obj.get("unseen") + }) return _obj + + diff --git a/koyeb/api/models/o_auth_callback_reply.py b/koyeb/api/models/o_auth_callback_reply.py index f2c5a2b0..0197c191 100644 --- a/koyeb/api/models/o_auth_callback_reply.py +++ b/koyeb/api/models/o_auth_callback_reply.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -22,30 +22,30 @@ from koyeb.api.models.token import Token from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class OAuthCallbackReply(BaseModel): """ OAuthCallbackReply - """ # noqa: E501 - + """ # noqa: E501 token: Optional[Token] = None __properties: ClassVar[List[str]] = ["token"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -62,7 +62,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -71,7 +72,7 @@ def to_dict(self) -> Dict[str, Any]: ) # override the default output from pydantic by calling `to_dict()` of token if self.token: - _dict["token"] = self.token.to_dict() + _dict['token'] = self.token.to_dict() return _dict @classmethod @@ -83,13 +84,9 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "token": ( - Token.from_dict(obj["token"]) - if obj.get("token") is not None - else None - ) - } - ) + _obj = cls.model_validate({ + "token": Token.from_dict(obj["token"]) if obj.get("token") is not None else None + }) return _obj + + diff --git a/koyeb/api/models/o_auth_callback_request.py b/koyeb/api/models/o_auth_callback_request.py index 12e7b97a..651da98e 100644 --- a/koyeb/api/models/o_auth_callback_request.py +++ b/koyeb/api/models/o_auth_callback_request.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -21,44 +21,33 @@ from typing import Any, ClassVar, Dict, List, Optional from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class OAuthCallbackRequest(BaseModel): """ OAuthCallbackRequest - """ # noqa: E501 - + """ # noqa: E501 state: Optional[StrictStr] = None code: Optional[StrictStr] = None - setup_action: Optional[StrictStr] = Field( - default=None, - description="setup_action is populated in the context of a GitHub app installation request. For logins and signups, it is not set.", - ) - installation_id: Optional[StrictStr] = Field( - default=None, - description="installation_id is populated in the context of a GitHub app installation request. For logins and signups, it is not set.", - ) - __properties: ClassVar[List[str]] = [ - "state", - "code", - "setup_action", - "installation_id", - ] + setup_action: Optional[StrictStr] = Field(default=None, description="setup_action is populated in the context of a GitHub app installation request. For logins and signups, it is not set.") + installation_id: Optional[StrictStr] = Field(default=None, description="installation_id is populated in the context of a GitHub app installation request. For logins and signups, it is not set.") + __properties: ClassVar[List[str]] = ["state", "code", "setup_action", "installation_id"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -75,7 +64,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -93,12 +83,12 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "state": obj.get("state"), - "code": obj.get("code"), - "setup_action": obj.get("setup_action"), - "installation_id": obj.get("installation_id"), - } - ) + _obj = cls.model_validate({ + "state": obj.get("state"), + "code": obj.get("code"), + "setup_action": obj.get("setup_action"), + "installation_id": obj.get("installation_id") + }) return _obj + + diff --git a/koyeb/api/models/o_auth_provider.py b/koyeb/api/models/o_auth_provider.py index 7d569365..5d3417f6 100644 --- a/koyeb/api/models/o_auth_provider.py +++ b/koyeb/api/models/o_auth_provider.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -21,32 +21,32 @@ from typing import Any, ClassVar, Dict, List, Optional from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class OAuthProvider(BaseModel): """ OAuthProvider - """ # noqa: E501 - + """ # noqa: E501 id: Optional[StrictStr] = None url: Optional[StrictStr] = None state: Optional[StrictStr] = None __properties: ClassVar[List[str]] = ["id", "url", "state"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -63,7 +63,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -81,7 +82,11 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - {"id": obj.get("id"), "url": obj.get("url"), "state": obj.get("state")} - ) + _obj = cls.model_validate({ + "id": obj.get("id"), + "url": obj.get("url"), + "state": obj.get("state") + }) return _obj + + diff --git a/koyeb/api/models/object.py b/koyeb/api/models/object.py index aefb5026..b89598e3 100644 --- a/koyeb/api/models/object.py +++ b/koyeb/api/models/object.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -21,13 +21,12 @@ from typing import Any, ClassVar, Dict, List, Optional from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class Object(BaseModel): """ Object - """ # noqa: E501 - + """ # noqa: E501 id: Optional[StrictStr] = None name: Optional[StrictStr] = None type: Optional[StrictStr] = None @@ -36,19 +35,20 @@ class Object(BaseModel): __properties: ClassVar[List[str]] = ["id", "name", "type", "metadata", "deleted"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -65,7 +65,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -83,13 +84,13 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "id": obj.get("id"), - "name": obj.get("name"), - "type": obj.get("type"), - "metadata": obj.get("metadata"), - "deleted": obj.get("deleted"), - } - ) + _obj = cls.model_validate({ + "id": obj.get("id"), + "name": obj.get("name"), + "type": obj.get("type"), + "metadata": obj.get("metadata"), + "deleted": obj.get("deleted") + }) return _obj + + diff --git a/koyeb/api/models/organization.py b/koyeb/api/models/organization.py index cd10e056..5834e674 100644 --- a/koyeb/api/models/organization.py +++ b/koyeb/api/models/organization.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -20,21 +20,18 @@ from datetime import datetime from pydantic import BaseModel, ConfigDict, StrictBool, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from koyeb.api.models.organization_deactivation_reason import ( - OrganizationDeactivationReason, -) +from koyeb.api.models.organization_deactivation_reason import OrganizationDeactivationReason from koyeb.api.models.organization_detailed_status import OrganizationDetailedStatus from koyeb.api.models.organization_status import OrganizationStatus from koyeb.api.models.plan import Plan from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class Organization(BaseModel): """ Organization - """ # noqa: E501 - + """ # noqa: E501 id: Optional[StrictStr] = None external_id: Optional[StrictStr] = None provisioning: Optional[StrictBool] = None @@ -57,12 +54,8 @@ class Organization(BaseModel): latest_subscription_id: Optional[StrictStr] = None signup_qualification: Optional[Dict[str, Any]] = None status: Optional[OrganizationStatus] = OrganizationStatus.WARNING - status_message: Optional[OrganizationDetailedStatus] = ( - OrganizationDetailedStatus.NEW - ) - deactivation_reason: Optional[OrganizationDeactivationReason] = ( - OrganizationDeactivationReason.INVALID - ) + status_message: Optional[OrganizationDetailedStatus] = OrganizationDetailedStatus.NEW + deactivation_reason: Optional[OrganizationDeactivationReason] = OrganizationDeactivationReason.INVALID verified: Optional[StrictBool] = None qualifies_for_hobby23: Optional[StrictBool] = None reprocess_after: Optional[datetime] = None @@ -70,54 +63,24 @@ class Organization(BaseModel): trial_starts_at: Optional[datetime] = None trial_ends_at: Optional[datetime] = None email_domain_allowlist: Optional[List[StrictStr]] = None - __properties: ClassVar[List[str]] = [ - "id", - "external_id", - "provisioning", - "address1", - "address2", - "city", - "postal_code", - "state", - "country", - "company", - "vat_number", - "billing_name", - "billing_email", - "name", - "plan", - "plan_updated_at", - "has_payment_method", - "subscription_id", - "current_subscription_id", - "latest_subscription_id", - "signup_qualification", - "status", - "status_message", - "deactivation_reason", - "verified", - "qualifies_for_hobby23", - "reprocess_after", - "trialing", - "trial_starts_at", - "trial_ends_at", - "email_domain_allowlist", - ] + default_project_id: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["id", "external_id", "provisioning", "address1", "address2", "city", "postal_code", "state", "country", "company", "vat_number", "billing_name", "billing_email", "name", "plan", "plan_updated_at", "has_payment_method", "subscription_id", "current_subscription_id", "latest_subscription_id", "signup_qualification", "status", "status_message", "deactivation_reason", "verified", "qualifies_for_hobby23", "reprocess_after", "trialing", "trial_starts_at", "trial_ends_at", "email_domain_allowlist", "default_project_id"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -134,7 +97,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -152,51 +116,40 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "id": obj.get("id"), - "external_id": obj.get("external_id"), - "provisioning": obj.get("provisioning"), - "address1": obj.get("address1"), - "address2": obj.get("address2"), - "city": obj.get("city"), - "postal_code": obj.get("postal_code"), - "state": obj.get("state"), - "country": obj.get("country"), - "company": obj.get("company"), - "vat_number": obj.get("vat_number"), - "billing_name": obj.get("billing_name"), - "billing_email": obj.get("billing_email"), - "name": obj.get("name"), - "plan": obj.get("plan") if obj.get("plan") is not None else Plan.HOBBY, - "plan_updated_at": obj.get("plan_updated_at"), - "has_payment_method": obj.get("has_payment_method"), - "subscription_id": obj.get("subscription_id"), - "current_subscription_id": obj.get("current_subscription_id"), - "latest_subscription_id": obj.get("latest_subscription_id"), - "signup_qualification": obj.get("signup_qualification"), - "status": ( - obj.get("status") - if obj.get("status") is not None - else OrganizationStatus.WARNING - ), - "status_message": ( - obj.get("status_message") - if obj.get("status_message") is not None - else OrganizationDetailedStatus.NEW - ), - "deactivation_reason": ( - obj.get("deactivation_reason") - if obj.get("deactivation_reason") is not None - else OrganizationDeactivationReason.INVALID - ), - "verified": obj.get("verified"), - "qualifies_for_hobby23": obj.get("qualifies_for_hobby23"), - "reprocess_after": obj.get("reprocess_after"), - "trialing": obj.get("trialing"), - "trial_starts_at": obj.get("trial_starts_at"), - "trial_ends_at": obj.get("trial_ends_at"), - "email_domain_allowlist": obj.get("email_domain_allowlist"), - } - ) + _obj = cls.model_validate({ + "id": obj.get("id"), + "external_id": obj.get("external_id"), + "provisioning": obj.get("provisioning"), + "address1": obj.get("address1"), + "address2": obj.get("address2"), + "city": obj.get("city"), + "postal_code": obj.get("postal_code"), + "state": obj.get("state"), + "country": obj.get("country"), + "company": obj.get("company"), + "vat_number": obj.get("vat_number"), + "billing_name": obj.get("billing_name"), + "billing_email": obj.get("billing_email"), + "name": obj.get("name"), + "plan": obj.get("plan") if obj.get("plan") is not None else Plan.HOBBY, + "plan_updated_at": obj.get("plan_updated_at"), + "has_payment_method": obj.get("has_payment_method"), + "subscription_id": obj.get("subscription_id"), + "current_subscription_id": obj.get("current_subscription_id"), + "latest_subscription_id": obj.get("latest_subscription_id"), + "signup_qualification": obj.get("signup_qualification"), + "status": obj.get("status") if obj.get("status") is not None else OrganizationStatus.WARNING, + "status_message": obj.get("status_message") if obj.get("status_message") is not None else OrganizationDetailedStatus.NEW, + "deactivation_reason": obj.get("deactivation_reason") if obj.get("deactivation_reason") is not None else OrganizationDeactivationReason.INVALID, + "verified": obj.get("verified"), + "qualifies_for_hobby23": obj.get("qualifies_for_hobby23"), + "reprocess_after": obj.get("reprocess_after"), + "trialing": obj.get("trialing"), + "trial_starts_at": obj.get("trial_starts_at"), + "trial_ends_at": obj.get("trial_ends_at"), + "email_domain_allowlist": obj.get("email_domain_allowlist"), + "default_project_id": obj.get("default_project_id") + }) return _obj + + diff --git a/koyeb/api/models/organization_deactivation_reason.py b/koyeb/api/models/organization_deactivation_reason.py index 52eb10d7..f7c78f6e 100644 --- a/koyeb/api/models/organization_deactivation_reason.py +++ b/koyeb/api/models/organization_deactivation_reason.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -26,14 +26,16 @@ class OrganizationDeactivationReason(str, Enum): """ allowed enum values """ - INVALID = "INVALID" - REQUESTED_BY_OWNER = "REQUESTED_BY_OWNER" - SUBSCRIPTION_TERMINATION = "SUBSCRIPTION_TERMINATION" - LOCKED_BY_ADMIN = "LOCKED_BY_ADMIN" - VERIFICATION_FAILED = "VERIFICATION_FAILED" - TRIAL_DID_NOT_CONVERT = "TRIAL_DID_NOT_CONVERT" + INVALID = 'INVALID' + REQUESTED_BY_OWNER = 'REQUESTED_BY_OWNER' + SUBSCRIPTION_TERMINATION = 'SUBSCRIPTION_TERMINATION' + LOCKED_BY_ADMIN = 'LOCKED_BY_ADMIN' + VERIFICATION_FAILED = 'VERIFICATION_FAILED' + TRIAL_DID_NOT_CONVERT = 'TRIAL_DID_NOT_CONVERT' @classmethod def from_json(cls, json_str: str) -> Self: """Create an instance of OrganizationDeactivationReason from a JSON string""" return cls(json.loads(json_str)) + + diff --git a/koyeb/api/models/organization_detailed_status.py b/koyeb/api/models/organization_detailed_status.py index a791668b..18a8ad08 100644 --- a/koyeb/api/models/organization_detailed_status.py +++ b/koyeb/api/models/organization_detailed_status.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -26,18 +26,20 @@ class OrganizationDetailedStatus(str, Enum): """ allowed enum values """ - NEW = "NEW" - EMAIL_NOT_VALIDATED = "EMAIL_NOT_VALIDATED" - BILLING_INFO_MISSING = "BILLING_INFO_MISSING" - LOCKED = "LOCKED" - PAYMENT_FAILURE = "PAYMENT_FAILURE" - VALID = "VALID" - PENDING_VERIFICATION = "PENDING_VERIFICATION" - VERIFICATION_FAILED = "VERIFICATION_FAILED" - REVIEWING_ACCOUNT = "REVIEWING_ACCOUNT" - PLAN_UPGRADE_REQUIRED = "PLAN_UPGRADE_REQUIRED" + NEW = 'NEW' + EMAIL_NOT_VALIDATED = 'EMAIL_NOT_VALIDATED' + BILLING_INFO_MISSING = 'BILLING_INFO_MISSING' + LOCKED = 'LOCKED' + PAYMENT_FAILURE = 'PAYMENT_FAILURE' + VALID = 'VALID' + PENDING_VERIFICATION = 'PENDING_VERIFICATION' + VERIFICATION_FAILED = 'VERIFICATION_FAILED' + REVIEWING_ACCOUNT = 'REVIEWING_ACCOUNT' + PLAN_UPGRADE_REQUIRED = 'PLAN_UPGRADE_REQUIRED' @classmethod def from_json(cls, json_str: str) -> Self: """Create an instance of OrganizationDetailedStatus from a JSON string""" return cls(json.loads(json_str)) + + diff --git a/koyeb/api/models/organization_invitation.py b/koyeb/api/models/organization_invitation.py index be3abb82..f1f45092 100644 --- a/koyeb/api/models/organization_invitation.py +++ b/koyeb/api/models/organization_invitation.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -26,19 +26,16 @@ from koyeb.api.models.user_role_role import UserRoleRole from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class OrganizationInvitation(BaseModel): """ OrganizationInvitation - """ # noqa: E501 - + """ # noqa: E501 id: Optional[StrictStr] = None email: Optional[StrictStr] = None role: Optional[UserRoleRole] = UserRoleRole.INVALID - status: Optional[OrganizationInvitationStatus] = ( - OrganizationInvitationStatus.INVALID - ) + status: Optional[OrganizationInvitationStatus] = OrganizationInvitationStatus.INVALID expires_at: Optional[datetime] = None organization_id: Optional[StrictStr] = None organization: Optional[PublicOrganization] = None @@ -46,34 +43,23 @@ class OrganizationInvitation(BaseModel): invitee: Optional[PublicUser] = None inviter_id: Optional[StrictStr] = None inviter: Optional[PublicUser] = None - __properties: ClassVar[List[str]] = [ - "id", - "email", - "role", - "status", - "expires_at", - "organization_id", - "organization", - "invitee_id", - "invitee", - "inviter_id", - "inviter", - ] + __properties: ClassVar[List[str]] = ["id", "email", "role", "status", "expires_at", "organization_id", "organization", "invitee_id", "invitee", "inviter_id", "inviter"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -90,7 +76,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -99,13 +86,13 @@ def to_dict(self) -> Dict[str, Any]: ) # override the default output from pydantic by calling `to_dict()` of organization if self.organization: - _dict["organization"] = self.organization.to_dict() + _dict['organization'] = self.organization.to_dict() # override the default output from pydantic by calling `to_dict()` of invitee if self.invitee: - _dict["invitee"] = self.invitee.to_dict() + _dict['invitee'] = self.invitee.to_dict() # override the default output from pydantic by calling `to_dict()` of inviter if self.inviter: - _dict["inviter"] = self.inviter.to_dict() + _dict['inviter'] = self.inviter.to_dict() return _dict @classmethod @@ -117,39 +104,19 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "id": obj.get("id"), - "email": obj.get("email"), - "role": ( - obj.get("role") - if obj.get("role") is not None - else UserRoleRole.INVALID - ), - "status": ( - obj.get("status") - if obj.get("status") is not None - else OrganizationInvitationStatus.INVALID - ), - "expires_at": obj.get("expires_at"), - "organization_id": obj.get("organization_id"), - "organization": ( - PublicOrganization.from_dict(obj["organization"]) - if obj.get("organization") is not None - else None - ), - "invitee_id": obj.get("invitee_id"), - "invitee": ( - PublicUser.from_dict(obj["invitee"]) - if obj.get("invitee") is not None - else None - ), - "inviter_id": obj.get("inviter_id"), - "inviter": ( - PublicUser.from_dict(obj["inviter"]) - if obj.get("inviter") is not None - else None - ), - } - ) + _obj = cls.model_validate({ + "id": obj.get("id"), + "email": obj.get("email"), + "role": obj.get("role") if obj.get("role") is not None else UserRoleRole.INVALID, + "status": obj.get("status") if obj.get("status") is not None else OrganizationInvitationStatus.INVALID, + "expires_at": obj.get("expires_at"), + "organization_id": obj.get("organization_id"), + "organization": PublicOrganization.from_dict(obj["organization"]) if obj.get("organization") is not None else None, + "invitee_id": obj.get("invitee_id"), + "invitee": PublicUser.from_dict(obj["invitee"]) if obj.get("invitee") is not None else None, + "inviter_id": obj.get("inviter_id"), + "inviter": PublicUser.from_dict(obj["inviter"]) if obj.get("inviter") is not None else None + }) return _obj + + diff --git a/koyeb/api/models/organization_invitation_status.py b/koyeb/api/models/organization_invitation_status.py index 835730da..256fce22 100644 --- a/koyeb/api/models/organization_invitation_status.py +++ b/koyeb/api/models/organization_invitation_status.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -26,13 +26,15 @@ class OrganizationInvitationStatus(str, Enum): """ allowed enum values """ - INVALID = "INVALID" - PENDING = "PENDING" - ACCEPTED = "ACCEPTED" - REFUSED = "REFUSED" - EXPIRED = "EXPIRED" + INVALID = 'INVALID' + PENDING = 'PENDING' + ACCEPTED = 'ACCEPTED' + REFUSED = 'REFUSED' + EXPIRED = 'EXPIRED' @classmethod def from_json(cls, json_str: str) -> Self: """Create an instance of OrganizationInvitationStatus from a JSON string""" return cls(json.loads(json_str)) + + diff --git a/koyeb/api/models/organization_member.py b/koyeb/api/models/organization_member.py index f0c4d33c..4946c2c0 100644 --- a/koyeb/api/models/organization_member.py +++ b/koyeb/api/models/organization_member.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -26,13 +26,12 @@ from koyeb.api.models.user_role_role import UserRoleRole from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class OrganizationMember(BaseModel): """ OrganizationMember - """ # noqa: E501 - + """ # noqa: E501 id: Optional[StrictStr] = None organization_id: Optional[StrictStr] = None user_id: Optional[StrictStr] = None @@ -42,32 +41,23 @@ class OrganizationMember(BaseModel): status: Optional[OrganizationMemberStatus] = OrganizationMemberStatus.INVALID user: Optional[PublicUser] = None organization: Optional[PublicOrganization] = None - __properties: ClassVar[List[str]] = [ - "id", - "organization_id", - "user_id", - "external_id", - "joined_at", - "role", - "status", - "user", - "organization", - ] + __properties: ClassVar[List[str]] = ["id", "organization_id", "user_id", "external_id", "joined_at", "role", "status", "user", "organization"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -84,7 +74,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -93,10 +84,10 @@ def to_dict(self) -> Dict[str, Any]: ) # override the default output from pydantic by calling `to_dict()` of user if self.user: - _dict["user"] = self.user.to_dict() + _dict['user'] = self.user.to_dict() # override the default output from pydantic by calling `to_dict()` of organization if self.organization: - _dict["organization"] = self.organization.to_dict() + _dict['organization'] = self.organization.to_dict() return _dict @classmethod @@ -108,33 +99,17 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "id": obj.get("id"), - "organization_id": obj.get("organization_id"), - "user_id": obj.get("user_id"), - "external_id": obj.get("external_id"), - "joined_at": obj.get("joined_at"), - "role": ( - obj.get("role") - if obj.get("role") is not None - else UserRoleRole.INVALID - ), - "status": ( - obj.get("status") - if obj.get("status") is not None - else OrganizationMemberStatus.INVALID - ), - "user": ( - PublicUser.from_dict(obj["user"]) - if obj.get("user") is not None - else None - ), - "organization": ( - PublicOrganization.from_dict(obj["organization"]) - if obj.get("organization") is not None - else None - ), - } - ) + _obj = cls.model_validate({ + "id": obj.get("id"), + "organization_id": obj.get("organization_id"), + "user_id": obj.get("user_id"), + "external_id": obj.get("external_id"), + "joined_at": obj.get("joined_at"), + "role": obj.get("role") if obj.get("role") is not None else UserRoleRole.INVALID, + "status": obj.get("status") if obj.get("status") is not None else OrganizationMemberStatus.INVALID, + "user": PublicUser.from_dict(obj["user"]) if obj.get("user") is not None else None, + "organization": PublicOrganization.from_dict(obj["organization"]) if obj.get("organization") is not None else None + }) return _obj + + diff --git a/koyeb/api/models/organization_member_status.py b/koyeb/api/models/organization_member_status.py index d2cc8fcb..eb1a7f38 100644 --- a/koyeb/api/models/organization_member_status.py +++ b/koyeb/api/models/organization_member_status.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -26,11 +26,13 @@ class OrganizationMemberStatus(str, Enum): """ allowed enum values """ - INVALID = "INVALID" - ACTIVE = "ACTIVE" - DELETED = "DELETED" + INVALID = 'INVALID' + ACTIVE = 'ACTIVE' + DELETED = 'DELETED' @classmethod def from_json(cls, json_str: str) -> Self: """Create an instance of OrganizationMemberStatus from a JSON string""" return cls(json.loads(json_str)) + + diff --git a/koyeb/api/models/organization_status.py b/koyeb/api/models/organization_status.py index 41c13fbf..b8b6c050 100644 --- a/koyeb/api/models/organization_status.py +++ b/koyeb/api/models/organization_status.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -26,15 +26,17 @@ class OrganizationStatus(str, Enum): """ allowed enum values """ - WARNING = "WARNING" - LOCKED = "LOCKED" - ACTIVE = "ACTIVE" - DEACTIVATING = "DEACTIVATING" - DEACTIVATED = "DEACTIVATED" - DELETING = "DELETING" - DELETED = "DELETED" + WARNING = 'WARNING' + LOCKED = 'LOCKED' + ACTIVE = 'ACTIVE' + DEACTIVATING = 'DEACTIVATING' + DEACTIVATED = 'DEACTIVATED' + DELETING = 'DELETING' + DELETED = 'DELETED' @classmethod def from_json(cls, json_str: str) -> Self: """Create an instance of OrganizationStatus from a JSON string""" return cls(json.loads(json_str)) + + diff --git a/koyeb/api/models/organization_summary.py b/koyeb/api/models/organization_summary.py index 43c322ae..bc47cc7e 100644 --- a/koyeb/api/models/organization_summary.py +++ b/koyeb/api/models/organization_summary.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -28,13 +28,12 @@ from koyeb.api.models.service_summary import ServiceSummary from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class OrganizationSummary(BaseModel): """ OrganizationSummary - """ # noqa: E501 - + """ # noqa: E501 organization_id: Optional[StrictStr] = None instances: Optional[InstancesSummary] = None apps: Optional[AppsSummary] = None @@ -43,31 +42,23 @@ class OrganizationSummary(BaseModel): secrets: Optional[SecretsSummary] = None neon_postgres: Optional[NeonPostgresSummary] = None members: Optional[MembersSummary] = None - __properties: ClassVar[List[str]] = [ - "organization_id", - "instances", - "apps", - "services", - "domains", - "secrets", - "neon_postgres", - "members", - ] + __properties: ClassVar[List[str]] = ["organization_id", "instances", "apps", "services", "domains", "secrets", "neon_postgres", "members"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -84,7 +75,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -93,29 +85,29 @@ def to_dict(self) -> Dict[str, Any]: ) # override the default output from pydantic by calling `to_dict()` of instances if self.instances: - _dict["instances"] = self.instances.to_dict() + _dict['instances'] = self.instances.to_dict() # override the default output from pydantic by calling `to_dict()` of apps if self.apps: - _dict["apps"] = self.apps.to_dict() + _dict['apps'] = self.apps.to_dict() # override the default output from pydantic by calling `to_dict()` of each value in services (dict) _field_dict = {} if self.services: for _key_services in self.services: if self.services[_key_services]: _field_dict[_key_services] = self.services[_key_services].to_dict() - _dict["services"] = _field_dict + _dict['services'] = _field_dict # override the default output from pydantic by calling `to_dict()` of domains if self.domains: - _dict["domains"] = self.domains.to_dict() + _dict['domains'] = self.domains.to_dict() # override the default output from pydantic by calling `to_dict()` of secrets if self.secrets: - _dict["secrets"] = self.secrets.to_dict() + _dict['secrets'] = self.secrets.to_dict() # override the default output from pydantic by calling `to_dict()` of neon_postgres if self.neon_postgres: - _dict["neon_postgres"] = self.neon_postgres.to_dict() + _dict['neon_postgres'] = self.neon_postgres.to_dict() # override the default output from pydantic by calling `to_dict()` of members if self.members: - _dict["members"] = self.members.to_dict() + _dict['members'] = self.members.to_dict() return _dict @classmethod @@ -127,47 +119,21 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "organization_id": obj.get("organization_id"), - "instances": ( - InstancesSummary.from_dict(obj["instances"]) - if obj.get("instances") is not None - else None - ), - "apps": ( - AppsSummary.from_dict(obj["apps"]) - if obj.get("apps") is not None - else None - ), - "services": ( - dict( - (_k, ServiceSummary.from_dict(_v)) - for _k, _v in obj["services"].items() - ) - if obj.get("services") is not None - else None - ), - "domains": ( - DomainsSummary.from_dict(obj["domains"]) - if obj.get("domains") is not None - else None - ), - "secrets": ( - SecretsSummary.from_dict(obj["secrets"]) - if obj.get("secrets") is not None - else None - ), - "neon_postgres": ( - NeonPostgresSummary.from_dict(obj["neon_postgres"]) - if obj.get("neon_postgres") is not None - else None - ), - "members": ( - MembersSummary.from_dict(obj["members"]) - if obj.get("members") is not None - else None - ), - } - ) + _obj = cls.model_validate({ + "organization_id": obj.get("organization_id"), + "instances": InstancesSummary.from_dict(obj["instances"]) if obj.get("instances") is not None else None, + "apps": AppsSummary.from_dict(obj["apps"]) if obj.get("apps") is not None else None, + "services": dict( + (_k, ServiceSummary.from_dict(_v)) + for _k, _v in obj["services"].items() + ) + if obj.get("services") is not None + else None, + "domains": DomainsSummary.from_dict(obj["domains"]) if obj.get("domains") is not None else None, + "secrets": SecretsSummary.from_dict(obj["secrets"]) if obj.get("secrets") is not None else None, + "neon_postgres": NeonPostgresSummary.from_dict(obj["neon_postgres"]) if obj.get("neon_postgres") is not None else None, + "members": MembersSummary.from_dict(obj["members"]) if obj.get("members") is not None else None + }) return _obj + + diff --git a/koyeb/api/models/payment_method.py b/koyeb/api/models/payment_method.py index 09440af5..02fed602 100644 --- a/koyeb/api/models/payment_method.py +++ b/koyeb/api/models/payment_method.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -23,13 +23,12 @@ from koyeb.api.models.payment_method_status import PaymentMethodStatus from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class PaymentMethod(BaseModel): """ PaymentMethod - """ # noqa: E501 - + """ # noqa: E501 id: Optional[StrictStr] = None created_at: Optional[datetime] = None updated_at: Optional[datetime] = None @@ -51,44 +50,23 @@ class PaymentMethod(BaseModel): card_last_digits: Optional[StrictStr] = None card_expiration_month: Optional[StrictInt] = None card_expiration_year: Optional[StrictInt] = None - __properties: ClassVar[List[str]] = [ - "id", - "created_at", - "updated_at", - "version", - "organization_id", - "type", - "provider", - "status", - "messages", - "stripe_payment_method_id", - "authorization_verified_at", - "authorization_canceled_at", - "authorization_stripe_payment_intent_id", - "authorization_stripe_payment_intent_client_secret", - "card_brand", - "card_country", - "card_funding", - "card_fingerprint", - "card_last_digits", - "card_expiration_month", - "card_expiration_year", - ] + __properties: ClassVar[List[str]] = ["id", "created_at", "updated_at", "version", "organization_id", "type", "provider", "status", "messages", "stripe_payment_method_id", "authorization_verified_at", "authorization_canceled_at", "authorization_stripe_payment_intent_id", "authorization_stripe_payment_intent_client_secret", "card_brand", "card_country", "card_funding", "card_fingerprint", "card_last_digits", "card_expiration_month", "card_expiration_year"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -105,7 +83,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -123,37 +102,29 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "id": obj.get("id"), - "created_at": obj.get("created_at"), - "updated_at": obj.get("updated_at"), - "version": obj.get("version"), - "organization_id": obj.get("organization_id"), - "type": obj.get("type"), - "provider": obj.get("provider"), - "status": ( - obj.get("status") - if obj.get("status") is not None - else PaymentMethodStatus.INVALID - ), - "messages": obj.get("messages"), - "stripe_payment_method_id": obj.get("stripe_payment_method_id"), - "authorization_verified_at": obj.get("authorization_verified_at"), - "authorization_canceled_at": obj.get("authorization_canceled_at"), - "authorization_stripe_payment_intent_id": obj.get( - "authorization_stripe_payment_intent_id" - ), - "authorization_stripe_payment_intent_client_secret": obj.get( - "authorization_stripe_payment_intent_client_secret" - ), - "card_brand": obj.get("card_brand"), - "card_country": obj.get("card_country"), - "card_funding": obj.get("card_funding"), - "card_fingerprint": obj.get("card_fingerprint"), - "card_last_digits": obj.get("card_last_digits"), - "card_expiration_month": obj.get("card_expiration_month"), - "card_expiration_year": obj.get("card_expiration_year"), - } - ) + _obj = cls.model_validate({ + "id": obj.get("id"), + "created_at": obj.get("created_at"), + "updated_at": obj.get("updated_at"), + "version": obj.get("version"), + "organization_id": obj.get("organization_id"), + "type": obj.get("type"), + "provider": obj.get("provider"), + "status": obj.get("status") if obj.get("status") is not None else PaymentMethodStatus.INVALID, + "messages": obj.get("messages"), + "stripe_payment_method_id": obj.get("stripe_payment_method_id"), + "authorization_verified_at": obj.get("authorization_verified_at"), + "authorization_canceled_at": obj.get("authorization_canceled_at"), + "authorization_stripe_payment_intent_id": obj.get("authorization_stripe_payment_intent_id"), + "authorization_stripe_payment_intent_client_secret": obj.get("authorization_stripe_payment_intent_client_secret"), + "card_brand": obj.get("card_brand"), + "card_country": obj.get("card_country"), + "card_funding": obj.get("card_funding"), + "card_fingerprint": obj.get("card_fingerprint"), + "card_last_digits": obj.get("card_last_digits"), + "card_expiration_month": obj.get("card_expiration_month"), + "card_expiration_year": obj.get("card_expiration_year") + }) return _obj + + diff --git a/koyeb/api/models/payment_method_status.py b/koyeb/api/models/payment_method_status.py index c5e26480..bb5f4d84 100644 --- a/koyeb/api/models/payment_method_status.py +++ b/koyeb/api/models/payment_method_status.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -26,15 +26,17 @@ class PaymentMethodStatus(str, Enum): """ allowed enum values """ - INVALID = "INVALID" - CREATED = "CREATED" - AUTHORIZED = "AUTHORIZED" - DECLINED = "DECLINED" - CANCELED = "CANCELED" - EXPIRED = "EXPIRED" - UNCHECKED = "UNCHECKED" + INVALID = 'INVALID' + CREATED = 'CREATED' + AUTHORIZED = 'AUTHORIZED' + DECLINED = 'DECLINED' + CANCELED = 'CANCELED' + EXPIRED = 'EXPIRED' + UNCHECKED = 'UNCHECKED' @classmethod def from_json(cls, json_str: str) -> Self: """Create an instance of PaymentMethodStatus from a JSON string""" return cls(json.loads(json_str)) + + diff --git a/koyeb/api/models/period_usage.py b/koyeb/api/models/period_usage.py index 6181ef58..1b9d80cf 100644 --- a/koyeb/api/models/period_usage.py +++ b/koyeb/api/models/period_usage.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -23,32 +23,32 @@ from koyeb.api.models.app_usage import AppUsage from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class PeriodUsage(BaseModel): """ PeriodUsage - """ # noqa: E501 - + """ # noqa: E501 starting_time: Optional[datetime] = None ending_time: Optional[datetime] = None apps: Optional[List[AppUsage]] = None __properties: ClassVar[List[str]] = ["starting_time", "ending_time", "apps"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -65,7 +65,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -78,7 +79,7 @@ def to_dict(self) -> Dict[str, Any]: for _item_apps in self.apps: if _item_apps: _items.append(_item_apps.to_dict()) - _dict["apps"] = _items + _dict['apps'] = _items return _dict @classmethod @@ -90,15 +91,11 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "starting_time": obj.get("starting_time"), - "ending_time": obj.get("ending_time"), - "apps": ( - [AppUsage.from_dict(_item) for _item in obj["apps"]] - if obj.get("apps") is not None - else None - ), - } - ) + _obj = cls.model_validate({ + "starting_time": obj.get("starting_time"), + "ending_time": obj.get("ending_time"), + "apps": [AppUsage.from_dict(_item) for _item in obj["apps"]] if obj.get("apps") is not None else None + }) return _obj + + diff --git a/koyeb/api/models/persistent_volume.py b/koyeb/api/models/persistent_volume.py index c7fe3493..c2e8e742 100644 --- a/koyeb/api/models/persistent_volume.py +++ b/koyeb/api/models/persistent_volume.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -20,19 +20,16 @@ from datetime import datetime from pydantic import BaseModel, ConfigDict, StrictBool, StrictInt, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from koyeb.api.models.persistent_volume_backing_store import ( - PersistentVolumeBackingStore, -) +from koyeb.api.models.persistent_volume_backing_store import PersistentVolumeBackingStore from koyeb.api.models.persistent_volume_status import PersistentVolumeStatus from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class PersistentVolume(BaseModel): """ PersistentVolume - """ # noqa: E501 - + """ # noqa: E501 id: Optional[StrictStr] = None name: Optional[StrictStr] = None snapshot_id: Optional[StrictStr] = None @@ -45,43 +42,25 @@ class PersistentVolume(BaseModel): read_only: Optional[StrictBool] = None max_size: Optional[StrictInt] = None cur_size: Optional[StrictInt] = None - status: Optional[PersistentVolumeStatus] = ( - PersistentVolumeStatus.PERSISTENT_VOLUME_STATUS_INVALID - ) - backing_store: Optional[PersistentVolumeBackingStore] = ( - PersistentVolumeBackingStore.PERSISTENT_VOLUME_BACKING_STORE_INVALID - ) - __properties: ClassVar[List[str]] = [ - "id", - "name", - "snapshot_id", - "created_at", - "updated_at", - "deleted_at", - "organization_id", - "service_id", - "region", - "read_only", - "max_size", - "cur_size", - "status", - "backing_store", - ] + status: Optional[PersistentVolumeStatus] = PersistentVolumeStatus.PERSISTENT_VOLUME_STATUS_INVALID + backing_store: Optional[PersistentVolumeBackingStore] = PersistentVolumeBackingStore.PERSISTENT_VOLUME_BACKING_STORE_INVALID + __properties: ClassVar[List[str]] = ["id", "name", "snapshot_id", "created_at", "updated_at", "deleted_at", "organization_id", "service_id", "region", "read_only", "max_size", "cur_size", "status", "backing_store"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -98,7 +77,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -116,30 +96,22 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "id": obj.get("id"), - "name": obj.get("name"), - "snapshot_id": obj.get("snapshot_id"), - "created_at": obj.get("created_at"), - "updated_at": obj.get("updated_at"), - "deleted_at": obj.get("deleted_at"), - "organization_id": obj.get("organization_id"), - "service_id": obj.get("service_id"), - "region": obj.get("region"), - "read_only": obj.get("read_only"), - "max_size": obj.get("max_size"), - "cur_size": obj.get("cur_size"), - "status": ( - obj.get("status") - if obj.get("status") is not None - else PersistentVolumeStatus.PERSISTENT_VOLUME_STATUS_INVALID - ), - "backing_store": ( - obj.get("backing_store") - if obj.get("backing_store") is not None - else PersistentVolumeBackingStore.PERSISTENT_VOLUME_BACKING_STORE_INVALID - ), - } - ) + _obj = cls.model_validate({ + "id": obj.get("id"), + "name": obj.get("name"), + "snapshot_id": obj.get("snapshot_id"), + "created_at": obj.get("created_at"), + "updated_at": obj.get("updated_at"), + "deleted_at": obj.get("deleted_at"), + "organization_id": obj.get("organization_id"), + "service_id": obj.get("service_id"), + "region": obj.get("region"), + "read_only": obj.get("read_only"), + "max_size": obj.get("max_size"), + "cur_size": obj.get("cur_size"), + "status": obj.get("status") if obj.get("status") is not None else PersistentVolumeStatus.PERSISTENT_VOLUME_STATUS_INVALID, + "backing_store": obj.get("backing_store") if obj.get("backing_store") is not None else PersistentVolumeBackingStore.PERSISTENT_VOLUME_BACKING_STORE_INVALID + }) return _obj + + diff --git a/koyeb/api/models/persistent_volume_backing_store.py b/koyeb/api/models/persistent_volume_backing_store.py index 90329229..9f8a3494 100644 --- a/koyeb/api/models/persistent_volume_backing_store.py +++ b/koyeb/api/models/persistent_volume_backing_store.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -26,12 +26,12 @@ class PersistentVolumeBackingStore(str, Enum): """ allowed enum values """ - PERSISTENT_VOLUME_BACKING_STORE_INVALID = "PERSISTENT_VOLUME_BACKING_STORE_INVALID" - PERSISTENT_VOLUME_BACKING_STORE_LOCAL_BLK = ( - "PERSISTENT_VOLUME_BACKING_STORE_LOCAL_BLK" - ) + PERSISTENT_VOLUME_BACKING_STORE_INVALID = 'PERSISTENT_VOLUME_BACKING_STORE_INVALID' + PERSISTENT_VOLUME_BACKING_STORE_LOCAL_BLK = 'PERSISTENT_VOLUME_BACKING_STORE_LOCAL_BLK' @classmethod def from_json(cls, json_str: str) -> Self: """Create an instance of PersistentVolumeBackingStore from a JSON string""" return cls(json.loads(json_str)) + + diff --git a/koyeb/api/models/persistent_volume_event.py b/koyeb/api/models/persistent_volume_event.py index 52ddcf27..723404ea 100644 --- a/koyeb/api/models/persistent_volume_event.py +++ b/koyeb/api/models/persistent_volume_event.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -22,13 +22,12 @@ from typing import Any, ClassVar, Dict, List, Optional from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class PersistentVolumeEvent(BaseModel): """ PersistentVolumeEvent - """ # noqa: E501 - + """ # noqa: E501 id: Optional[StrictStr] = None when: Optional[datetime] = None organization_id: Optional[StrictStr] = None @@ -36,30 +35,23 @@ class PersistentVolumeEvent(BaseModel): type: Optional[StrictStr] = None message: Optional[StrictStr] = None metadata: Optional[Dict[str, Any]] = None - __properties: ClassVar[List[str]] = [ - "id", - "when", - "organization_id", - "persistent_volume_id", - "type", - "message", - "metadata", - ] + __properties: ClassVar[List[str]] = ["id", "when", "organization_id", "persistent_volume_id", "type", "message", "metadata"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -76,7 +68,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -94,15 +87,15 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "id": obj.get("id"), - "when": obj.get("when"), - "organization_id": obj.get("organization_id"), - "persistent_volume_id": obj.get("persistent_volume_id"), - "type": obj.get("type"), - "message": obj.get("message"), - "metadata": obj.get("metadata"), - } - ) + _obj = cls.model_validate({ + "id": obj.get("id"), + "when": obj.get("when"), + "organization_id": obj.get("organization_id"), + "persistent_volume_id": obj.get("persistent_volume_id"), + "type": obj.get("type"), + "message": obj.get("message"), + "metadata": obj.get("metadata") + }) return _obj + + diff --git a/koyeb/api/models/persistent_volume_quotas.py b/koyeb/api/models/persistent_volume_quotas.py index 929e30cc..b33bb37d 100644 --- a/koyeb/api/models/persistent_volume_quotas.py +++ b/koyeb/api/models/persistent_volume_quotas.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -21,44 +21,32 @@ from typing import Any, ClassVar, Dict, List, Optional from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class PersistentVolumeQuotas(BaseModel): """ PersistentVolumeQuotas - """ # noqa: E501 - - max_total_size: Optional[StrictInt] = Field( - default=None, - description="MaxTotalSize for all volumes on a region (in Gigabyte / GB).", - ) - max_volume_size: Optional[StrictInt] = Field( - default=None, description="MaxVolumeSize for one volume (in Gigabyte / GB)." - ) - max_per_instance_size: Optional[StrictInt] = Field( - default=None, - description="MaxPerInstanceSize for all volumes on an instance (in Gigabyte / GB).", - ) - __properties: ClassVar[List[str]] = [ - "max_total_size", - "max_volume_size", - "max_per_instance_size", - ] + """ # noqa: E501 + max_total_size: Optional[StrictInt] = Field(default=None, description="MaxTotalSize for all volumes on a region (in Gigabyte / GB).") + max_volume_size: Optional[StrictInt] = Field(default=None, description="MaxVolumeSize for one volume (in Gigabyte / GB).") + max_per_instance_size: Optional[StrictInt] = Field(default=None, description="MaxPerInstanceSize for all volumes on an instance (in Gigabyte / GB).") + __properties: ClassVar[List[str]] = ["max_total_size", "max_volume_size", "max_per_instance_size"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -75,7 +63,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -93,11 +82,11 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "max_total_size": obj.get("max_total_size"), - "max_volume_size": obj.get("max_volume_size"), - "max_per_instance_size": obj.get("max_per_instance_size"), - } - ) + _obj = cls.model_validate({ + "max_total_size": obj.get("max_total_size"), + "max_volume_size": obj.get("max_volume_size"), + "max_per_instance_size": obj.get("max_per_instance_size") + }) return _obj + + diff --git a/koyeb/api/models/persistent_volume_status.py b/koyeb/api/models/persistent_volume_status.py index bb64c5bb..9e8fae12 100644 --- a/koyeb/api/models/persistent_volume_status.py +++ b/koyeb/api/models/persistent_volume_status.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -26,13 +26,16 @@ class PersistentVolumeStatus(str, Enum): """ allowed enum values """ - PERSISTENT_VOLUME_STATUS_INVALID = "PERSISTENT_VOLUME_STATUS_INVALID" - PERSISTENT_VOLUME_STATUS_ATTACHED = "PERSISTENT_VOLUME_STATUS_ATTACHED" - PERSISTENT_VOLUME_STATUS_DETACHED = "PERSISTENT_VOLUME_STATUS_DETACHED" - PERSISTENT_VOLUME_STATUS_DELETING = "PERSISTENT_VOLUME_STATUS_DELETING" - PERSISTENT_VOLUME_STATUS_DELETED = "PERSISTENT_VOLUME_STATUS_DELETED" + PERSISTENT_VOLUME_STATUS_INVALID = 'PERSISTENT_VOLUME_STATUS_INVALID' + PERSISTENT_VOLUME_STATUS_ATTACHED = 'PERSISTENT_VOLUME_STATUS_ATTACHED' + PERSISTENT_VOLUME_STATUS_DETACHED = 'PERSISTENT_VOLUME_STATUS_DETACHED' + PERSISTENT_VOLUME_STATUS_DELETING = 'PERSISTENT_VOLUME_STATUS_DELETING' + PERSISTENT_VOLUME_STATUS_DELETED = 'PERSISTENT_VOLUME_STATUS_DELETED' + PERSISTENT_VOLUME_STATUS_ARCHIVING = 'PERSISTENT_VOLUME_STATUS_ARCHIVING' @classmethod def from_json(cls, json_str: str) -> Self: """Create an instance of PersistentVolumeStatus from a JSON string""" return cls(json.loads(json_str)) + + diff --git a/koyeb/api/models/plan.py b/koyeb/api/models/plan.py index 8907ec8e..ea762666 100644 --- a/koyeb/api/models/plan.py +++ b/koyeb/api/models/plan.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -26,20 +26,22 @@ class Plan(str, Enum): """ allowed enum values """ - HOBBY = "hobby" - STARTER = "starter" - STARTUP = "startup" - BUSINESS = "business" - ENTERPRISE = "enterprise" - INTERNAL = "internal" - HOBBY23 = "hobby23" - NO_PLAN = "no_plan" - PRO = "pro" - SCALE = "scale" - PARTNER_CSP = "partner_csp" - PARTNER_CSP_UNIT = "partner_csp_unit" + HOBBY = 'hobby' + STARTER = 'starter' + STARTUP = 'startup' + BUSINESS = 'business' + ENTERPRISE = 'enterprise' + INTERNAL = 'internal' + HOBBY23 = 'hobby23' + NO_PLAN = 'no_plan' + PRO = 'pro' + SCALE = 'scale' + PARTNER_CSP = 'partner_csp' + PARTNER_CSP_UNIT = 'partner_csp_unit' @classmethod def from_json(cls, json_str: str) -> Self: """Create an instance of Plan from a JSON string""" return cls(json.loads(json_str)) + + diff --git a/koyeb/api/models/port.py b/koyeb/api/models/port.py index c565a5bd..11bc010b 100644 --- a/koyeb/api/models/port.py +++ b/koyeb/api/models/port.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -21,31 +21,31 @@ from typing import Any, ClassVar, Dict, List, Optional from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class Port(BaseModel): """ Port - """ # noqa: E501 - + """ # noqa: E501 port: Optional[StrictInt] = None protocol: Optional[StrictStr] = None __properties: ClassVar[List[str]] = ["port", "protocol"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -62,7 +62,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -80,7 +81,10 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - {"port": obj.get("port"), "protocol": obj.get("protocol")} - ) + _obj = cls.model_validate({ + "port": obj.get("port"), + "protocol": obj.get("protocol") + }) return _obj + + diff --git a/koyeb/api/models/private_registry_configuration.py b/koyeb/api/models/private_registry_configuration.py index f2d71725..6d45b615 100644 --- a/koyeb/api/models/private_registry_configuration.py +++ b/koyeb/api/models/private_registry_configuration.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -21,32 +21,32 @@ from typing import Any, ClassVar, Dict, List, Optional from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class PrivateRegistryConfiguration(BaseModel): """ PrivateRegistryConfiguration - """ # noqa: E501 - + """ # noqa: E501 username: Optional[StrictStr] = None password: Optional[StrictStr] = None url: Optional[StrictStr] = None __properties: ClassVar[List[str]] = ["username", "password", "url"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -63,7 +63,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -81,11 +82,11 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "username": obj.get("username"), - "password": obj.get("password"), - "url": obj.get("url"), - } - ) + _obj = cls.model_validate({ + "username": obj.get("username"), + "password": obj.get("password"), + "url": obj.get("url") + }) return _obj + + diff --git a/koyeb/api/models/project.py b/koyeb/api/models/project.py new file mode 100644 index 00000000..4f244dc0 --- /dev/null +++ b/koyeb/api/models/project.py @@ -0,0 +1,101 @@ +# coding: utf-8 + +""" + Koyeb Rest API + + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import datetime +from pydantic import BaseModel, ConfigDict, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class Project(BaseModel): + """ + Project + """ # noqa: E501 + id: Optional[StrictStr] = None + name: Optional[StrictStr] = None + description: Optional[StrictStr] = None + organization_id: Optional[StrictStr] = None + updated_at: Optional[datetime] = None + created_at: Optional[datetime] = None + service_count: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["id", "name", "description", "organization_id", "updated_at", "created_at", "service_count"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of Project from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of Project from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "name": obj.get("name"), + "description": obj.get("description"), + "organization_id": obj.get("organization_id"), + "updated_at": obj.get("updated_at"), + "created_at": obj.get("created_at"), + "service_count": obj.get("service_count") + }) + return _obj + + diff --git a/koyeb/api/models/proxy_port_protocol.py b/koyeb/api/models/proxy_port_protocol.py index b2a3b2bf..3d253437 100644 --- a/koyeb/api/models/proxy_port_protocol.py +++ b/koyeb/api/models/proxy_port_protocol.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -26,9 +26,11 @@ class ProxyPortProtocol(str, Enum): """ allowed enum values """ - TCP = "tcp" + TCP = 'tcp' @classmethod def from_json(cls, json_str: str) -> Self: """Create an instance of ProxyPortProtocol from a JSON string""" return cls(json.loads(json_str)) + + diff --git a/koyeb/api/models/public_organization.py b/koyeb/api/models/public_organization.py index ec4df05c..4a082ffc 100644 --- a/koyeb/api/models/public_organization.py +++ b/koyeb/api/models/public_organization.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -23,13 +23,12 @@ from koyeb.api.models.plan import Plan from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class PublicOrganization(BaseModel): """ PublicOrganization - """ # noqa: E501 - + """ # noqa: E501 id: Optional[StrictStr] = None name: Optional[StrictStr] = None plan: Optional[Plan] = Plan.HOBBY @@ -38,19 +37,20 @@ class PublicOrganization(BaseModel): __properties: ClassVar[List[str]] = ["id", "name", "plan", "status", "external_id"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -67,7 +67,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -85,17 +86,13 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "id": obj.get("id"), - "name": obj.get("name"), - "plan": obj.get("plan") if obj.get("plan") is not None else Plan.HOBBY, - "status": ( - obj.get("status") - if obj.get("status") is not None - else OrganizationStatus.WARNING - ), - "external_id": obj.get("external_id"), - } - ) + _obj = cls.model_validate({ + "id": obj.get("id"), + "name": obj.get("name"), + "plan": obj.get("plan") if obj.get("plan") is not None else Plan.HOBBY, + "status": obj.get("status") if obj.get("status") is not None else OrganizationStatus.WARNING, + "external_id": obj.get("external_id") + }) return _obj + + diff --git a/koyeb/api/models/public_user.py b/koyeb/api/models/public_user.py index 18831045..9a899158 100644 --- a/koyeb/api/models/public_user.py +++ b/koyeb/api/models/public_user.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -21,42 +21,35 @@ from typing import Any, ClassVar, Dict, List, Optional from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class PublicUser(BaseModel): """ PublicUser - """ # noqa: E501 - + """ # noqa: E501 id: Optional[StrictStr] = None email: Optional[StrictStr] = None name: Optional[StrictStr] = None avatar_url: Optional[StrictStr] = None github_id: Optional[StrictStr] = None github_user: Optional[StrictStr] = None - __properties: ClassVar[List[str]] = [ - "id", - "email", - "name", - "avatar_url", - "github_id", - "github_user", - ] + __properties: ClassVar[List[str]] = ["id", "email", "name", "avatar_url", "github_id", "github_user"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -73,7 +66,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -91,14 +85,14 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "id": obj.get("id"), - "email": obj.get("email"), - "name": obj.get("name"), - "avatar_url": obj.get("avatar_url"), - "github_id": obj.get("github_id"), - "github_user": obj.get("github_user"), - } - ) + _obj = cls.model_validate({ + "id": obj.get("id"), + "email": obj.get("email"), + "name": obj.get("name"), + "avatar_url": obj.get("avatar_url"), + "github_id": obj.get("github_id"), + "github_user": obj.get("github_user") + }) return _obj + + diff --git a/koyeb/api/models/query_logs_reply.py b/koyeb/api/models/query_logs_reply.py index 12c8f789..22fc7ad6 100644 --- a/koyeb/api/models/query_logs_reply.py +++ b/koyeb/api/models/query_logs_reply.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -23,31 +23,31 @@ from koyeb.api.models.query_logs_reply_pagination import QueryLogsReplyPagination from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class QueryLogsReply(BaseModel): """ QueryLogsReply - """ # noqa: E501 - + """ # noqa: E501 data: Optional[List[LogEntry]] = None pagination: Optional[QueryLogsReplyPagination] = None __properties: ClassVar[List[str]] = ["data", "pagination"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -64,7 +64,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -77,10 +78,10 @@ def to_dict(self) -> Dict[str, Any]: for _item_data in self.data: if _item_data: _items.append(_item_data.to_dict()) - _dict["data"] = _items + _dict['data'] = _items # override the default output from pydantic by calling `to_dict()` of pagination if self.pagination: - _dict["pagination"] = self.pagination.to_dict() + _dict['pagination'] = self.pagination.to_dict() return _dict @classmethod @@ -92,18 +93,10 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "data": ( - [LogEntry.from_dict(_item) for _item in obj["data"]] - if obj.get("data") is not None - else None - ), - "pagination": ( - QueryLogsReplyPagination.from_dict(obj["pagination"]) - if obj.get("pagination") is not None - else None - ), - } - ) + _obj = cls.model_validate({ + "data": [LogEntry.from_dict(_item) for _item in obj["data"]] if obj.get("data") is not None else None, + "pagination": QueryLogsReplyPagination.from_dict(obj["pagination"]) if obj.get("pagination") is not None else None + }) return _obj + + diff --git a/koyeb/api/models/query_logs_reply_pagination.py b/koyeb/api/models/query_logs_reply_pagination.py index 89cb3022..59a7151a 100644 --- a/koyeb/api/models/query_logs_reply_pagination.py +++ b/koyeb/api/models/query_logs_reply_pagination.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -22,32 +22,32 @@ from typing import Any, ClassVar, Dict, List, Optional from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class QueryLogsReplyPagination(BaseModel): """ QueryLogsReplyPagination - """ # noqa: E501 - + """ # noqa: E501 has_more: Optional[StrictBool] = None next_start: Optional[datetime] = None next_end: Optional[datetime] = None __properties: ClassVar[List[str]] = ["has_more", "next_start", "next_end"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -64,7 +64,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -82,11 +83,11 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "has_more": obj.get("has_more"), - "next_start": obj.get("next_start"), - "next_end": obj.get("next_end"), - } - ) + _obj = cls.model_validate({ + "has_more": obj.get("has_more"), + "next_start": obj.get("next_start"), + "next_end": obj.get("next_end") + }) return _obj + + diff --git a/koyeb/api/models/quotas.py b/koyeb/api/models/quotas.py index 8bfe6f94..0eb06f16 100644 --- a/koyeb/api/models/quotas.py +++ b/koyeb/api/models/quotas.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -20,17 +20,17 @@ from pydantic import BaseModel, ConfigDict, StrictInt, StrictStr from typing import Any, ClassVar, Dict, List, Optional from koyeb.api.models.domain_load_balancer_quotas import DomainLoadBalancerQuotas +from koyeb.api.models.lifecycle_quotas import LifecycleQuotas from koyeb.api.models.persistent_volume_quotas import PersistentVolumeQuotas from koyeb.api.models.scale_to_zero_quotas import ScaleToZeroQuotas from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class Quotas(BaseModel): """ Quotas - """ # noqa: E501 - + """ # noqa: E501 apps: Optional[StrictStr] = None services: Optional[StrictStr] = None domains: Optional[StrictStr] = None @@ -51,43 +51,25 @@ class Quotas(BaseModel): scale_to_zero: Optional[ScaleToZeroQuotas] = None archives: Optional[StrictStr] = None archive_max_size_mb: Optional[StrictStr] = None - __properties: ClassVar[List[str]] = [ - "apps", - "services", - "domains", - "services_by_app", - "service_provisioning_concurrency", - "memory_mb", - "instance_types", - "regions", - "max_organization_members", - "max_instances_by_type", - "persistent_volumes_by_region", - "custom_domains", - "domains_load_balancer", - "metrics_retention", - "logs_retention", - "access_reserved_subdomains", - "proxy_ports", - "scale_to_zero", - "archives", - "archive_max_size_mb", - ] + lifecycle: Optional[LifecycleQuotas] = None + max_projects: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["apps", "services", "domains", "services_by_app", "service_provisioning_concurrency", "memory_mb", "instance_types", "regions", "max_organization_members", "max_instances_by_type", "persistent_volumes_by_region", "custom_domains", "domains_load_balancer", "metrics_retention", "logs_retention", "access_reserved_subdomains", "proxy_ports", "scale_to_zero", "archives", "archive_max_size_mb", "lifecycle", "max_projects"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -104,7 +86,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -116,18 +99,17 @@ def to_dict(self) -> Dict[str, Any]: if self.persistent_volumes_by_region: for _key_persistent_volumes_by_region in self.persistent_volumes_by_region: if self.persistent_volumes_by_region[_key_persistent_volumes_by_region]: - _field_dict[_key_persistent_volumes_by_region] = ( - self.persistent_volumes_by_region[ - _key_persistent_volumes_by_region - ].to_dict() - ) - _dict["persistent_volumes_by_region"] = _field_dict + _field_dict[_key_persistent_volumes_by_region] = self.persistent_volumes_by_region[_key_persistent_volumes_by_region].to_dict() + _dict['persistent_volumes_by_region'] = _field_dict # override the default output from pydantic by calling `to_dict()` of domains_load_balancer if self.domains_load_balancer: - _dict["domains_load_balancer"] = self.domains_load_balancer.to_dict() + _dict['domains_load_balancer'] = self.domains_load_balancer.to_dict() # override the default output from pydantic by calling `to_dict()` of scale_to_zero if self.scale_to_zero: - _dict["scale_to_zero"] = self.scale_to_zero.to_dict() + _dict['scale_to_zero'] = self.scale_to_zero.to_dict() + # override the default output from pydantic by calling `to_dict()` of lifecycle + if self.lifecycle: + _dict['lifecycle'] = self.lifecycle.to_dict() return _dict @classmethod @@ -139,45 +121,35 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "apps": obj.get("apps"), - "services": obj.get("services"), - "domains": obj.get("domains"), - "services_by_app": obj.get("services_by_app"), - "service_provisioning_concurrency": obj.get( - "service_provisioning_concurrency" - ), - "memory_mb": obj.get("memory_mb"), - "instance_types": obj.get("instance_types"), - "regions": obj.get("regions"), - "max_organization_members": obj.get("max_organization_members"), - "max_instances_by_type": obj.get("max_instances_by_type"), - "persistent_volumes_by_region": ( - dict( - (_k, PersistentVolumeQuotas.from_dict(_v)) - for _k, _v in obj["persistent_volumes_by_region"].items() - ) - if obj.get("persistent_volumes_by_region") is not None - else None - ), - "custom_domains": obj.get("custom_domains"), - "domains_load_balancer": ( - DomainLoadBalancerQuotas.from_dict(obj["domains_load_balancer"]) - if obj.get("domains_load_balancer") is not None - else None - ), - "metrics_retention": obj.get("metrics_retention"), - "logs_retention": obj.get("logs_retention"), - "access_reserved_subdomains": obj.get("access_reserved_subdomains"), - "proxy_ports": obj.get("proxy_ports"), - "scale_to_zero": ( - ScaleToZeroQuotas.from_dict(obj["scale_to_zero"]) - if obj.get("scale_to_zero") is not None - else None - ), - "archives": obj.get("archives"), - "archive_max_size_mb": obj.get("archive_max_size_mb"), - } - ) + _obj = cls.model_validate({ + "apps": obj.get("apps"), + "services": obj.get("services"), + "domains": obj.get("domains"), + "services_by_app": obj.get("services_by_app"), + "service_provisioning_concurrency": obj.get("service_provisioning_concurrency"), + "memory_mb": obj.get("memory_mb"), + "instance_types": obj.get("instance_types"), + "regions": obj.get("regions"), + "max_organization_members": obj.get("max_organization_members"), + "max_instances_by_type": obj.get("max_instances_by_type"), + "persistent_volumes_by_region": dict( + (_k, PersistentVolumeQuotas.from_dict(_v)) + for _k, _v in obj["persistent_volumes_by_region"].items() + ) + if obj.get("persistent_volumes_by_region") is not None + else None, + "custom_domains": obj.get("custom_domains"), + "domains_load_balancer": DomainLoadBalancerQuotas.from_dict(obj["domains_load_balancer"]) if obj.get("domains_load_balancer") is not None else None, + "metrics_retention": obj.get("metrics_retention"), + "logs_retention": obj.get("logs_retention"), + "access_reserved_subdomains": obj.get("access_reserved_subdomains"), + "proxy_ports": obj.get("proxy_ports"), + "scale_to_zero": ScaleToZeroQuotas.from_dict(obj["scale_to_zero"]) if obj.get("scale_to_zero") is not None else None, + "archives": obj.get("archives"), + "archive_max_size_mb": obj.get("archive_max_size_mb"), + "lifecycle": LifecycleQuotas.from_dict(obj["lifecycle"]) if obj.get("lifecycle") is not None else None, + "max_projects": obj.get("max_projects") + }) return _obj + + diff --git a/koyeb/api/models/reactivate_organization_reply.py b/koyeb/api/models/reactivate_organization_reply.py index b3b1ff75..40f753e0 100644 --- a/koyeb/api/models/reactivate_organization_reply.py +++ b/koyeb/api/models/reactivate_organization_reply.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -22,30 +22,30 @@ from koyeb.api.models.organization import Organization from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class ReactivateOrganizationReply(BaseModel): """ ReactivateOrganizationReply - """ # noqa: E501 - + """ # noqa: E501 organization: Optional[Organization] = None __properties: ClassVar[List[str]] = ["organization"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -62,7 +62,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -71,7 +72,7 @@ def to_dict(self) -> Dict[str, Any]: ) # override the default output from pydantic by calling `to_dict()` of organization if self.organization: - _dict["organization"] = self.organization.to_dict() + _dict['organization'] = self.organization.to_dict() return _dict @classmethod @@ -83,13 +84,9 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "organization": ( - Organization.from_dict(obj["organization"]) - if obj.get("organization") is not None - else None - ) - } - ) + _obj = cls.model_validate({ + "organization": Organization.from_dict(obj["organization"]) if obj.get("organization") is not None else None + }) return _obj + + diff --git a/koyeb/api/models/redeem_coupon_request.py b/koyeb/api/models/redeem_coupon_request.py index 22feee3d..08156d17 100644 --- a/koyeb/api/models/redeem_coupon_request.py +++ b/koyeb/api/models/redeem_coupon_request.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -21,30 +21,30 @@ from typing import Any, ClassVar, Dict, List, Optional from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class RedeemCouponRequest(BaseModel): """ RedeemCouponRequest - """ # noqa: E501 - + """ # noqa: E501 code: Optional[StrictStr] = None __properties: ClassVar[List[str]] = ["code"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -61,7 +61,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -79,5 +80,9 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({"code": obj.get("code")}) + _obj = cls.model_validate({ + "code": obj.get("code") + }) return _obj + + diff --git a/koyeb/api/models/redeploy_reply.py b/koyeb/api/models/redeploy_reply.py index 65203104..a20ca871 100644 --- a/koyeb/api/models/redeploy_reply.py +++ b/koyeb/api/models/redeploy_reply.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -22,30 +22,30 @@ from koyeb.api.models.deployment import Deployment from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class RedeployReply(BaseModel): """ RedeployReply - """ # noqa: E501 - + """ # noqa: E501 deployment: Optional[Deployment] = None __properties: ClassVar[List[str]] = ["deployment"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -62,7 +62,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -71,7 +72,7 @@ def to_dict(self) -> Dict[str, Any]: ) # override the default output from pydantic by calling `to_dict()` of deployment if self.deployment: - _dict["deployment"] = self.deployment.to_dict() + _dict['deployment'] = self.deployment.to_dict() return _dict @classmethod @@ -83,13 +84,9 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "deployment": ( - Deployment.from_dict(obj["deployment"]) - if obj.get("deployment") is not None - else None - ) - } - ) + _obj = cls.model_validate({ + "deployment": Deployment.from_dict(obj["deployment"]) if obj.get("deployment") is not None else None + }) return _obj + + diff --git a/koyeb/api/models/redeploy_request_info.py b/koyeb/api/models/redeploy_request_info.py index bdd867ef..1f606e7a 100644 --- a/koyeb/api/models/redeploy_request_info.py +++ b/koyeb/api/models/redeploy_request_info.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -21,41 +21,33 @@ from typing import Any, ClassVar, Dict, List, Optional from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class RedeployRequestInfo(BaseModel): """ RedeployRequestInfo - """ # noqa: E501 - + """ # noqa: E501 deployment_group: Optional[StrictStr] = None sha: Optional[StrictStr] = None use_cache: Optional[StrictBool] = None - skip_build: Optional[StrictBool] = Field( - default=None, - description="If set to true, the build stage will be skipped and the image coming from the last successful build step will be used instead. The call fails if no previous successful builds happened.", - ) - __properties: ClassVar[List[str]] = [ - "deployment_group", - "sha", - "use_cache", - "skip_build", - ] + skip_build: Optional[StrictBool] = Field(default=None, description="If set to true, the build stage will be skipped and the image coming from the last successful build step will be used instead. The call fails if no previous successful builds happened.") + __properties: ClassVar[List[str]] = ["deployment_group", "sha", "use_cache", "skip_build"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -72,7 +64,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -90,12 +83,12 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "deployment_group": obj.get("deployment_group"), - "sha": obj.get("sha"), - "use_cache": obj.get("use_cache"), - "skip_build": obj.get("skip_build"), - } - ) + _obj = cls.model_validate({ + "deployment_group": obj.get("deployment_group"), + "sha": obj.get("sha"), + "use_cache": obj.get("use_cache"), + "skip_build": obj.get("skip_build") + }) return _obj + + diff --git a/koyeb/api/models/region.py b/koyeb/api/models/region.py index 00bb9aa2..7af81cd7 100644 --- a/koyeb/api/models/region.py +++ b/koyeb/api/models/region.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -21,13 +21,12 @@ from typing import Any, ClassVar, Dict, List, Optional from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class Region(BaseModel): """ Region - """ # noqa: E501 - + """ # noqa: E501 id: Optional[StrictStr] = None name: Optional[StrictStr] = None coordinates: Optional[List[StrictStr]] = None @@ -35,35 +34,24 @@ class Region(BaseModel): instances: Optional[List[StrictStr]] = None datacenters: Optional[List[StrictStr]] = None volumes_enabled: Optional[StrictBool] = None - scope: Optional[StrictStr] = Field( - default=None, - description="The scope of the region, continent, metropolitan area, etc.", - ) - __properties: ClassVar[List[str]] = [ - "id", - "name", - "coordinates", - "status", - "instances", - "datacenters", - "volumes_enabled", - "scope", - ] + scope: Optional[StrictStr] = Field(default=None, description="The scope of the region, continent, metropolitan area, etc.") + __properties: ClassVar[List[str]] = ["id", "name", "coordinates", "status", "instances", "datacenters", "volumes_enabled", "scope"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -80,7 +68,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -98,16 +87,16 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "id": obj.get("id"), - "name": obj.get("name"), - "coordinates": obj.get("coordinates"), - "status": obj.get("status"), - "instances": obj.get("instances"), - "datacenters": obj.get("datacenters"), - "volumes_enabled": obj.get("volumes_enabled"), - "scope": obj.get("scope"), - } - ) + _obj = cls.model_validate({ + "id": obj.get("id"), + "name": obj.get("name"), + "coordinates": obj.get("coordinates"), + "status": obj.get("status"), + "instances": obj.get("instances"), + "datacenters": obj.get("datacenters"), + "volumes_enabled": obj.get("volumes_enabled"), + "scope": obj.get("scope") + }) return _obj + + diff --git a/koyeb/api/models/region_availability.py b/koyeb/api/models/region_availability.py index 9bb7e0fd..3867e2f3 100644 --- a/koyeb/api/models/region_availability.py +++ b/koyeb/api/models/region_availability.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -22,30 +22,30 @@ from koyeb.api.models.availability_level import AvailabilityLevel from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class RegionAvailability(BaseModel): """ RegionAvailability - """ # noqa: E501 - + """ # noqa: E501 availability: Optional[AvailabilityLevel] = AvailabilityLevel.UNKNOWN __properties: ClassVar[List[str]] = ["availability"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -62,7 +62,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -80,13 +81,9 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "availability": ( - obj.get("availability") - if obj.get("availability") is not None - else AvailabilityLevel.UNKNOWN - ) - } - ) + _obj = cls.model_validate({ + "availability": obj.get("availability") if obj.get("availability") is not None else AvailabilityLevel.UNKNOWN + }) return _obj + + diff --git a/koyeb/api/models/region_list_item.py b/koyeb/api/models/region_list_item.py index b8c189d0..2e407704 100644 --- a/koyeb/api/models/region_list_item.py +++ b/koyeb/api/models/region_list_item.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -21,13 +21,12 @@ from typing import Any, ClassVar, Dict, List, Optional from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class RegionListItem(BaseModel): """ RegionListItem - """ # noqa: E501 - + """ # noqa: E501 id: Optional[StrictStr] = None name: Optional[StrictStr] = None coordinates: Optional[List[StrictStr]] = None @@ -35,35 +34,24 @@ class RegionListItem(BaseModel): instances: Optional[List[StrictStr]] = None datacenters: Optional[List[StrictStr]] = None volumes_enabled: Optional[StrictBool] = None - scope: Optional[StrictStr] = Field( - default=None, - description="The scope of the region, continent, metropolitan area, etc.", - ) - __properties: ClassVar[List[str]] = [ - "id", - "name", - "coordinates", - "status", - "instances", - "datacenters", - "volumes_enabled", - "scope", - ] + scope: Optional[StrictStr] = Field(default=None, description="The scope of the region, continent, metropolitan area, etc.") + __properties: ClassVar[List[str]] = ["id", "name", "coordinates", "status", "instances", "datacenters", "volumes_enabled", "scope"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -80,7 +68,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -98,16 +87,16 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "id": obj.get("id"), - "name": obj.get("name"), - "coordinates": obj.get("coordinates"), - "status": obj.get("status"), - "instances": obj.get("instances"), - "datacenters": obj.get("datacenters"), - "volumes_enabled": obj.get("volumes_enabled"), - "scope": obj.get("scope"), - } - ) + _obj = cls.model_validate({ + "id": obj.get("id"), + "name": obj.get("name"), + "coordinates": obj.get("coordinates"), + "status": obj.get("status"), + "instances": obj.get("instances"), + "datacenters": obj.get("datacenters"), + "volumes_enabled": obj.get("volumes_enabled"), + "scope": obj.get("scope") + }) return _obj + + diff --git a/koyeb/api/models/region_usage.py b/koyeb/api/models/region_usage.py index f772c2a6..a0aa8343 100644 --- a/koyeb/api/models/region_usage.py +++ b/koyeb/api/models/region_usage.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -22,30 +22,30 @@ from koyeb.api.models.instance_usage import InstanceUsage from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class RegionUsage(BaseModel): """ RegionUsage - """ # noqa: E501 - + """ # noqa: E501 instances: Optional[Dict[str, InstanceUsage]] = None __properties: ClassVar[List[str]] = ["instances"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -62,7 +62,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -74,10 +75,8 @@ def to_dict(self) -> Dict[str, Any]: if self.instances: for _key_instances in self.instances: if self.instances[_key_instances]: - _field_dict[_key_instances] = self.instances[ - _key_instances - ].to_dict() - _dict["instances"] = _field_dict + _field_dict[_key_instances] = self.instances[_key_instances].to_dict() + _dict['instances'] = _field_dict return _dict @classmethod @@ -89,16 +88,14 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "instances": ( - dict( - (_k, InstanceUsage.from_dict(_v)) - for _k, _v in obj["instances"].items() - ) - if obj.get("instances") is not None - else None - ) - } - ) + _obj = cls.model_validate({ + "instances": dict( + (_k, InstanceUsage.from_dict(_v)) + for _k, _v in obj["instances"].items() + ) + if obj.get("instances") is not None + else None + }) return _obj + + diff --git a/koyeb/api/models/regional_deployment.py b/koyeb/api/models/regional_deployment.py index e393813a..50f7a034 100644 --- a/koyeb/api/models/regional_deployment.py +++ b/koyeb/api/models/regional_deployment.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -26,13 +26,12 @@ from koyeb.api.models.regional_deployment_status import RegionalDeploymentStatus from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class RegionalDeployment(BaseModel): """ RegionalDeployment - """ # noqa: E501 - + """ # noqa: E501 id: Optional[StrictStr] = None created_at: Optional[datetime] = None updated_at: Optional[datetime] = None @@ -57,47 +56,23 @@ class RegionalDeployment(BaseModel): version: Optional[StrictStr] = None deployment_group: Optional[StrictStr] = None deployment_id: Optional[StrictStr] = None - __properties: ClassVar[List[str]] = [ - "id", - "created_at", - "updated_at", - "scheduled_at", - "allocated_at", - "started_at", - "succeeded_at", - "terminated_at", - "organization_id", - "app_id", - "service_id", - "region", - "parent_id", - "child_id", - "status", - "messages", - "definition", - "datacenters", - "metadata", - "provisioning_info", - "role", - "version", - "deployment_group", - "deployment_id", - ] + __properties: ClassVar[List[str]] = ["id", "created_at", "updated_at", "scheduled_at", "allocated_at", "started_at", "succeeded_at", "terminated_at", "organization_id", "app_id", "service_id", "region", "parent_id", "child_id", "status", "messages", "definition", "datacenters", "metadata", "provisioning_info", "role", "version", "deployment_group", "deployment_id"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -114,7 +89,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -123,10 +99,10 @@ def to_dict(self) -> Dict[str, Any]: ) # override the default output from pydantic by calling `to_dict()` of definition if self.definition: - _dict["definition"] = self.definition.to_dict() + _dict['definition'] = self.definition.to_dict() # override the default output from pydantic by calling `to_dict()` of provisioning_info if self.provisioning_info: - _dict["provisioning_info"] = self.provisioning_info.to_dict() + _dict['provisioning_info'] = self.provisioning_info.to_dict() return _dict @classmethod @@ -138,48 +114,32 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "id": obj.get("id"), - "created_at": obj.get("created_at"), - "updated_at": obj.get("updated_at"), - "scheduled_at": obj.get("scheduled_at"), - "allocated_at": obj.get("allocated_at"), - "started_at": obj.get("started_at"), - "succeeded_at": obj.get("succeeded_at"), - "terminated_at": obj.get("terminated_at"), - "organization_id": obj.get("organization_id"), - "app_id": obj.get("app_id"), - "service_id": obj.get("service_id"), - "region": obj.get("region"), - "parent_id": obj.get("parent_id"), - "child_id": obj.get("child_id"), - "status": ( - obj.get("status") - if obj.get("status") is not None - else RegionalDeploymentStatus.PENDING - ), - "messages": obj.get("messages"), - "definition": ( - RegionalDeploymentDefinition.from_dict(obj["definition"]) - if obj.get("definition") is not None - else None - ), - "datacenters": obj.get("datacenters"), - "metadata": obj.get("metadata"), - "provisioning_info": ( - DeploymentProvisioningInfo.from_dict(obj["provisioning_info"]) - if obj.get("provisioning_info") is not None - else None - ), - "role": ( - obj.get("role") - if obj.get("role") is not None - else RegionalDeploymentRole.INVALID - ), - "version": obj.get("version"), - "deployment_group": obj.get("deployment_group"), - "deployment_id": obj.get("deployment_id"), - } - ) + _obj = cls.model_validate({ + "id": obj.get("id"), + "created_at": obj.get("created_at"), + "updated_at": obj.get("updated_at"), + "scheduled_at": obj.get("scheduled_at"), + "allocated_at": obj.get("allocated_at"), + "started_at": obj.get("started_at"), + "succeeded_at": obj.get("succeeded_at"), + "terminated_at": obj.get("terminated_at"), + "organization_id": obj.get("organization_id"), + "app_id": obj.get("app_id"), + "service_id": obj.get("service_id"), + "region": obj.get("region"), + "parent_id": obj.get("parent_id"), + "child_id": obj.get("child_id"), + "status": obj.get("status") if obj.get("status") is not None else RegionalDeploymentStatus.PENDING, + "messages": obj.get("messages"), + "definition": RegionalDeploymentDefinition.from_dict(obj["definition"]) if obj.get("definition") is not None else None, + "datacenters": obj.get("datacenters"), + "metadata": obj.get("metadata"), + "provisioning_info": DeploymentProvisioningInfo.from_dict(obj["provisioning_info"]) if obj.get("provisioning_info") is not None else None, + "role": obj.get("role") if obj.get("role") is not None else RegionalDeploymentRole.INVALID, + "version": obj.get("version"), + "deployment_group": obj.get("deployment_group"), + "deployment_id": obj.get("deployment_id") + }) return _obj + + diff --git a/koyeb/api/models/regional_deployment_definition.py b/koyeb/api/models/regional_deployment_definition.py index d8f5d23f..10b92f46 100644 --- a/koyeb/api/models/regional_deployment_definition.py +++ b/koyeb/api/models/regional_deployment_definition.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -27,25 +27,20 @@ from koyeb.api.models.env import Env from koyeb.api.models.git_source import GitSource from koyeb.api.models.port import Port -from koyeb.api.models.regional_deployment_definition_type import ( - RegionalDeploymentDefinitionType, -) +from koyeb.api.models.regional_deployment_definition_type import RegionalDeploymentDefinitionType from koyeb.api.models.regional_deployment_volume import RegionalDeploymentVolume from koyeb.api.models.route import Route from koyeb.api.models.scaling import Scaling from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class RegionalDeploymentDefinition(BaseModel): """ RegionalDeploymentDefinition - """ # noqa: E501 - + """ # noqa: E501 name: Optional[StrictStr] = None - type: Optional[RegionalDeploymentDefinitionType] = ( - RegionalDeploymentDefinitionType.INVALID - ) + type: Optional[RegionalDeploymentDefinitionType] = RegionalDeploymentDefinitionType.INVALID strategy: Optional[DeploymentStrategy] = None routes: Optional[List[Route]] = None ports: Optional[List[Port]] = None @@ -61,40 +56,23 @@ class RegionalDeploymentDefinition(BaseModel): docker: Optional[DockerSource] = None git: Optional[GitSource] = None archive: Optional[ArchiveSource] = None - __properties: ClassVar[List[str]] = [ - "name", - "type", - "strategy", - "routes", - "ports", - "env", - "region", - "scaling", - "instance_type", - "deployment_group", - "health_checks", - "volumes", - "config_files", - "skip_cache", - "docker", - "git", - "archive", - ] + __properties: ClassVar[List[str]] = ["name", "type", "strategy", "routes", "ports", "env", "region", "scaling", "instance_type", "deployment_group", "health_checks", "volumes", "config_files", "skip_cache", "docker", "git", "archive"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -111,7 +89,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -120,61 +99,61 @@ def to_dict(self) -> Dict[str, Any]: ) # override the default output from pydantic by calling `to_dict()` of strategy if self.strategy: - _dict["strategy"] = self.strategy.to_dict() + _dict['strategy'] = self.strategy.to_dict() # override the default output from pydantic by calling `to_dict()` of each item in routes (list) _items = [] if self.routes: for _item_routes in self.routes: if _item_routes: _items.append(_item_routes.to_dict()) - _dict["routes"] = _items + _dict['routes'] = _items # override the default output from pydantic by calling `to_dict()` of each item in ports (list) _items = [] if self.ports: for _item_ports in self.ports: if _item_ports: _items.append(_item_ports.to_dict()) - _dict["ports"] = _items + _dict['ports'] = _items # override the default output from pydantic by calling `to_dict()` of each item in env (list) _items = [] if self.env: for _item_env in self.env: if _item_env: _items.append(_item_env.to_dict()) - _dict["env"] = _items + _dict['env'] = _items # override the default output from pydantic by calling `to_dict()` of scaling if self.scaling: - _dict["scaling"] = self.scaling.to_dict() + _dict['scaling'] = self.scaling.to_dict() # override the default output from pydantic by calling `to_dict()` of each item in health_checks (list) _items = [] if self.health_checks: for _item_health_checks in self.health_checks: if _item_health_checks: _items.append(_item_health_checks.to_dict()) - _dict["health_checks"] = _items + _dict['health_checks'] = _items # override the default output from pydantic by calling `to_dict()` of each item in volumes (list) _items = [] if self.volumes: for _item_volumes in self.volumes: if _item_volumes: _items.append(_item_volumes.to_dict()) - _dict["volumes"] = _items + _dict['volumes'] = _items # override the default output from pydantic by calling `to_dict()` of each item in config_files (list) _items = [] if self.config_files: for _item_config_files in self.config_files: if _item_config_files: _items.append(_item_config_files.to_dict()) - _dict["config_files"] = _items + _dict['config_files'] = _items # override the default output from pydantic by calling `to_dict()` of docker if self.docker: - _dict["docker"] = self.docker.to_dict() + _dict['docker'] = self.docker.to_dict() # override the default output from pydantic by calling `to_dict()` of git if self.git: - _dict["git"] = self.git.to_dict() + _dict['git'] = self.git.to_dict() # override the default output from pydantic by calling `to_dict()` of archive if self.archive: - _dict["archive"] = self.archive.to_dict() + _dict['archive'] = self.archive.to_dict() return _dict @classmethod @@ -186,79 +165,25 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "name": obj.get("name"), - "type": ( - obj.get("type") - if obj.get("type") is not None - else RegionalDeploymentDefinitionType.INVALID - ), - "strategy": ( - DeploymentStrategy.from_dict(obj["strategy"]) - if obj.get("strategy") is not None - else None - ), - "routes": ( - [Route.from_dict(_item) for _item in obj["routes"]] - if obj.get("routes") is not None - else None - ), - "ports": ( - [Port.from_dict(_item) for _item in obj["ports"]] - if obj.get("ports") is not None - else None - ), - "env": ( - [Env.from_dict(_item) for _item in obj["env"]] - if obj.get("env") is not None - else None - ), - "region": obj.get("region"), - "scaling": ( - Scaling.from_dict(obj["scaling"]) - if obj.get("scaling") is not None - else None - ), - "instance_type": obj.get("instance_type"), - "deployment_group": obj.get("deployment_group"), - "health_checks": ( - [ - DeploymentHealthCheck.from_dict(_item) - for _item in obj["health_checks"] - ] - if obj.get("health_checks") is not None - else None - ), - "volumes": ( - [ - RegionalDeploymentVolume.from_dict(_item) - for _item in obj["volumes"] - ] - if obj.get("volumes") is not None - else None - ), - "config_files": ( - [ConfigFile.from_dict(_item) for _item in obj["config_files"]] - if obj.get("config_files") is not None - else None - ), - "skip_cache": obj.get("skip_cache"), - "docker": ( - DockerSource.from_dict(obj["docker"]) - if obj.get("docker") is not None - else None - ), - "git": ( - GitSource.from_dict(obj["git"]) - if obj.get("git") is not None - else None - ), - "archive": ( - ArchiveSource.from_dict(obj["archive"]) - if obj.get("archive") is not None - else None - ), - } - ) + _obj = cls.model_validate({ + "name": obj.get("name"), + "type": obj.get("type") if obj.get("type") is not None else RegionalDeploymentDefinitionType.INVALID, + "strategy": DeploymentStrategy.from_dict(obj["strategy"]) if obj.get("strategy") is not None else None, + "routes": [Route.from_dict(_item) for _item in obj["routes"]] if obj.get("routes") is not None else None, + "ports": [Port.from_dict(_item) for _item in obj["ports"]] if obj.get("ports") is not None else None, + "env": [Env.from_dict(_item) for _item in obj["env"]] if obj.get("env") is not None else None, + "region": obj.get("region"), + "scaling": Scaling.from_dict(obj["scaling"]) if obj.get("scaling") is not None else None, + "instance_type": obj.get("instance_type"), + "deployment_group": obj.get("deployment_group"), + "health_checks": [DeploymentHealthCheck.from_dict(_item) for _item in obj["health_checks"]] if obj.get("health_checks") is not None else None, + "volumes": [RegionalDeploymentVolume.from_dict(_item) for _item in obj["volumes"]] if obj.get("volumes") is not None else None, + "config_files": [ConfigFile.from_dict(_item) for _item in obj["config_files"]] if obj.get("config_files") is not None else None, + "skip_cache": obj.get("skip_cache"), + "docker": DockerSource.from_dict(obj["docker"]) if obj.get("docker") is not None else None, + "git": GitSource.from_dict(obj["git"]) if obj.get("git") is not None else None, + "archive": ArchiveSource.from_dict(obj["archive"]) if obj.get("archive") is not None else None + }) return _obj + + diff --git a/koyeb/api/models/regional_deployment_definition_type.py b/koyeb/api/models/regional_deployment_definition_type.py index 7da672ed..d130da32 100644 --- a/koyeb/api/models/regional_deployment_definition_type.py +++ b/koyeb/api/models/regional_deployment_definition_type.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -26,13 +26,15 @@ class RegionalDeploymentDefinitionType(str, Enum): """ allowed enum values """ - INVALID = "INVALID" - WEB = "WEB" - WORKER = "WORKER" - UNDERSCORE = "_" - SANDBOX = "SANDBOX" + INVALID = 'INVALID' + WEB = 'WEB' + WORKER = 'WORKER' + UNDERSCORE = '_' + SANDBOX = 'SANDBOX' @classmethod def from_json(cls, json_str: str) -> Self: """Create an instance of RegionalDeploymentDefinitionType from a JSON string""" return cls(json.loads(json_str)) + + diff --git a/koyeb/api/models/regional_deployment_event.py b/koyeb/api/models/regional_deployment_event.py index bcd23e99..9d09295a 100644 --- a/koyeb/api/models/regional_deployment_event.py +++ b/koyeb/api/models/regional_deployment_event.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -22,13 +22,12 @@ from typing import Any, ClassVar, Dict, List, Optional from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class RegionalDeploymentEvent(BaseModel): """ RegionalDeploymentEvent - """ # noqa: E501 - + """ # noqa: E501 id: Optional[StrictStr] = None when: Optional[datetime] = None organization_id: Optional[StrictStr] = None @@ -36,30 +35,23 @@ class RegionalDeploymentEvent(BaseModel): type: Optional[StrictStr] = None message: Optional[StrictStr] = None metadata: Optional[Dict[str, Any]] = None - __properties: ClassVar[List[str]] = [ - "id", - "when", - "organization_id", - "regional_deployment_id", - "type", - "message", - "metadata", - ] + __properties: ClassVar[List[str]] = ["id", "when", "organization_id", "regional_deployment_id", "type", "message", "metadata"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -76,7 +68,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -94,15 +87,15 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "id": obj.get("id"), - "when": obj.get("when"), - "organization_id": obj.get("organization_id"), - "regional_deployment_id": obj.get("regional_deployment_id"), - "type": obj.get("type"), - "message": obj.get("message"), - "metadata": obj.get("metadata"), - } - ) + _obj = cls.model_validate({ + "id": obj.get("id"), + "when": obj.get("when"), + "organization_id": obj.get("organization_id"), + "regional_deployment_id": obj.get("regional_deployment_id"), + "type": obj.get("type"), + "message": obj.get("message"), + "metadata": obj.get("metadata") + }) return _obj + + diff --git a/koyeb/api/models/regional_deployment_list_item.py b/koyeb/api/models/regional_deployment_list_item.py index 52547a0a..f3619e59 100644 --- a/koyeb/api/models/regional_deployment_list_item.py +++ b/koyeb/api/models/regional_deployment_list_item.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -24,13 +24,12 @@ from koyeb.api.models.regional_deployment_status import RegionalDeploymentStatus from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class RegionalDeploymentListItem(BaseModel): """ RegionalDeploymentListItem - """ # noqa: E501 - + """ # noqa: E501 id: Optional[StrictStr] = None created_at: Optional[datetime] = None updated_at: Optional[datetime] = None @@ -38,30 +37,23 @@ class RegionalDeploymentListItem(BaseModel): status: Optional[RegionalDeploymentStatus] = RegionalDeploymentStatus.PENDING messages: Optional[List[StrictStr]] = None definition: Optional[RegionalDeploymentDefinition] = None - __properties: ClassVar[List[str]] = [ - "id", - "created_at", - "updated_at", - "region", - "status", - "messages", - "definition", - ] + __properties: ClassVar[List[str]] = ["id", "created_at", "updated_at", "region", "status", "messages", "definition"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -78,7 +70,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -87,7 +80,7 @@ def to_dict(self) -> Dict[str, Any]: ) # override the default output from pydantic by calling `to_dict()` of definition if self.definition: - _dict["definition"] = self.definition.to_dict() + _dict['definition'] = self.definition.to_dict() return _dict @classmethod @@ -99,23 +92,15 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "id": obj.get("id"), - "created_at": obj.get("created_at"), - "updated_at": obj.get("updated_at"), - "region": obj.get("region"), - "status": ( - obj.get("status") - if obj.get("status") is not None - else RegionalDeploymentStatus.PENDING - ), - "messages": obj.get("messages"), - "definition": ( - RegionalDeploymentDefinition.from_dict(obj["definition"]) - if obj.get("definition") is not None - else None - ), - } - ) + _obj = cls.model_validate({ + "id": obj.get("id"), + "created_at": obj.get("created_at"), + "updated_at": obj.get("updated_at"), + "region": obj.get("region"), + "status": obj.get("status") if obj.get("status") is not None else RegionalDeploymentStatus.PENDING, + "messages": obj.get("messages"), + "definition": RegionalDeploymentDefinition.from_dict(obj["definition"]) if obj.get("definition") is not None else None + }) return _obj + + diff --git a/koyeb/api/models/regional_deployment_role.py b/koyeb/api/models/regional_deployment_role.py index dfa5e2ad..1a17b3e3 100644 --- a/koyeb/api/models/regional_deployment_role.py +++ b/koyeb/api/models/regional_deployment_role.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -26,12 +26,14 @@ class RegionalDeploymentRole(str, Enum): """ allowed enum values """ - INVALID = "INVALID" - ACTIVE = "ACTIVE" - UPCOMING = "UPCOMING" - CURRENT = "CURRENT" + INVALID = 'INVALID' + ACTIVE = 'ACTIVE' + UPCOMING = 'UPCOMING' + CURRENT = 'CURRENT' @classmethod def from_json(cls, json_str: str) -> Self: """Create an instance of RegionalDeploymentRole from a JSON string""" return cls(json.loads(json_str)) + + diff --git a/koyeb/api/models/regional_deployment_status.py b/koyeb/api/models/regional_deployment_status.py index 083e79e2..fc0a3635 100644 --- a/koyeb/api/models/regional_deployment_status.py +++ b/koyeb/api/models/regional_deployment_status.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -26,23 +26,25 @@ class RegionalDeploymentStatus(str, Enum): """ allowed enum values """ - PENDING = "PENDING" - PROVISIONING = "PROVISIONING" - SCHEDULED = "SCHEDULED" - CANCELING = "CANCELING" - CANCELED = "CANCELED" - ALLOCATING = "ALLOCATING" - STARTING = "STARTING" - HEALTHY = "HEALTHY" - DEGRADED = "DEGRADED" - UNHEALTHY = "UNHEALTHY" - STOPPING = "STOPPING" - STOPPED = "STOPPED" - ERRORING = "ERRORING" - ERROR = "ERROR" - SLEEPING = "SLEEPING" + PENDING = 'PENDING' + PROVISIONING = 'PROVISIONING' + SCHEDULED = 'SCHEDULED' + CANCELING = 'CANCELING' + CANCELED = 'CANCELED' + ALLOCATING = 'ALLOCATING' + STARTING = 'STARTING' + HEALTHY = 'HEALTHY' + DEGRADED = 'DEGRADED' + UNHEALTHY = 'UNHEALTHY' + STOPPING = 'STOPPING' + STOPPED = 'STOPPED' + ERRORING = 'ERRORING' + ERROR = 'ERROR' + SLEEPING = 'SLEEPING' @classmethod def from_json(cls, json_str: str) -> Self: """Create an instance of RegionalDeploymentStatus from a JSON string""" return cls(json.loads(json_str)) + + diff --git a/koyeb/api/models/regional_deployment_volume.py b/koyeb/api/models/regional_deployment_volume.py index 11a96845..51e48ee7 100644 --- a/koyeb/api/models/regional_deployment_volume.py +++ b/koyeb/api/models/regional_deployment_volume.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -21,32 +21,32 @@ from typing import Any, ClassVar, Dict, List, Optional from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class RegionalDeploymentVolume(BaseModel): """ RegionalDeploymentVolume - """ # noqa: E501 - + """ # noqa: E501 id: Optional[StrictStr] = None path: Optional[StrictStr] = None replica_index: Optional[StrictInt] = None __properties: ClassVar[List[str]] = ["id", "path", "replica_index"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -63,7 +63,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -81,11 +82,11 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "id": obj.get("id"), - "path": obj.get("path"), - "replica_index": obj.get("replica_index"), - } - ) + _obj = cls.model_validate({ + "id": obj.get("id"), + "path": obj.get("path"), + "replica_index": obj.get("replica_index") + }) return _obj + + diff --git a/koyeb/api/models/remove_organization_member_reply.py b/koyeb/api/models/remove_organization_member_reply.py index 774b8f85..f7c12bb9 100644 --- a/koyeb/api/models/remove_organization_member_reply.py +++ b/koyeb/api/models/remove_organization_member_reply.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -22,30 +22,30 @@ from koyeb.api.models.organization_member import OrganizationMember from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class RemoveOrganizationMemberReply(BaseModel): """ RemoveOrganizationMemberReply - """ # noqa: E501 - + """ # noqa: E501 member: Optional[OrganizationMember] = None __properties: ClassVar[List[str]] = ["member"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -62,7 +62,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -71,7 +72,7 @@ def to_dict(self) -> Dict[str, Any]: ) # override the default output from pydantic by calling `to_dict()` of member if self.member: - _dict["member"] = self.member.to_dict() + _dict['member'] = self.member.to_dict() return _dict @classmethod @@ -83,13 +84,9 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "member": ( - OrganizationMember.from_dict(obj["member"]) - if obj.get("member") is not None - else None - ) - } - ) + _obj = cls.model_validate({ + "member": OrganizationMember.from_dict(obj["member"]) if obj.get("member") is not None else None + }) return _obj + + diff --git a/koyeb/api/models/resend_organization_invitation_reply.py b/koyeb/api/models/resend_organization_invitation_reply.py index f386bd4a..58db6109 100644 --- a/koyeb/api/models/resend_organization_invitation_reply.py +++ b/koyeb/api/models/resend_organization_invitation_reply.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -22,30 +22,30 @@ from koyeb.api.models.organization_invitation import OrganizationInvitation from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class ResendOrganizationInvitationReply(BaseModel): """ ResendOrganizationInvitationReply - """ # noqa: E501 - + """ # noqa: E501 invitation: Optional[OrganizationInvitation] = None __properties: ClassVar[List[str]] = ["invitation"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -62,7 +62,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -71,7 +72,7 @@ def to_dict(self) -> Dict[str, Any]: ) # override the default output from pydantic by calling `to_dict()` of invitation if self.invitation: - _dict["invitation"] = self.invitation.to_dict() + _dict['invitation'] = self.invitation.to_dict() return _dict @classmethod @@ -83,13 +84,9 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "invitation": ( - OrganizationInvitation.from_dict(obj["invitation"]) - if obj.get("invitation") is not None - else None - ) - } - ) + _obj = cls.model_validate({ + "invitation": OrganizationInvitation.from_dict(obj["invitation"]) if obj.get("invitation") is not None else None + }) return _obj + + diff --git a/koyeb/api/models/reset_password_request.py b/koyeb/api/models/reset_password_request.py index db029043..f2016ae1 100644 --- a/koyeb/api/models/reset_password_request.py +++ b/koyeb/api/models/reset_password_request.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -21,30 +21,30 @@ from typing import Any, ClassVar, Dict, List, Optional from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class ResetPasswordRequest(BaseModel): """ ResetPasswordRequest - """ # noqa: E501 - + """ # noqa: E501 email: Optional[StrictStr] = None __properties: ClassVar[List[str]] = ["email"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -61,7 +61,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -79,5 +80,9 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({"email": obj.get("email")}) + _obj = cls.model_validate({ + "email": obj.get("email") + }) return _obj + + diff --git a/koyeb/api/models/reveal_secret_reply.py b/koyeb/api/models/reveal_secret_reply.py index 1cec0282..ccb8be1c 100644 --- a/koyeb/api/models/reveal_secret_reply.py +++ b/koyeb/api/models/reveal_secret_reply.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -21,30 +21,30 @@ from typing import Any, ClassVar, Dict, List, Optional from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class RevealSecretReply(BaseModel): """ RevealSecretReply - """ # noqa: E501 - + """ # noqa: E501 value: Optional[Dict[str, Any]] = None __properties: ClassVar[List[str]] = ["value"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -61,7 +61,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -79,5 +80,9 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({"value": obj.get("value")}) + _obj = cls.model_validate({ + "value": obj.get("value") + }) return _obj + + diff --git a/koyeb/api/models/review_organization_capacity_reply.py b/koyeb/api/models/review_organization_capacity_reply.py index a6d51f5d..4d053dac 100644 --- a/koyeb/api/models/review_organization_capacity_reply.py +++ b/koyeb/api/models/review_organization_capacity_reply.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -21,30 +21,30 @@ from typing import Any, ClassVar, Dict, List, Optional from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class ReviewOrganizationCapacityReply(BaseModel): """ ReviewOrganizationCapacityReply - """ # noqa: E501 - + """ # noqa: E501 has_capacity: Optional[StrictBool] = None __properties: ClassVar[List[str]] = ["has_capacity"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -61,7 +61,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -79,5 +80,9 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({"has_capacity": obj.get("has_capacity")}) + _obj = cls.model_validate({ + "has_capacity": obj.get("has_capacity") + }) return _obj + + diff --git a/koyeb/api/models/review_organization_capacity_request.py b/koyeb/api/models/review_organization_capacity_request.py index d79a3cd4..e945f69a 100644 --- a/koyeb/api/models/review_organization_capacity_request.py +++ b/koyeb/api/models/review_organization_capacity_request.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -21,31 +21,31 @@ from typing import Any, ClassVar, Dict, List, Optional from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class ReviewOrganizationCapacityRequest(BaseModel): """ ReviewOrganizationCapacityRequest - """ # noqa: E501 - + """ # noqa: E501 plan: Optional[StrictStr] = None trialing: Optional[StrictBool] = None __properties: ClassVar[List[str]] = ["plan", "trialing"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -62,7 +62,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -80,7 +81,10 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - {"plan": obj.get("plan"), "trialing": obj.get("trialing")} - ) + _obj = cls.model_validate({ + "plan": obj.get("plan"), + "trialing": obj.get("trialing") + }) return _obj + + diff --git a/koyeb/api/models/route.py b/koyeb/api/models/route.py index 1472a07e..18410423 100644 --- a/koyeb/api/models/route.py +++ b/koyeb/api/models/route.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -19,33 +19,35 @@ from pydantic import BaseModel, ConfigDict, StrictInt, StrictStr from typing import Any, ClassVar, Dict, List, Optional +from koyeb.api.models.security_policies import SecurityPolicies from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class Route(BaseModel): """ Route - """ # noqa: E501 - + """ # noqa: E501 port: Optional[StrictInt] = None path: Optional[StrictStr] = None - __properties: ClassVar[List[str]] = ["port", "path"] + security_policies: Optional[SecurityPolicies] = None + __properties: ClassVar[List[str]] = ["port", "path", "security_policies"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -62,13 +64,17 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, exclude=excluded_fields, exclude_none=True, ) + # override the default output from pydantic by calling `to_dict()` of security_policies + if self.security_policies: + _dict['security_policies'] = self.security_policies.to_dict() return _dict @classmethod @@ -80,5 +86,11 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({"port": obj.get("port"), "path": obj.get("path")}) + _obj = cls.model_validate({ + "port": obj.get("port"), + "path": obj.get("path"), + "security_policies": SecurityPolicies.from_dict(obj["security_policies"]) if obj.get("security_policies") is not None else None + }) return _obj + + diff --git a/koyeb/api/models/sample.py b/koyeb/api/models/sample.py index 6ba1f284..a21ef90f 100644 --- a/koyeb/api/models/sample.py +++ b/koyeb/api/models/sample.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -21,31 +21,31 @@ from typing import Any, ClassVar, Dict, List, Optional, Union from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class Sample(BaseModel): """ Sample - """ # noqa: E501 - + """ # noqa: E501 timestamp: Optional[StrictStr] = None value: Optional[Union[StrictFloat, StrictInt]] = None __properties: ClassVar[List[str]] = ["timestamp", "value"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -62,7 +62,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -80,7 +81,10 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - {"timestamp": obj.get("timestamp"), "value": obj.get("value")} - ) + _obj = cls.model_validate({ + "timestamp": obj.get("timestamp"), + "value": obj.get("value") + }) return _obj + + diff --git a/koyeb/api/models/sandbox_metadata.py b/koyeb/api/models/sandbox_metadata.py new file mode 100644 index 00000000..9233fbc2 --- /dev/null +++ b/koyeb/api/models/sandbox_metadata.py @@ -0,0 +1,90 @@ +# coding: utf-8 + +""" + Koyeb Rest API + + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class SandboxMetadata(BaseModel): + """ + SandboxMetadata + """ # noqa: E501 + public_url: Optional[StrictStr] = None + routing_key: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["public_url", "routing_key"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of SandboxMetadata from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of SandboxMetadata from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "public_url": obj.get("public_url"), + "routing_key": obj.get("routing_key") + }) + return _obj + + diff --git a/koyeb/api/models/scale_to_zero_quotas.py b/koyeb/api/models/scale_to_zero_quotas.py index ad114f00..9f6ce06d 100644 --- a/koyeb/api/models/scale_to_zero_quotas.py +++ b/koyeb/api/models/scale_to_zero_quotas.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -21,42 +21,35 @@ from typing import Any, ClassVar, Dict, List, Optional from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class ScaleToZeroQuotas(BaseModel): """ ScaleToZeroQuotas - """ # noqa: E501 - + """ # noqa: E501 is_deep_sleep_enabled: Optional[StrictBool] = None deep_sleep_idle_delay_min: Optional[StrictInt] = None deep_sleep_idle_delay_max: Optional[StrictInt] = None is_light_sleep_enabled: Optional[StrictBool] = None light_sleep_idle_delay_min: Optional[StrictInt] = None light_sleep_idle_delay_max: Optional[StrictInt] = None - __properties: ClassVar[List[str]] = [ - "is_deep_sleep_enabled", - "deep_sleep_idle_delay_min", - "deep_sleep_idle_delay_max", - "is_light_sleep_enabled", - "light_sleep_idle_delay_min", - "light_sleep_idle_delay_max", - ] + __properties: ClassVar[List[str]] = ["is_deep_sleep_enabled", "deep_sleep_idle_delay_min", "deep_sleep_idle_delay_max", "is_light_sleep_enabled", "light_sleep_idle_delay_min", "light_sleep_idle_delay_max"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -73,7 +66,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -91,14 +85,14 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "is_deep_sleep_enabled": obj.get("is_deep_sleep_enabled"), - "deep_sleep_idle_delay_min": obj.get("deep_sleep_idle_delay_min"), - "deep_sleep_idle_delay_max": obj.get("deep_sleep_idle_delay_max"), - "is_light_sleep_enabled": obj.get("is_light_sleep_enabled"), - "light_sleep_idle_delay_min": obj.get("light_sleep_idle_delay_min"), - "light_sleep_idle_delay_max": obj.get("light_sleep_idle_delay_max"), - } - ) + _obj = cls.model_validate({ + "is_deep_sleep_enabled": obj.get("is_deep_sleep_enabled"), + "deep_sleep_idle_delay_min": obj.get("deep_sleep_idle_delay_min"), + "deep_sleep_idle_delay_max": obj.get("deep_sleep_idle_delay_max"), + "is_light_sleep_enabled": obj.get("is_light_sleep_enabled"), + "light_sleep_idle_delay_min": obj.get("light_sleep_idle_delay_min"), + "light_sleep_idle_delay_max": obj.get("light_sleep_idle_delay_max") + }) return _obj + + diff --git a/koyeb/api/models/scaling.py b/koyeb/api/models/scaling.py index 7b0a417c..19fcc4d7 100644 --- a/koyeb/api/models/scaling.py +++ b/koyeb/api/models/scaling.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -22,32 +22,32 @@ from koyeb.api.models.deployment_scaling_target import DeploymentScalingTarget from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class Scaling(BaseModel): """ Scaling - """ # noqa: E501 - + """ # noqa: E501 min: Optional[StrictInt] = None max: Optional[StrictInt] = None targets: Optional[List[DeploymentScalingTarget]] = None __properties: ClassVar[List[str]] = ["min", "max", "targets"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -64,7 +64,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -77,7 +78,7 @@ def to_dict(self) -> Dict[str, Any]: for _item_targets in self.targets: if _item_targets: _items.append(_item_targets.to_dict()) - _dict["targets"] = _items + _dict['targets'] = _items return _dict @classmethod @@ -89,18 +90,11 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "min": obj.get("min"), - "max": obj.get("max"), - "targets": ( - [ - DeploymentScalingTarget.from_dict(_item) - for _item in obj["targets"] - ] - if obj.get("targets") is not None - else None - ), - } - ) + _obj = cls.model_validate({ + "min": obj.get("min"), + "max": obj.get("max"), + "targets": [DeploymentScalingTarget.from_dict(_item) for _item in obj["targets"]] if obj.get("targets") is not None else None + }) return _obj + + diff --git a/koyeb/api/models/secret.py b/koyeb/api/models/secret.py index 8f3686a2..c811ec50 100644 --- a/koyeb/api/models/secret.py +++ b/koyeb/api/models/secret.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -18,40 +18,32 @@ import json from datetime import datetime -from pydantic import BaseModel, ConfigDict, StrictStr +from pydantic import BaseModel, ConfigDict, Field, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from koyeb.api.models.azure_container_registry_configuration import ( - AzureContainerRegistryConfiguration, -) +from koyeb.api.models.azure_container_registry_configuration import AzureContainerRegistryConfiguration from koyeb.api.models.database_role_password import DatabaseRolePassword -from koyeb.api.models.digital_ocean_registry_configuration import ( - DigitalOceanRegistryConfiguration, -) -from koyeb.api.models.docker_hub_registry_configuration import ( - DockerHubRegistryConfiguration, -) -from koyeb.api.models.gcp_container_registry_configuration import ( - GCPContainerRegistryConfiguration, -) +from koyeb.api.models.digital_ocean_registry_configuration import DigitalOceanRegistryConfiguration +from koyeb.api.models.docker_hub_registry_configuration import DockerHubRegistryConfiguration +from koyeb.api.models.gcp_container_registry_configuration import GCPContainerRegistryConfiguration from koyeb.api.models.git_hub_registry_configuration import GitHubRegistryConfiguration from koyeb.api.models.git_lab_registry_configuration import GitLabRegistryConfiguration from koyeb.api.models.private_registry_configuration import PrivateRegistryConfiguration from koyeb.api.models.secret_type import SecretType from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class Secret(BaseModel): """ Secret - """ # noqa: E501 - + """ # noqa: E501 id: Optional[StrictStr] = None name: Optional[StrictStr] = None organization_id: Optional[StrictStr] = None type: Optional[SecretType] = SecretType.SIMPLE updated_at: Optional[datetime] = None created_at: Optional[datetime] = None + project_id: Optional[StrictStr] = Field(default=None, description="The project ID this secret belongs to. Empty if the secret is organization-level.") value: Optional[StrictStr] = None docker_hub_registry: Optional[DockerHubRegistryConfiguration] = None private_registry: Optional[PrivateRegistryConfiguration] = None @@ -61,38 +53,23 @@ class Secret(BaseModel): gcp_container_registry: Optional[GCPContainerRegistryConfiguration] = None azure_container_registry: Optional[AzureContainerRegistryConfiguration] = None database_role_password: Optional[DatabaseRolePassword] = None - __properties: ClassVar[List[str]] = [ - "id", - "name", - "organization_id", - "type", - "updated_at", - "created_at", - "value", - "docker_hub_registry", - "private_registry", - "digital_ocean_registry", - "github_registry", - "gitlab_registry", - "gcp_container_registry", - "azure_container_registry", - "database_role_password", - ] + __properties: ClassVar[List[str]] = ["id", "name", "organization_id", "type", "updated_at", "created_at", "project_id", "value", "docker_hub_registry", "private_registry", "digital_ocean_registry", "github_registry", "gitlab_registry", "gcp_container_registry", "azure_container_registry", "database_role_password"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -109,7 +86,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -118,28 +96,28 @@ def to_dict(self) -> Dict[str, Any]: ) # override the default output from pydantic by calling `to_dict()` of docker_hub_registry if self.docker_hub_registry: - _dict["docker_hub_registry"] = self.docker_hub_registry.to_dict() + _dict['docker_hub_registry'] = self.docker_hub_registry.to_dict() # override the default output from pydantic by calling `to_dict()` of private_registry if self.private_registry: - _dict["private_registry"] = self.private_registry.to_dict() + _dict['private_registry'] = self.private_registry.to_dict() # override the default output from pydantic by calling `to_dict()` of digital_ocean_registry if self.digital_ocean_registry: - _dict["digital_ocean_registry"] = self.digital_ocean_registry.to_dict() + _dict['digital_ocean_registry'] = self.digital_ocean_registry.to_dict() # override the default output from pydantic by calling `to_dict()` of github_registry if self.github_registry: - _dict["github_registry"] = self.github_registry.to_dict() + _dict['github_registry'] = self.github_registry.to_dict() # override the default output from pydantic by calling `to_dict()` of gitlab_registry if self.gitlab_registry: - _dict["gitlab_registry"] = self.gitlab_registry.to_dict() + _dict['gitlab_registry'] = self.gitlab_registry.to_dict() # override the default output from pydantic by calling `to_dict()` of gcp_container_registry if self.gcp_container_registry: - _dict["gcp_container_registry"] = self.gcp_container_registry.to_dict() + _dict['gcp_container_registry'] = self.gcp_container_registry.to_dict() # override the default output from pydantic by calling `to_dict()` of azure_container_registry if self.azure_container_registry: - _dict["azure_container_registry"] = self.azure_container_registry.to_dict() + _dict['azure_container_registry'] = self.azure_container_registry.to_dict() # override the default output from pydantic by calling `to_dict()` of database_role_password if self.database_role_password: - _dict["database_role_password"] = self.database_role_password.to_dict() + _dict['database_role_password'] = self.database_role_password.to_dict() return _dict @classmethod @@ -151,65 +129,24 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "id": obj.get("id"), - "name": obj.get("name"), - "organization_id": obj.get("organization_id"), - "type": ( - obj.get("type") - if obj.get("type") is not None - else SecretType.SIMPLE - ), - "updated_at": obj.get("updated_at"), - "created_at": obj.get("created_at"), - "value": obj.get("value"), - "docker_hub_registry": ( - DockerHubRegistryConfiguration.from_dict(obj["docker_hub_registry"]) - if obj.get("docker_hub_registry") is not None - else None - ), - "private_registry": ( - PrivateRegistryConfiguration.from_dict(obj["private_registry"]) - if obj.get("private_registry") is not None - else None - ), - "digital_ocean_registry": ( - DigitalOceanRegistryConfiguration.from_dict( - obj["digital_ocean_registry"] - ) - if obj.get("digital_ocean_registry") is not None - else None - ), - "github_registry": ( - GitHubRegistryConfiguration.from_dict(obj["github_registry"]) - if obj.get("github_registry") is not None - else None - ), - "gitlab_registry": ( - GitLabRegistryConfiguration.from_dict(obj["gitlab_registry"]) - if obj.get("gitlab_registry") is not None - else None - ), - "gcp_container_registry": ( - GCPContainerRegistryConfiguration.from_dict( - obj["gcp_container_registry"] - ) - if obj.get("gcp_container_registry") is not None - else None - ), - "azure_container_registry": ( - AzureContainerRegistryConfiguration.from_dict( - obj["azure_container_registry"] - ) - if obj.get("azure_container_registry") is not None - else None - ), - "database_role_password": ( - DatabaseRolePassword.from_dict(obj["database_role_password"]) - if obj.get("database_role_password") is not None - else None - ), - } - ) + _obj = cls.model_validate({ + "id": obj.get("id"), + "name": obj.get("name"), + "organization_id": obj.get("organization_id"), + "type": obj.get("type") if obj.get("type") is not None else SecretType.SIMPLE, + "updated_at": obj.get("updated_at"), + "created_at": obj.get("created_at"), + "project_id": obj.get("project_id"), + "value": obj.get("value"), + "docker_hub_registry": DockerHubRegistryConfiguration.from_dict(obj["docker_hub_registry"]) if obj.get("docker_hub_registry") is not None else None, + "private_registry": PrivateRegistryConfiguration.from_dict(obj["private_registry"]) if obj.get("private_registry") is not None else None, + "digital_ocean_registry": DigitalOceanRegistryConfiguration.from_dict(obj["digital_ocean_registry"]) if obj.get("digital_ocean_registry") is not None else None, + "github_registry": GitHubRegistryConfiguration.from_dict(obj["github_registry"]) if obj.get("github_registry") is not None else None, + "gitlab_registry": GitLabRegistryConfiguration.from_dict(obj["gitlab_registry"]) if obj.get("gitlab_registry") is not None else None, + "gcp_container_registry": GCPContainerRegistryConfiguration.from_dict(obj["gcp_container_registry"]) if obj.get("gcp_container_registry") is not None else None, + "azure_container_registry": AzureContainerRegistryConfiguration.from_dict(obj["azure_container_registry"]) if obj.get("azure_container_registry") is not None else None, + "database_role_password": DatabaseRolePassword.from_dict(obj["database_role_password"]) if obj.get("database_role_password") is not None else None + }) return _obj + + diff --git a/koyeb/api/models/secret_type.py b/koyeb/api/models/secret_type.py index bd981586..241aca98 100644 --- a/koyeb/api/models/secret_type.py +++ b/koyeb/api/models/secret_type.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -26,11 +26,13 @@ class SecretType(str, Enum): """ allowed enum values """ - SIMPLE = "SIMPLE" - REGISTRY = "REGISTRY" - MANAGED = "MANAGED" + SIMPLE = 'SIMPLE' + REGISTRY = 'REGISTRY' + MANAGED = 'MANAGED' @classmethod def from_json(cls, json_str: str) -> Self: """Create an instance of SecretType from a JSON string""" return cls(json.loads(json_str)) + + diff --git a/koyeb/api/models/secrets_summary.py b/koyeb/api/models/secrets_summary.py index 6a09084e..83f0d8a9 100644 --- a/koyeb/api/models/secrets_summary.py +++ b/koyeb/api/models/secrets_summary.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -21,31 +21,31 @@ from typing import Any, ClassVar, Dict, List, Optional from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class SecretsSummary(BaseModel): """ SecretsSummary - """ # noqa: E501 - + """ # noqa: E501 total: Optional[StrictStr] = None by_type: Optional[Dict[str, StrictStr]] = None __properties: ClassVar[List[str]] = ["total", "by_type"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -62,7 +62,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -80,7 +81,10 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - {"total": obj.get("total"), "by_type": obj.get("by_type")} - ) + _obj = cls.model_validate({ + "total": obj.get("total"), + "by_type": obj.get("by_type") + }) return _obj + + diff --git a/koyeb/api/models/security_policies.py b/koyeb/api/models/security_policies.py new file mode 100644 index 00000000..690fcc17 --- /dev/null +++ b/koyeb/api/models/security_policies.py @@ -0,0 +1,98 @@ +# coding: utf-8 + +""" + Koyeb Rest API + + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from koyeb.api.models.basic_auth_policy import BasicAuthPolicy +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class SecurityPolicies(BaseModel): + """ + SecurityPolicies + """ # noqa: E501 + basic_auths: Optional[List[BasicAuthPolicy]] = None + api_keys: Optional[List[StrictStr]] = None + __properties: ClassVar[List[str]] = ["basic_auths", "api_keys"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of SecurityPolicies from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in basic_auths (list) + _items = [] + if self.basic_auths: + for _item_basic_auths in self.basic_auths: + if _item_basic_auths: + _items.append(_item_basic_auths.to_dict()) + _dict['basic_auths'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of SecurityPolicies from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "basic_auths": [BasicAuthPolicy.from_dict(_item) for _item in obj["basic_auths"]] if obj.get("basic_auths") is not None else None, + "api_keys": obj.get("api_keys") + }) + return _obj + + diff --git a/koyeb/api/models/service.py b/koyeb/api/models/service.py index 0f4b8ea5..b65021b6 100644 --- a/koyeb/api/models/service.py +++ b/koyeb/api/models/service.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -26,13 +26,12 @@ from koyeb.api.models.service_type import ServiceType from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class Service(BaseModel): """ Service - """ # noqa: E501 - + """ # noqa: E501 id: Optional[StrictStr] = None created_at: Optional[datetime] = None updated_at: Optional[datetime] = None @@ -53,43 +52,23 @@ class Service(BaseModel): last_provisioned_deployment_id: Optional[StrictStr] = None state: Optional[ServiceState] = None life_cycle: Optional[ServiceLifeCycle] = None - __properties: ClassVar[List[str]] = [ - "id", - "created_at", - "updated_at", - "started_at", - "succeeded_at", - "paused_at", - "resumed_at", - "terminated_at", - "name", - "type", - "organization_id", - "app_id", - "status", - "messages", - "version", - "active_deployment_id", - "latest_deployment_id", - "last_provisioned_deployment_id", - "state", - "life_cycle", - ] + __properties: ClassVar[List[str]] = ["id", "created_at", "updated_at", "started_at", "succeeded_at", "paused_at", "resumed_at", "terminated_at", "name", "type", "organization_id", "app_id", "status", "messages", "version", "active_deployment_id", "latest_deployment_id", "last_provisioned_deployment_id", "state", "life_cycle"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -106,7 +85,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -115,10 +95,10 @@ def to_dict(self) -> Dict[str, Any]: ) # override the default output from pydantic by calling `to_dict()` of state if self.state: - _dict["state"] = self.state.to_dict() + _dict['state'] = self.state.to_dict() # override the default output from pydantic by calling `to_dict()` of life_cycle if self.life_cycle: - _dict["life_cycle"] = self.life_cycle.to_dict() + _dict['life_cycle'] = self.life_cycle.to_dict() return _dict @classmethod @@ -130,46 +110,28 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "id": obj.get("id"), - "created_at": obj.get("created_at"), - "updated_at": obj.get("updated_at"), - "started_at": obj.get("started_at"), - "succeeded_at": obj.get("succeeded_at"), - "paused_at": obj.get("paused_at"), - "resumed_at": obj.get("resumed_at"), - "terminated_at": obj.get("terminated_at"), - "name": obj.get("name"), - "type": ( - obj.get("type") - if obj.get("type") is not None - else ServiceType.INVALID_TYPE - ), - "organization_id": obj.get("organization_id"), - "app_id": obj.get("app_id"), - "status": ( - obj.get("status") - if obj.get("status") is not None - else ServiceStatus.STARTING - ), - "messages": obj.get("messages"), - "version": obj.get("version"), - "active_deployment_id": obj.get("active_deployment_id"), - "latest_deployment_id": obj.get("latest_deployment_id"), - "last_provisioned_deployment_id": obj.get( - "last_provisioned_deployment_id" - ), - "state": ( - ServiceState.from_dict(obj["state"]) - if obj.get("state") is not None - else None - ), - "life_cycle": ( - ServiceLifeCycle.from_dict(obj["life_cycle"]) - if obj.get("life_cycle") is not None - else None - ), - } - ) + _obj = cls.model_validate({ + "id": obj.get("id"), + "created_at": obj.get("created_at"), + "updated_at": obj.get("updated_at"), + "started_at": obj.get("started_at"), + "succeeded_at": obj.get("succeeded_at"), + "paused_at": obj.get("paused_at"), + "resumed_at": obj.get("resumed_at"), + "terminated_at": obj.get("terminated_at"), + "name": obj.get("name"), + "type": obj.get("type") if obj.get("type") is not None else ServiceType.INVALID_TYPE, + "organization_id": obj.get("organization_id"), + "app_id": obj.get("app_id"), + "status": obj.get("status") if obj.get("status") is not None else ServiceStatus.STARTING, + "messages": obj.get("messages"), + "version": obj.get("version"), + "active_deployment_id": obj.get("active_deployment_id"), + "latest_deployment_id": obj.get("latest_deployment_id"), + "last_provisioned_deployment_id": obj.get("last_provisioned_deployment_id"), + "state": ServiceState.from_dict(obj["state"]) if obj.get("state") is not None else None, + "life_cycle": ServiceLifeCycle.from_dict(obj["life_cycle"]) if obj.get("life_cycle") is not None else None + }) return _obj + + diff --git a/koyeb/api/models/service_event.py b/koyeb/api/models/service_event.py index 68d2c5e2..381f2b0e 100644 --- a/koyeb/api/models/service_event.py +++ b/koyeb/api/models/service_event.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -22,13 +22,12 @@ from typing import Any, ClassVar, Dict, List, Optional from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class ServiceEvent(BaseModel): """ ServiceEvent - """ # noqa: E501 - + """ # noqa: E501 id: Optional[StrictStr] = None when: Optional[datetime] = None organization_id: Optional[StrictStr] = None @@ -36,30 +35,23 @@ class ServiceEvent(BaseModel): type: Optional[StrictStr] = None message: Optional[StrictStr] = None metadata: Optional[Dict[str, Any]] = None - __properties: ClassVar[List[str]] = [ - "id", - "when", - "organization_id", - "service_id", - "type", - "message", - "metadata", - ] + __properties: ClassVar[List[str]] = ["id", "when", "organization_id", "service_id", "type", "message", "metadata"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -76,7 +68,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -94,15 +87,15 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "id": obj.get("id"), - "when": obj.get("when"), - "organization_id": obj.get("organization_id"), - "service_id": obj.get("service_id"), - "type": obj.get("type"), - "message": obj.get("message"), - "metadata": obj.get("metadata"), - } - ) + _obj = cls.model_validate({ + "id": obj.get("id"), + "when": obj.get("when"), + "organization_id": obj.get("organization_id"), + "service_id": obj.get("service_id"), + "type": obj.get("type"), + "message": obj.get("message"), + "metadata": obj.get("metadata") + }) return _obj + + diff --git a/koyeb/api/models/service_life_cycle.py b/koyeb/api/models/service_life_cycle.py index 73e5b5b4..f0ee3a76 100644 --- a/koyeb/api/models/service_life_cycle.py +++ b/koyeb/api/models/service_life_cycle.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -21,31 +21,31 @@ from typing import Any, ClassVar, Dict, List, Optional from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class ServiceLifeCycle(BaseModel): """ ServiceLifeCycle - """ # noqa: E501 - + """ # noqa: E501 delete_after_sleep: Optional[StrictInt] = None delete_after_create: Optional[StrictInt] = None __properties: ClassVar[List[str]] = ["delete_after_sleep", "delete_after_create"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -62,7 +62,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -80,10 +81,10 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "delete_after_sleep": obj.get("delete_after_sleep"), - "delete_after_create": obj.get("delete_after_create"), - } - ) + _obj = cls.model_validate({ + "delete_after_sleep": obj.get("delete_after_sleep"), + "delete_after_create": obj.get("delete_after_create") + }) return _obj + + diff --git a/koyeb/api/models/service_list_item.py b/koyeb/api/models/service_list_item.py index 69c56d15..a9f6a3dc 100644 --- a/koyeb/api/models/service_list_item.py +++ b/koyeb/api/models/service_list_item.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -26,13 +26,12 @@ from koyeb.api.models.service_type import ServiceType from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class ServiceListItem(BaseModel): """ ServiceListItem - """ # noqa: E501 - + """ # noqa: E501 id: Optional[StrictStr] = None name: Optional[StrictStr] = None type: Optional[ServiceType] = ServiceType.INVALID_TYPE @@ -47,37 +46,23 @@ class ServiceListItem(BaseModel): active_deployment_id: Optional[StrictStr] = None latest_deployment_id: Optional[StrictStr] = None life_cycle: Optional[ServiceLifeCycle] = None - __properties: ClassVar[List[str]] = [ - "id", - "name", - "type", - "organization_id", - "app_id", - "updated_at", - "created_at", - "status", - "messages", - "version", - "state", - "active_deployment_id", - "latest_deployment_id", - "life_cycle", - ] + __properties: ClassVar[List[str]] = ["id", "name", "type", "organization_id", "app_id", "updated_at", "created_at", "status", "messages", "version", "state", "active_deployment_id", "latest_deployment_id", "life_cycle"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -94,7 +79,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -103,10 +89,10 @@ def to_dict(self) -> Dict[str, Any]: ) # override the default output from pydantic by calling `to_dict()` of state if self.state: - _dict["state"] = self.state.to_dict() + _dict['state'] = self.state.to_dict() # override the default output from pydantic by calling `to_dict()` of life_cycle if self.life_cycle: - _dict["life_cycle"] = self.life_cycle.to_dict() + _dict['life_cycle'] = self.life_cycle.to_dict() return _dict @classmethod @@ -118,38 +104,22 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "id": obj.get("id"), - "name": obj.get("name"), - "type": ( - obj.get("type") - if obj.get("type") is not None - else ServiceType.INVALID_TYPE - ), - "organization_id": obj.get("organization_id"), - "app_id": obj.get("app_id"), - "updated_at": obj.get("updated_at"), - "created_at": obj.get("created_at"), - "status": ( - obj.get("status") - if obj.get("status") is not None - else ServiceStatus.STARTING - ), - "messages": obj.get("messages"), - "version": obj.get("version"), - "state": ( - ServiceState.from_dict(obj["state"]) - if obj.get("state") is not None - else None - ), - "active_deployment_id": obj.get("active_deployment_id"), - "latest_deployment_id": obj.get("latest_deployment_id"), - "life_cycle": ( - ServiceLifeCycle.from_dict(obj["life_cycle"]) - if obj.get("life_cycle") is not None - else None - ), - } - ) + _obj = cls.model_validate({ + "id": obj.get("id"), + "name": obj.get("name"), + "type": obj.get("type") if obj.get("type") is not None else ServiceType.INVALID_TYPE, + "organization_id": obj.get("organization_id"), + "app_id": obj.get("app_id"), + "updated_at": obj.get("updated_at"), + "created_at": obj.get("created_at"), + "status": obj.get("status") if obj.get("status") is not None else ServiceStatus.STARTING, + "messages": obj.get("messages"), + "version": obj.get("version"), + "state": ServiceState.from_dict(obj["state"]) if obj.get("state") is not None else None, + "active_deployment_id": obj.get("active_deployment_id"), + "latest_deployment_id": obj.get("latest_deployment_id"), + "life_cycle": ServiceLifeCycle.from_dict(obj["life_cycle"]) if obj.get("life_cycle") is not None else None + }) return _obj + + diff --git a/koyeb/api/models/service_state.py b/koyeb/api/models/service_state.py index 3901a194..54515bee 100644 --- a/koyeb/api/models/service_state.py +++ b/koyeb/api/models/service_state.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -23,31 +23,31 @@ from koyeb.api.models.desired_deployment import DesiredDeployment from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class ServiceState(BaseModel): """ ServiceState - """ # noqa: E501 - + """ # noqa: E501 desired_deployment: Optional[DesiredDeployment] = None auto_release: Optional[AutoRelease] = None __properties: ClassVar[List[str]] = ["desired_deployment", "auto_release"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -64,7 +64,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -73,10 +74,10 @@ def to_dict(self) -> Dict[str, Any]: ) # override the default output from pydantic by calling `to_dict()` of desired_deployment if self.desired_deployment: - _dict["desired_deployment"] = self.desired_deployment.to_dict() + _dict['desired_deployment'] = self.desired_deployment.to_dict() # override the default output from pydantic by calling `to_dict()` of auto_release if self.auto_release: - _dict["auto_release"] = self.auto_release.to_dict() + _dict['auto_release'] = self.auto_release.to_dict() return _dict @classmethod @@ -88,18 +89,10 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "desired_deployment": ( - DesiredDeployment.from_dict(obj["desired_deployment"]) - if obj.get("desired_deployment") is not None - else None - ), - "auto_release": ( - AutoRelease.from_dict(obj["auto_release"]) - if obj.get("auto_release") is not None - else None - ), - } - ) + _obj = cls.model_validate({ + "desired_deployment": DesiredDeployment.from_dict(obj["desired_deployment"]) if obj.get("desired_deployment") is not None else None, + "auto_release": AutoRelease.from_dict(obj["auto_release"]) if obj.get("auto_release") is not None else None + }) return _obj + + diff --git a/koyeb/api/models/service_status.py b/koyeb/api/models/service_status.py index 13361867..f0f5bfb1 100644 --- a/koyeb/api/models/service_status.py +++ b/koyeb/api/models/service_status.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -26,17 +26,19 @@ class ServiceStatus(str, Enum): """ allowed enum values """ - STARTING = "STARTING" - HEALTHY = "HEALTHY" - DEGRADED = "DEGRADED" - UNHEALTHY = "UNHEALTHY" - DELETING = "DELETING" - DELETED = "DELETED" - PAUSING = "PAUSING" - PAUSED = "PAUSED" - RESUMING = "RESUMING" + STARTING = 'STARTING' + HEALTHY = 'HEALTHY' + DEGRADED = 'DEGRADED' + UNHEALTHY = 'UNHEALTHY' + DELETING = 'DELETING' + DELETED = 'DELETED' + PAUSING = 'PAUSING' + PAUSED = 'PAUSED' + RESUMING = 'RESUMING' @classmethod def from_json(cls, json_str: str) -> Self: """Create an instance of ServiceStatus from a JSON string""" return cls(json.loads(json_str)) + + diff --git a/koyeb/api/models/service_summary.py b/koyeb/api/models/service_summary.py index a9792d7f..5f36d154 100644 --- a/koyeb/api/models/service_summary.py +++ b/koyeb/api/models/service_summary.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -21,31 +21,31 @@ from typing import Any, ClassVar, Dict, List, Optional from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class ServiceSummary(BaseModel): """ ServiceSummary - """ # noqa: E501 - + """ # noqa: E501 total: Optional[StrictStr] = None by_status: Optional[Dict[str, StrictStr]] = None __properties: ClassVar[List[str]] = ["total", "by_status"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -62,7 +62,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -80,7 +81,10 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - {"total": obj.get("total"), "by_status": obj.get("by_status")} - ) + _obj = cls.model_validate({ + "total": obj.get("total"), + "by_status": obj.get("by_status") + }) return _obj + + diff --git a/koyeb/api/models/service_type.py b/koyeb/api/models/service_type.py index bfe1799f..684e867e 100644 --- a/koyeb/api/models/service_type.py +++ b/koyeb/api/models/service_type.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -26,13 +26,15 @@ class ServiceType(str, Enum): """ allowed enum values """ - INVALID_TYPE = "INVALID_TYPE" - WEB = "WEB" - WORKER = "WORKER" - DATABASE = "DATABASE" - SANDBOX = "SANDBOX" + INVALID_TYPE = 'INVALID_TYPE' + WEB = 'WEB' + WORKER = 'WORKER' + DATABASE = 'DATABASE' + SANDBOX = 'SANDBOX' @classmethod def from_json(cls, json_str: str) -> Self: """Create an instance of ServiceType from a JSON string""" return cls(json.loads(json_str)) + + diff --git a/koyeb/api/models/service_usage.py b/koyeb/api/models/service_usage.py index 8549b726..862052de 100644 --- a/koyeb/api/models/service_usage.py +++ b/koyeb/api/models/service_usage.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -22,32 +22,32 @@ from koyeb.api.models.region_usage import RegionUsage from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class ServiceUsage(BaseModel): """ ServiceUsage - """ # noqa: E501 - + """ # noqa: E501 service_id: Optional[StrictStr] = None service_name: Optional[StrictStr] = None regions: Optional[Dict[str, RegionUsage]] = None __properties: ClassVar[List[str]] = ["service_id", "service_name", "regions"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -64,7 +64,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -77,7 +78,7 @@ def to_dict(self) -> Dict[str, Any]: for _key_regions in self.regions: if self.regions[_key_regions]: _field_dict[_key_regions] = self.regions[_key_regions].to_dict() - _dict["regions"] = _field_dict + _dict['regions'] = _field_dict return _dict @classmethod @@ -89,18 +90,16 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "service_id": obj.get("service_id"), - "service_name": obj.get("service_name"), - "regions": ( - dict( - (_k, RegionUsage.from_dict(_v)) - for _k, _v in obj["regions"].items() - ) - if obj.get("regions") is not None - else None - ), - } - ) + _obj = cls.model_validate({ + "service_id": obj.get("service_id"), + "service_name": obj.get("service_name"), + "regions": dict( + (_k, RegionUsage.from_dict(_v)) + for _k, _v in obj["regions"].items() + ) + if obj.get("regions") is not None + else None + }) return _obj + + diff --git a/koyeb/api/models/snapshot.py b/koyeb/api/models/snapshot.py index e73f244a..7690d461 100644 --- a/koyeb/api/models/snapshot.py +++ b/koyeb/api/models/snapshot.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -24,13 +24,12 @@ from koyeb.api.models.snapshot_type import SnapshotType from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class Snapshot(BaseModel): """ The object that represents a snapshot. It can either be local, on a node, or remote, in a cold storage. - """ # noqa: E501 - + """ # noqa: E501 id: Optional[StrictStr] = None name: Optional[StrictStr] = None size: Optional[StrictInt] = None @@ -42,34 +41,23 @@ class Snapshot(BaseModel): region: Optional[StrictStr] = None status: Optional[SnapshotStatus] = SnapshotStatus.SNAPSHOT_STATUS_INVALID type: Optional[SnapshotType] = SnapshotType.SNAPSHOT_TYPE_INVALID - __properties: ClassVar[List[str]] = [ - "id", - "name", - "size", - "created_at", - "updated_at", - "deleted_at", - "organization_id", - "parent_volume_id", - "region", - "status", - "type", - ] + __properties: ClassVar[List[str]] = ["id", "name", "size", "created_at", "updated_at", "deleted_at", "organization_id", "parent_volume_id", "region", "status", "type"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -86,7 +74,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -104,27 +93,19 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "id": obj.get("id"), - "name": obj.get("name"), - "size": obj.get("size"), - "created_at": obj.get("created_at"), - "updated_at": obj.get("updated_at"), - "deleted_at": obj.get("deleted_at"), - "organization_id": obj.get("organization_id"), - "parent_volume_id": obj.get("parent_volume_id"), - "region": obj.get("region"), - "status": ( - obj.get("status") - if obj.get("status") is not None - else SnapshotStatus.SNAPSHOT_STATUS_INVALID - ), - "type": ( - obj.get("type") - if obj.get("type") is not None - else SnapshotType.SNAPSHOT_TYPE_INVALID - ), - } - ) + _obj = cls.model_validate({ + "id": obj.get("id"), + "name": obj.get("name"), + "size": obj.get("size"), + "created_at": obj.get("created_at"), + "updated_at": obj.get("updated_at"), + "deleted_at": obj.get("deleted_at"), + "organization_id": obj.get("organization_id"), + "parent_volume_id": obj.get("parent_volume_id"), + "region": obj.get("region"), + "status": obj.get("status") if obj.get("status") is not None else SnapshotStatus.SNAPSHOT_STATUS_INVALID, + "type": obj.get("type") if obj.get("type") is not None else SnapshotType.SNAPSHOT_TYPE_INVALID + }) return _obj + + diff --git a/koyeb/api/models/snapshot_status.py b/koyeb/api/models/snapshot_status.py index 276a1703..ec7f810c 100644 --- a/koyeb/api/models/snapshot_status.py +++ b/koyeb/api/models/snapshot_status.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -26,14 +26,16 @@ class SnapshotStatus(str, Enum): """ allowed enum values """ - SNAPSHOT_STATUS_INVALID = "SNAPSHOT_STATUS_INVALID" - SNAPSHOT_STATUS_CREATING = "SNAPSHOT_STATUS_CREATING" - SNAPSHOT_STATUS_AVAILABLE = "SNAPSHOT_STATUS_AVAILABLE" - SNAPSHOT_STATUS_MIGRATING = "SNAPSHOT_STATUS_MIGRATING" - SNAPSHOT_STATUS_DELETING = "SNAPSHOT_STATUS_DELETING" - SNAPSHOT_STATUS_DELETED = "SNAPSHOT_STATUS_DELETED" + SNAPSHOT_STATUS_INVALID = 'SNAPSHOT_STATUS_INVALID' + SNAPSHOT_STATUS_CREATING = 'SNAPSHOT_STATUS_CREATING' + SNAPSHOT_STATUS_AVAILABLE = 'SNAPSHOT_STATUS_AVAILABLE' + SNAPSHOT_STATUS_MIGRATING = 'SNAPSHOT_STATUS_MIGRATING' + SNAPSHOT_STATUS_DELETING = 'SNAPSHOT_STATUS_DELETING' + SNAPSHOT_STATUS_DELETED = 'SNAPSHOT_STATUS_DELETED' @classmethod def from_json(cls, json_str: str) -> Self: """Create an instance of SnapshotStatus from a JSON string""" return cls(json.loads(json_str)) + + diff --git a/koyeb/api/models/snapshot_type.py b/koyeb/api/models/snapshot_type.py index ffb02a39..bbe3f47a 100644 --- a/koyeb/api/models/snapshot_type.py +++ b/koyeb/api/models/snapshot_type.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -26,11 +26,13 @@ class SnapshotType(str, Enum): """ allowed enum values """ - SNAPSHOT_TYPE_INVALID = "SNAPSHOT_TYPE_INVALID" - SNAPSHOT_TYPE_LOCAL = "SNAPSHOT_TYPE_LOCAL" - SNAPSHOT_TYPE_REMOTE = "SNAPSHOT_TYPE_REMOTE" + SNAPSHOT_TYPE_INVALID = 'SNAPSHOT_TYPE_INVALID' + SNAPSHOT_TYPE_LOCAL = 'SNAPSHOT_TYPE_LOCAL' + SNAPSHOT_TYPE_REMOTE = 'SNAPSHOT_TYPE_REMOTE' @classmethod def from_json(cls, json_str: str) -> Self: """Create an instance of SnapshotType from a JSON string""" return cls(json.loads(json_str)) + + diff --git a/koyeb/api/models/stream_result_of_exec_command_reply.py b/koyeb/api/models/stream_result_of_exec_command_reply.py index 828a1fe2..eeaa66c1 100644 --- a/koyeb/api/models/stream_result_of_exec_command_reply.py +++ b/koyeb/api/models/stream_result_of_exec_command_reply.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -23,31 +23,31 @@ from koyeb.api.models.google_rpc_status import GoogleRpcStatus from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class StreamResultOfExecCommandReply(BaseModel): """ StreamResultOfExecCommandReply - """ # noqa: E501 - + """ # noqa: E501 result: Optional[ExecCommandReply] = None error: Optional[GoogleRpcStatus] = None __properties: ClassVar[List[str]] = ["result", "error"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -64,7 +64,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -73,10 +74,10 @@ def to_dict(self) -> Dict[str, Any]: ) # override the default output from pydantic by calling `to_dict()` of result if self.result: - _dict["result"] = self.result.to_dict() + _dict['result'] = self.result.to_dict() # override the default output from pydantic by calling `to_dict()` of error if self.error: - _dict["error"] = self.error.to_dict() + _dict['error'] = self.error.to_dict() return _dict @classmethod @@ -88,18 +89,10 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "result": ( - ExecCommandReply.from_dict(obj["result"]) - if obj.get("result") is not None - else None - ), - "error": ( - GoogleRpcStatus.from_dict(obj["error"]) - if obj.get("error") is not None - else None - ), - } - ) + _obj = cls.model_validate({ + "result": ExecCommandReply.from_dict(obj["result"]) if obj.get("result") is not None else None, + "error": GoogleRpcStatus.from_dict(obj["error"]) if obj.get("error") is not None else None + }) return _obj + + diff --git a/koyeb/api/models/stream_result_of_log_entry.py b/koyeb/api/models/stream_result_of_log_entry.py index e8ded709..e4818d19 100644 --- a/koyeb/api/models/stream_result_of_log_entry.py +++ b/koyeb/api/models/stream_result_of_log_entry.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -23,31 +23,31 @@ from koyeb.api.models.log_entry import LogEntry from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class StreamResultOfLogEntry(BaseModel): """ StreamResultOfLogEntry - """ # noqa: E501 - + """ # noqa: E501 result: Optional[LogEntry] = None error: Optional[GoogleRpcStatus] = None __properties: ClassVar[List[str]] = ["result", "error"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -64,7 +64,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -73,10 +74,10 @@ def to_dict(self) -> Dict[str, Any]: ) # override the default output from pydantic by calling `to_dict()` of result if self.result: - _dict["result"] = self.result.to_dict() + _dict['result'] = self.result.to_dict() # override the default output from pydantic by calling `to_dict()` of error if self.error: - _dict["error"] = self.error.to_dict() + _dict['error'] = self.error.to_dict() return _dict @classmethod @@ -88,18 +89,10 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "result": ( - LogEntry.from_dict(obj["result"]) - if obj.get("result") is not None - else None - ), - "error": ( - GoogleRpcStatus.from_dict(obj["error"]) - if obj.get("error") is not None - else None - ), - } - ) + _obj = cls.model_validate({ + "result": LogEntry.from_dict(obj["result"]) if obj.get("result") is not None else None, + "error": GoogleRpcStatus.from_dict(obj["error"]) if obj.get("error") is not None else None + }) return _obj + + diff --git a/koyeb/api/models/subscription.py b/koyeb/api/models/subscription.py index 8605dff5..7d1b4889 100644 --- a/koyeb/api/models/subscription.py +++ b/koyeb/api/models/subscription.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -24,13 +24,12 @@ from koyeb.api.models.subscription_status import SubscriptionStatus from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class Subscription(BaseModel): """ Subscription - """ # noqa: E501 - + """ # noqa: E501 id: Optional[StrictStr] = None created_at: Optional[datetime] = None updated_at: Optional[datetime] = None @@ -55,47 +54,23 @@ class Subscription(BaseModel): trial_ends_at: Optional[datetime] = None trial_max_spend: Optional[StrictStr] = None current_spend: Optional[StrictStr] = None - __properties: ClassVar[List[str]] = [ - "id", - "created_at", - "updated_at", - "version", - "organization_id", - "stripe_subscription_id", - "status", - "messages", - "has_pending_update", - "stripe_pending_invoice_id", - "terminate_at", - "canceled_at", - "terminated_at", - "current_period_start", - "current_period_end", - "currency", - "amount_payable", - "amount_paid", - "amount_remaining", - "payment_failure", - "trialing", - "trial_ends_at", - "trial_max_spend", - "current_spend", - ] + __properties: ClassVar[List[str]] = ["id", "created_at", "updated_at", "version", "organization_id", "stripe_subscription_id", "status", "messages", "has_pending_update", "stripe_pending_invoice_id", "terminate_at", "canceled_at", "terminated_at", "current_period_start", "current_period_end", "currency", "amount_payable", "amount_paid", "amount_remaining", "payment_failure", "trialing", "trial_ends_at", "trial_max_spend", "current_spend"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -112,7 +87,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -121,7 +97,7 @@ def to_dict(self) -> Dict[str, Any]: ) # override the default output from pydantic by calling `to_dict()` of payment_failure if self.payment_failure: - _dict["payment_failure"] = self.payment_failure.to_dict() + _dict['payment_failure'] = self.payment_failure.to_dict() return _dict @classmethod @@ -133,40 +109,32 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "id": obj.get("id"), - "created_at": obj.get("created_at"), - "updated_at": obj.get("updated_at"), - "version": obj.get("version"), - "organization_id": obj.get("organization_id"), - "stripe_subscription_id": obj.get("stripe_subscription_id"), - "status": ( - obj.get("status") - if obj.get("status") is not None - else SubscriptionStatus.INVALID - ), - "messages": obj.get("messages"), - "has_pending_update": obj.get("has_pending_update"), - "stripe_pending_invoice_id": obj.get("stripe_pending_invoice_id"), - "terminate_at": obj.get("terminate_at"), - "canceled_at": obj.get("canceled_at"), - "terminated_at": obj.get("terminated_at"), - "current_period_start": obj.get("current_period_start"), - "current_period_end": obj.get("current_period_end"), - "currency": obj.get("currency"), - "amount_payable": obj.get("amount_payable"), - "amount_paid": obj.get("amount_paid"), - "amount_remaining": obj.get("amount_remaining"), - "payment_failure": ( - SubscriptionPaymentFailure.from_dict(obj["payment_failure"]) - if obj.get("payment_failure") is not None - else None - ), - "trialing": obj.get("trialing"), - "trial_ends_at": obj.get("trial_ends_at"), - "trial_max_spend": obj.get("trial_max_spend"), - "current_spend": obj.get("current_spend"), - } - ) + _obj = cls.model_validate({ + "id": obj.get("id"), + "created_at": obj.get("created_at"), + "updated_at": obj.get("updated_at"), + "version": obj.get("version"), + "organization_id": obj.get("organization_id"), + "stripe_subscription_id": obj.get("stripe_subscription_id"), + "status": obj.get("status") if obj.get("status") is not None else SubscriptionStatus.INVALID, + "messages": obj.get("messages"), + "has_pending_update": obj.get("has_pending_update"), + "stripe_pending_invoice_id": obj.get("stripe_pending_invoice_id"), + "terminate_at": obj.get("terminate_at"), + "canceled_at": obj.get("canceled_at"), + "terminated_at": obj.get("terminated_at"), + "current_period_start": obj.get("current_period_start"), + "current_period_end": obj.get("current_period_end"), + "currency": obj.get("currency"), + "amount_payable": obj.get("amount_payable"), + "amount_paid": obj.get("amount_paid"), + "amount_remaining": obj.get("amount_remaining"), + "payment_failure": SubscriptionPaymentFailure.from_dict(obj["payment_failure"]) if obj.get("payment_failure") is not None else None, + "trialing": obj.get("trialing"), + "trial_ends_at": obj.get("trial_ends_at"), + "trial_max_spend": obj.get("trial_max_spend"), + "current_spend": obj.get("current_spend") + }) return _obj + + diff --git a/koyeb/api/models/subscription_payment_failure.py b/koyeb/api/models/subscription_payment_failure.py index 724a68cb..5a26fa06 100644 --- a/koyeb/api/models/subscription_payment_failure.py +++ b/koyeb/api/models/subscription_payment_failure.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -20,18 +20,15 @@ from datetime import datetime from pydantic import BaseModel, ConfigDict, StrictBool, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from koyeb.api.models.subscription_payment_failure_stripe_sdk import ( - SubscriptionPaymentFailureStripeSDK, -) +from koyeb.api.models.subscription_payment_failure_stripe_sdk import SubscriptionPaymentFailureStripeSDK from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class SubscriptionPaymentFailure(BaseModel): """ SubscriptionPaymentFailure - """ # noqa: E501 - + """ # noqa: E501 failed_at: Optional[datetime] = None next_attempt: Optional[datetime] = None attempt_count: Optional[StrictStr] = None @@ -42,33 +39,23 @@ class SubscriptionPaymentFailure(BaseModel): payment_method_required: Optional[StrictBool] = None redirect_url: Optional[StrictStr] = None stripe_sdk: Optional[SubscriptionPaymentFailureStripeSDK] = None - __properties: ClassVar[List[str]] = [ - "failed_at", - "next_attempt", - "attempt_count", - "error_code", - "error_reason", - "error_type", - "error_message", - "payment_method_required", - "redirect_url", - "stripe_sdk", - ] + __properties: ClassVar[List[str]] = ["failed_at", "next_attempt", "attempt_count", "error_code", "error_reason", "error_type", "error_message", "payment_method_required", "redirect_url", "stripe_sdk"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -85,7 +72,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -94,7 +82,7 @@ def to_dict(self) -> Dict[str, Any]: ) # override the default output from pydantic by calling `to_dict()` of stripe_sdk if self.stripe_sdk: - _dict["stripe_sdk"] = self.stripe_sdk.to_dict() + _dict['stripe_sdk'] = self.stripe_sdk.to_dict() return _dict @classmethod @@ -106,22 +94,18 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "failed_at": obj.get("failed_at"), - "next_attempt": obj.get("next_attempt"), - "attempt_count": obj.get("attempt_count"), - "error_code": obj.get("error_code"), - "error_reason": obj.get("error_reason"), - "error_type": obj.get("error_type"), - "error_message": obj.get("error_message"), - "payment_method_required": obj.get("payment_method_required"), - "redirect_url": obj.get("redirect_url"), - "stripe_sdk": ( - SubscriptionPaymentFailureStripeSDK.from_dict(obj["stripe_sdk"]) - if obj.get("stripe_sdk") is not None - else None - ), - } - ) + _obj = cls.model_validate({ + "failed_at": obj.get("failed_at"), + "next_attempt": obj.get("next_attempt"), + "attempt_count": obj.get("attempt_count"), + "error_code": obj.get("error_code"), + "error_reason": obj.get("error_reason"), + "error_type": obj.get("error_type"), + "error_message": obj.get("error_message"), + "payment_method_required": obj.get("payment_method_required"), + "redirect_url": obj.get("redirect_url"), + "stripe_sdk": SubscriptionPaymentFailureStripeSDK.from_dict(obj["stripe_sdk"]) if obj.get("stripe_sdk") is not None else None + }) return _obj + + diff --git a/koyeb/api/models/subscription_payment_failure_stripe_sdk.py b/koyeb/api/models/subscription_payment_failure_stripe_sdk.py index a4a4d6a3..7af992ae 100644 --- a/koyeb/api/models/subscription_payment_failure_stripe_sdk.py +++ b/koyeb/api/models/subscription_payment_failure_stripe_sdk.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -21,31 +21,31 @@ from typing import Any, ClassVar, Dict, List, Optional from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class SubscriptionPaymentFailureStripeSDK(BaseModel): """ SubscriptionPaymentFailureStripeSDK - """ # noqa: E501 - + """ # noqa: E501 client_secret_key: Optional[StrictStr] = None raw_json: Optional[StrictStr] = None __properties: ClassVar[List[str]] = ["client_secret_key", "raw_json"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -62,7 +62,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -80,10 +81,10 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "client_secret_key": obj.get("client_secret_key"), - "raw_json": obj.get("raw_json"), - } - ) + _obj = cls.model_validate({ + "client_secret_key": obj.get("client_secret_key"), + "raw_json": obj.get("raw_json") + }) return _obj + + diff --git a/koyeb/api/models/subscription_status.py b/koyeb/api/models/subscription_status.py index b1fbb160..486f6efa 100644 --- a/koyeb/api/models/subscription_status.py +++ b/koyeb/api/models/subscription_status.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -26,17 +26,19 @@ class SubscriptionStatus(str, Enum): """ allowed enum values """ - INVALID = "INVALID" - CREATED = "CREATED" - ACTIVE = "ACTIVE" - WARNING = "WARNING" - URGENT = "URGENT" - CANCELING = "CANCELING" - CANCELED = "CANCELED" - TERMINATING = "TERMINATING" - TERMINATED = "TERMINATED" + INVALID = 'INVALID' + CREATED = 'CREATED' + ACTIVE = 'ACTIVE' + WARNING = 'WARNING' + URGENT = 'URGENT' + CANCELING = 'CANCELING' + CANCELED = 'CANCELED' + TERMINATING = 'TERMINATING' + TERMINATED = 'TERMINATED' @classmethod def from_json(cls, json_str: str) -> Self: """Create an instance of SubscriptionStatus from a JSON string""" return cls(json.loads(json_str)) + + diff --git a/koyeb/api/models/tcp_health_check.py b/koyeb/api/models/tcp_health_check.py index 998c850f..dc9ba685 100644 --- a/koyeb/api/models/tcp_health_check.py +++ b/koyeb/api/models/tcp_health_check.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -21,30 +21,30 @@ from typing import Any, ClassVar, Dict, List, Optional from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class TCPHealthCheck(BaseModel): """ TCPHealthCheck - """ # noqa: E501 - + """ # noqa: E501 port: Optional[StrictInt] = None __properties: ClassVar[List[str]] = ["port"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -61,7 +61,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -79,5 +80,9 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({"port": obj.get("port")}) + _obj = cls.model_validate({ + "port": obj.get("port") + }) return _obj + + diff --git a/koyeb/api/models/token.py b/koyeb/api/models/token.py index ee8a37db..79f495a6 100644 --- a/koyeb/api/models/token.py +++ b/koyeb/api/models/token.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -22,38 +22,33 @@ from typing import Any, ClassVar, Dict, List, Optional from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class Token(BaseModel): """ Token - """ # noqa: E501 - + """ # noqa: E501 id: Optional[StrictStr] = None user_id: Optional[StrictStr] = None organization_id: Optional[StrictStr] = None expires_at: Optional[datetime] = None - __properties: ClassVar[List[str]] = [ - "id", - "user_id", - "organization_id", - "expires_at", - ] + __properties: ClassVar[List[str]] = ["id", "user_id", "organization_id", "expires_at"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -70,7 +65,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -88,12 +84,12 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "id": obj.get("id"), - "user_id": obj.get("user_id"), - "organization_id": obj.get("organization_id"), - "expires_at": obj.get("expires_at"), - } - ) + _obj = cls.model_validate({ + "id": obj.get("id"), + "user_id": obj.get("user_id"), + "organization_id": obj.get("organization_id"), + "expires_at": obj.get("expires_at") + }) return _obj + + diff --git a/koyeb/api/models/trigger_deployment_metadata.py b/koyeb/api/models/trigger_deployment_metadata.py index f174b360..ead04fe0 100644 --- a/koyeb/api/models/trigger_deployment_metadata.py +++ b/koyeb/api/models/trigger_deployment_metadata.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -19,47 +19,37 @@ from pydantic import BaseModel, ConfigDict from typing import Any, ClassVar, Dict, List, Optional -from koyeb.api.models.trigger_deployment_metadata_actor_type import ( - TriggerDeploymentMetadataActorType, -) -from koyeb.api.models.trigger_deployment_metadata_trigger_type import ( - TriggerDeploymentMetadataTriggerType, -) -from koyeb.api.models.trigger_git_deployment_metadata import ( - TriggerGitDeploymentMetadata, -) +from koyeb.api.models.trigger_deployment_metadata_actor_type import TriggerDeploymentMetadataActorType +from koyeb.api.models.trigger_deployment_metadata_trigger_type import TriggerDeploymentMetadataTriggerType +from koyeb.api.models.trigger_git_deployment_metadata import TriggerGitDeploymentMetadata from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class TriggerDeploymentMetadata(BaseModel): """ TriggerDeploymentMetadata - """ # noqa: E501 - - type: Optional[TriggerDeploymentMetadataTriggerType] = ( - TriggerDeploymentMetadataTriggerType.UNKNOWN_TYPE - ) - actor: Optional[TriggerDeploymentMetadataActorType] = ( - TriggerDeploymentMetadataActorType.UNKNOWN_ACTOR - ) + """ # noqa: E501 + type: Optional[TriggerDeploymentMetadataTriggerType] = TriggerDeploymentMetadataTriggerType.UNKNOWN_TYPE + actor: Optional[TriggerDeploymentMetadataActorType] = TriggerDeploymentMetadataActorType.UNKNOWN_ACTOR git: Optional[TriggerGitDeploymentMetadata] = None __properties: ClassVar[List[str]] = ["type", "actor", "git"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -76,7 +66,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -85,7 +76,7 @@ def to_dict(self) -> Dict[str, Any]: ) # override the default output from pydantic by calling `to_dict()` of git if self.git: - _dict["git"] = self.git.to_dict() + _dict['git'] = self.git.to_dict() return _dict @classmethod @@ -97,23 +88,11 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "type": ( - obj.get("type") - if obj.get("type") is not None - else TriggerDeploymentMetadataTriggerType.UNKNOWN_TYPE - ), - "actor": ( - obj.get("actor") - if obj.get("actor") is not None - else TriggerDeploymentMetadataActorType.UNKNOWN_ACTOR - ), - "git": ( - TriggerGitDeploymentMetadata.from_dict(obj["git"]) - if obj.get("git") is not None - else None - ), - } - ) + _obj = cls.model_validate({ + "type": obj.get("type") if obj.get("type") is not None else TriggerDeploymentMetadataTriggerType.UNKNOWN_TYPE, + "actor": obj.get("actor") if obj.get("actor") is not None else TriggerDeploymentMetadataActorType.UNKNOWN_ACTOR, + "git": TriggerGitDeploymentMetadata.from_dict(obj["git"]) if obj.get("git") is not None else None + }) return _obj + + diff --git a/koyeb/api/models/trigger_deployment_metadata_actor_type.py b/koyeb/api/models/trigger_deployment_metadata_actor_type.py index efb6e32f..a74aa835 100644 --- a/koyeb/api/models/trigger_deployment_metadata_actor_type.py +++ b/koyeb/api/models/trigger_deployment_metadata_actor_type.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -26,11 +26,13 @@ class TriggerDeploymentMetadataActorType(str, Enum): """ allowed enum values """ - UNKNOWN_ACTOR = "UNKNOWN_ACTOR" - USER = "USER" - SYSTEM = "SYSTEM" + UNKNOWN_ACTOR = 'UNKNOWN_ACTOR' + USER = 'USER' + SYSTEM = 'SYSTEM' @classmethod def from_json(cls, json_str: str) -> Self: """Create an instance of TriggerDeploymentMetadataActorType from a JSON string""" return cls(json.loads(json_str)) + + diff --git a/koyeb/api/models/trigger_deployment_metadata_trigger_type.py b/koyeb/api/models/trigger_deployment_metadata_trigger_type.py index a6a25aac..3aac8381 100644 --- a/koyeb/api/models/trigger_deployment_metadata_trigger_type.py +++ b/koyeb/api/models/trigger_deployment_metadata_trigger_type.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -26,12 +26,14 @@ class TriggerDeploymentMetadataTriggerType(str, Enum): """ allowed enum values """ - UNKNOWN_TYPE = "UNKNOWN_TYPE" - GIT = "GIT" - RESUME = "RESUME" - DATABASE_SYNC = "DATABASE_SYNC" + UNKNOWN_TYPE = 'UNKNOWN_TYPE' + GIT = 'GIT' + RESUME = 'RESUME' + DATABASE_SYNC = 'DATABASE_SYNC' @classmethod def from_json(cls, json_str: str) -> Self: """Create an instance of TriggerDeploymentMetadataTriggerType from a JSON string""" return cls(json.loads(json_str)) + + diff --git a/koyeb/api/models/trigger_git_deployment_metadata.py b/koyeb/api/models/trigger_git_deployment_metadata.py index 7939a706..7abbdc05 100644 --- a/koyeb/api/models/trigger_git_deployment_metadata.py +++ b/koyeb/api/models/trigger_git_deployment_metadata.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -19,21 +19,16 @@ from pydantic import BaseModel, ConfigDict, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from koyeb.api.models.trigger_git_deployment_metadata_provider import ( - TriggerGitDeploymentMetadataProvider, -) +from koyeb.api.models.trigger_git_deployment_metadata_provider import TriggerGitDeploymentMetadataProvider from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class TriggerGitDeploymentMetadata(BaseModel): """ TriggerGitDeploymentMetadata - """ # noqa: E501 - - provider: Optional[TriggerGitDeploymentMetadataProvider] = ( - TriggerGitDeploymentMetadataProvider.UNKNOWN - ) + """ # noqa: E501 + provider: Optional[TriggerGitDeploymentMetadataProvider] = TriggerGitDeploymentMetadataProvider.UNKNOWN repository: Optional[StrictStr] = None branch: Optional[StrictStr] = None sha: Optional[StrictStr] = None @@ -41,31 +36,23 @@ class TriggerGitDeploymentMetadata(BaseModel): sender_username: Optional[StrictStr] = None sender_avatar_url: Optional[StrictStr] = None sender_profile_url: Optional[StrictStr] = None - __properties: ClassVar[List[str]] = [ - "provider", - "repository", - "branch", - "sha", - "message", - "sender_username", - "sender_avatar_url", - "sender_profile_url", - ] + __properties: ClassVar[List[str]] = ["provider", "repository", "branch", "sha", "message", "sender_username", "sender_avatar_url", "sender_profile_url"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -82,7 +69,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -100,20 +88,16 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "provider": ( - obj.get("provider") - if obj.get("provider") is not None - else TriggerGitDeploymentMetadataProvider.UNKNOWN - ), - "repository": obj.get("repository"), - "branch": obj.get("branch"), - "sha": obj.get("sha"), - "message": obj.get("message"), - "sender_username": obj.get("sender_username"), - "sender_avatar_url": obj.get("sender_avatar_url"), - "sender_profile_url": obj.get("sender_profile_url"), - } - ) + _obj = cls.model_validate({ + "provider": obj.get("provider") if obj.get("provider") is not None else TriggerGitDeploymentMetadataProvider.UNKNOWN, + "repository": obj.get("repository"), + "branch": obj.get("branch"), + "sha": obj.get("sha"), + "message": obj.get("message"), + "sender_username": obj.get("sender_username"), + "sender_avatar_url": obj.get("sender_avatar_url"), + "sender_profile_url": obj.get("sender_profile_url") + }) return _obj + + diff --git a/koyeb/api/models/trigger_git_deployment_metadata_provider.py b/koyeb/api/models/trigger_git_deployment_metadata_provider.py index d6cdda4d..c2f10198 100644 --- a/koyeb/api/models/trigger_git_deployment_metadata_provider.py +++ b/koyeb/api/models/trigger_git_deployment_metadata_provider.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -26,10 +26,12 @@ class TriggerGitDeploymentMetadataProvider(str, Enum): """ allowed enum values """ - UNKNOWN = "UNKNOWN" - GITHUB = "GITHUB" + UNKNOWN = 'UNKNOWN' + GITHUB = 'GITHUB' @classmethod def from_json(cls, json_str: str) -> Self: """Create an instance of TriggerGitDeploymentMetadataProvider from a JSON string""" return cls(json.loads(json_str)) + + diff --git a/koyeb/api/models/update_app.py b/koyeb/api/models/update_app.py index 44c33fc0..af919983 100644 --- a/koyeb/api/models/update_app.py +++ b/koyeb/api/models/update_app.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -22,31 +22,31 @@ from koyeb.api.models.app_life_cycle import AppLifeCycle from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class UpdateApp(BaseModel): """ UpdateApp - """ # noqa: E501 - + """ # noqa: E501 name: Optional[StrictStr] = None life_cycle: Optional[AppLifeCycle] = None __properties: ClassVar[List[str]] = ["name", "life_cycle"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -63,7 +63,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -72,7 +73,7 @@ def to_dict(self) -> Dict[str, Any]: ) # override the default output from pydantic by calling `to_dict()` of life_cycle if self.life_cycle: - _dict["life_cycle"] = self.life_cycle.to_dict() + _dict['life_cycle'] = self.life_cycle.to_dict() return _dict @classmethod @@ -84,14 +85,10 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "name": obj.get("name"), - "life_cycle": ( - AppLifeCycle.from_dict(obj["life_cycle"]) - if obj.get("life_cycle") is not None - else None - ), - } - ) + _obj = cls.model_validate({ + "name": obj.get("name"), + "life_cycle": AppLifeCycle.from_dict(obj["life_cycle"]) if obj.get("life_cycle") is not None else None + }) return _obj + + diff --git a/koyeb/api/models/update_app_reply.py b/koyeb/api/models/update_app_reply.py index 7e8edf45..7b90209c 100644 --- a/koyeb/api/models/update_app_reply.py +++ b/koyeb/api/models/update_app_reply.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -22,30 +22,30 @@ from koyeb.api.models.app import App from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class UpdateAppReply(BaseModel): """ UpdateAppReply - """ # noqa: E501 - + """ # noqa: E501 app: Optional[App] = None __properties: ClassVar[List[str]] = ["app"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -62,7 +62,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -71,7 +72,7 @@ def to_dict(self) -> Dict[str, Any]: ) # override the default output from pydantic by calling `to_dict()` of app if self.app: - _dict["app"] = self.app.to_dict() + _dict['app'] = self.app.to_dict() return _dict @classmethod @@ -83,7 +84,9 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - {"app": App.from_dict(obj["app"]) if obj.get("app") is not None else None} - ) + _obj = cls.model_validate({ + "app": App.from_dict(obj["app"]) if obj.get("app") is not None else None + }) return _obj + + diff --git a/koyeb/api/models/update_budget_reply.py b/koyeb/api/models/update_budget_reply.py index d5bdf57e..1780ce6f 100644 --- a/koyeb/api/models/update_budget_reply.py +++ b/koyeb/api/models/update_budget_reply.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -22,30 +22,30 @@ from koyeb.api.models.budget import Budget from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class UpdateBudgetReply(BaseModel): """ UpdateBudgetReply - """ # noqa: E501 - + """ # noqa: E501 budget: Optional[Budget] = None __properties: ClassVar[List[str]] = ["budget"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -62,7 +62,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -71,7 +72,7 @@ def to_dict(self) -> Dict[str, Any]: ) # override the default output from pydantic by calling `to_dict()` of budget if self.budget: - _dict["budget"] = self.budget.to_dict() + _dict['budget'] = self.budget.to_dict() return _dict @classmethod @@ -83,13 +84,9 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "budget": ( - Budget.from_dict(obj["budget"]) - if obj.get("budget") is not None - else None - ) - } - ) + _obj = cls.model_validate({ + "budget": Budget.from_dict(obj["budget"]) if obj.get("budget") is not None else None + }) return _obj + + diff --git a/koyeb/api/models/update_budget_request.py b/koyeb/api/models/update_budget_request.py index e494b082..37e6e091 100644 --- a/koyeb/api/models/update_budget_request.py +++ b/koyeb/api/models/update_budget_request.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -21,30 +21,30 @@ from typing import Any, ClassVar, Dict, List, Optional from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class UpdateBudgetRequest(BaseModel): """ UpdateBudgetRequest - """ # noqa: E501 - + """ # noqa: E501 amount: Optional[StrictStr] = Field(default=None, description="In cents.") __properties: ClassVar[List[str]] = ["amount"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -61,7 +61,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -79,5 +80,9 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({"amount": obj.get("amount")}) + _obj = cls.model_validate({ + "amount": obj.get("amount") + }) return _obj + + diff --git a/koyeb/api/models/update_credential_reply.py b/koyeb/api/models/update_credential_reply.py index 154717cb..bc949438 100644 --- a/koyeb/api/models/update_credential_reply.py +++ b/koyeb/api/models/update_credential_reply.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -22,30 +22,30 @@ from koyeb.api.models.credential import Credential from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class UpdateCredentialReply(BaseModel): """ UpdateCredentialReply - """ # noqa: E501 - + """ # noqa: E501 credential: Optional[Credential] = None __properties: ClassVar[List[str]] = ["credential"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -62,7 +62,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -71,7 +72,7 @@ def to_dict(self) -> Dict[str, Any]: ) # override the default output from pydantic by calling `to_dict()` of credential if self.credential: - _dict["credential"] = self.credential.to_dict() + _dict['credential'] = self.credential.to_dict() return _dict @classmethod @@ -83,13 +84,9 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "credential": ( - Credential.from_dict(obj["credential"]) - if obj.get("credential") is not None - else None - ) - } - ) + _obj = cls.model_validate({ + "credential": Credential.from_dict(obj["credential"]) if obj.get("credential") is not None else None + }) return _obj + + diff --git a/koyeb/api/models/update_domain.py b/koyeb/api/models/update_domain.py index 3d21dc08..603ab46e 100644 --- a/koyeb/api/models/update_domain.py +++ b/koyeb/api/models/update_domain.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -21,35 +21,31 @@ from typing import Any, ClassVar, Dict, List, Optional from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class UpdateDomain(BaseModel): """ UpdateDomain - """ # noqa: E501 - - app_id: Optional[StrictStr] = Field( - default=None, description="To attach or detach from an app for custom domain." - ) - subdomain: Optional[StrictStr] = Field( - default=None, description="To change subdomain for auto-assigned domain." - ) + """ # noqa: E501 + app_id: Optional[StrictStr] = Field(default=None, description="To attach or detach from an app for custom domain.") + subdomain: Optional[StrictStr] = Field(default=None, description="To change subdomain for auto-assigned domain.") __properties: ClassVar[List[str]] = ["app_id", "subdomain"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -66,7 +62,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -84,7 +81,10 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - {"app_id": obj.get("app_id"), "subdomain": obj.get("subdomain")} - ) + _obj = cls.model_validate({ + "app_id": obj.get("app_id"), + "subdomain": obj.get("subdomain") + }) return _obj + + diff --git a/koyeb/api/models/update_domain_reply.py b/koyeb/api/models/update_domain_reply.py index a61d520c..f0824dcc 100644 --- a/koyeb/api/models/update_domain_reply.py +++ b/koyeb/api/models/update_domain_reply.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -22,30 +22,30 @@ from koyeb.api.models.domain import Domain from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class UpdateDomainReply(BaseModel): """ UpdateDomainReply - """ # noqa: E501 - + """ # noqa: E501 domain: Optional[Domain] = None __properties: ClassVar[List[str]] = ["domain"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -62,7 +62,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -71,7 +72,7 @@ def to_dict(self) -> Dict[str, Any]: ) # override the default output from pydantic by calling `to_dict()` of domain if self.domain: - _dict["domain"] = self.domain.to_dict() + _dict['domain'] = self.domain.to_dict() return _dict @classmethod @@ -83,13 +84,9 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "domain": ( - Domain.from_dict(obj["domain"]) - if obj.get("domain") is not None - else None - ) - } - ) + _obj = cls.model_validate({ + "domain": Domain.from_dict(obj["domain"]) if obj.get("domain") is not None else None + }) return _obj + + diff --git a/koyeb/api/models/update_organization_default_project_reply.py b/koyeb/api/models/update_organization_default_project_reply.py new file mode 100644 index 00000000..da8f6299 --- /dev/null +++ b/koyeb/api/models/update_organization_default_project_reply.py @@ -0,0 +1,92 @@ +# coding: utf-8 + +""" + Koyeb Rest API + + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict +from typing import Any, ClassVar, Dict, List, Optional +from koyeb.api.models.organization import Organization +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class UpdateOrganizationDefaultProjectReply(BaseModel): + """ + UpdateOrganizationDefaultProjectReply + """ # noqa: E501 + organization: Optional[Organization] = None + __properties: ClassVar[List[str]] = ["organization"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of UpdateOrganizationDefaultProjectReply from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of organization + if self.organization: + _dict['organization'] = self.organization.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of UpdateOrganizationDefaultProjectReply from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "organization": Organization.from_dict(obj["organization"]) if obj.get("organization") is not None else None + }) + return _obj + + diff --git a/koyeb/api/models/update_organization_default_project_request.py b/koyeb/api/models/update_organization_default_project_request.py new file mode 100644 index 00000000..9170f668 --- /dev/null +++ b/koyeb/api/models/update_organization_default_project_request.py @@ -0,0 +1,88 @@ +# coding: utf-8 + +""" + Koyeb Rest API + + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class UpdateOrganizationDefaultProjectRequest(BaseModel): + """ + UpdateOrganizationDefaultProjectRequest + """ # noqa: E501 + default_project_id: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["default_project_id"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of UpdateOrganizationDefaultProjectRequest from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of UpdateOrganizationDefaultProjectRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "default_project_id": obj.get("default_project_id") + }) + return _obj + + diff --git a/koyeb/api/models/update_organization_name_reply.py b/koyeb/api/models/update_organization_name_reply.py index 9f0cebf6..d7b19f01 100644 --- a/koyeb/api/models/update_organization_name_reply.py +++ b/koyeb/api/models/update_organization_name_reply.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -22,30 +22,30 @@ from koyeb.api.models.organization import Organization from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class UpdateOrganizationNameReply(BaseModel): """ UpdateOrganizationNameReply - """ # noqa: E501 - + """ # noqa: E501 organization: Optional[Organization] = None __properties: ClassVar[List[str]] = ["organization"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -62,7 +62,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -71,7 +72,7 @@ def to_dict(self) -> Dict[str, Any]: ) # override the default output from pydantic by calling `to_dict()` of organization if self.organization: - _dict["organization"] = self.organization.to_dict() + _dict['organization'] = self.organization.to_dict() return _dict @classmethod @@ -83,13 +84,9 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "organization": ( - Organization.from_dict(obj["organization"]) - if obj.get("organization") is not None - else None - ) - } - ) + _obj = cls.model_validate({ + "organization": Organization.from_dict(obj["organization"]) if obj.get("organization") is not None else None + }) return _obj + + diff --git a/koyeb/api/models/update_organization_name_request.py b/koyeb/api/models/update_organization_name_request.py index db7cd850..a2c26fc5 100644 --- a/koyeb/api/models/update_organization_name_request.py +++ b/koyeb/api/models/update_organization_name_request.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -21,30 +21,30 @@ from typing import Any, ClassVar, Dict, List, Optional from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class UpdateOrganizationNameRequest(BaseModel): """ UpdateOrganizationNameRequest - """ # noqa: E501 - + """ # noqa: E501 name: Optional[StrictStr] = None __properties: ClassVar[List[str]] = ["name"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -61,7 +61,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -79,5 +80,9 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({"name": obj.get("name")}) + _obj = cls.model_validate({ + "name": obj.get("name") + }) return _obj + + diff --git a/koyeb/api/models/update_organization_plan_reply.py b/koyeb/api/models/update_organization_plan_reply.py index 2f421d70..0dc1c17d 100644 --- a/koyeb/api/models/update_organization_plan_reply.py +++ b/koyeb/api/models/update_organization_plan_reply.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -22,30 +22,30 @@ from koyeb.api.models.organization import Organization from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class UpdateOrganizationPlanReply(BaseModel): """ UpdateOrganizationPlanReply - """ # noqa: E501 - + """ # noqa: E501 organization: Optional[Organization] = None __properties: ClassVar[List[str]] = ["organization"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -62,7 +62,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -71,7 +72,7 @@ def to_dict(self) -> Dict[str, Any]: ) # override the default output from pydantic by calling `to_dict()` of organization if self.organization: - _dict["organization"] = self.organization.to_dict() + _dict['organization'] = self.organization.to_dict() return _dict @classmethod @@ -83,13 +84,9 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "organization": ( - Organization.from_dict(obj["organization"]) - if obj.get("organization") is not None - else None - ) - } - ) + _obj = cls.model_validate({ + "organization": Organization.from_dict(obj["organization"]) if obj.get("organization") is not None else None + }) return _obj + + diff --git a/koyeb/api/models/update_organization_plan_request.py b/koyeb/api/models/update_organization_plan_request.py index 5d03c690..6916acd8 100644 --- a/koyeb/api/models/update_organization_plan_request.py +++ b/koyeb/api/models/update_organization_plan_request.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -17,35 +17,36 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict +from pydantic import BaseModel, ConfigDict, StrictStr from typing import Any, ClassVar, Dict, List, Optional from koyeb.api.models.plan import Plan from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class UpdateOrganizationPlanRequest(BaseModel): """ UpdateOrganizationPlanRequest - """ # noqa: E501 - + """ # noqa: E501 plan: Optional[Plan] = Plan.HOBBY - __properties: ClassVar[List[str]] = ["plan"] + coupon_code: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["plan", "coupon_code"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -62,7 +63,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -80,7 +82,10 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - {"plan": obj.get("plan") if obj.get("plan") is not None else Plan.HOBBY} - ) + _obj = cls.model_validate({ + "plan": obj.get("plan") if obj.get("plan") is not None else Plan.HOBBY, + "coupon_code": obj.get("coupon_code") + }) return _obj + + diff --git a/koyeb/api/models/update_organization_reply.py b/koyeb/api/models/update_organization_reply.py index ae129c1d..7491a235 100644 --- a/koyeb/api/models/update_organization_reply.py +++ b/koyeb/api/models/update_organization_reply.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -22,30 +22,30 @@ from koyeb.api.models.organization import Organization from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class UpdateOrganizationReply(BaseModel): """ UpdateOrganizationReply - """ # noqa: E501 - + """ # noqa: E501 organization: Optional[Organization] = None __properties: ClassVar[List[str]] = ["organization"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -62,7 +62,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -71,7 +72,7 @@ def to_dict(self) -> Dict[str, Any]: ) # override the default output from pydantic by calling `to_dict()` of organization if self.organization: - _dict["organization"] = self.organization.to_dict() + _dict['organization'] = self.organization.to_dict() return _dict @classmethod @@ -83,13 +84,9 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "organization": ( - Organization.from_dict(obj["organization"]) - if obj.get("organization") is not None - else None - ) - } - ) + _obj = cls.model_validate({ + "organization": Organization.from_dict(obj["organization"]) if obj.get("organization") is not None else None + }) return _obj + + diff --git a/koyeb/api/models/update_password_request.py b/koyeb/api/models/update_password_request.py index ceea9493..f87f352c 100644 --- a/koyeb/api/models/update_password_request.py +++ b/koyeb/api/models/update_password_request.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -21,31 +21,31 @@ from typing import Any, ClassVar, Dict, List, Optional from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class UpdatePasswordRequest(BaseModel): """ UpdatePasswordRequest - """ # noqa: E501 - + """ # noqa: E501 id: Optional[StrictStr] = None password: Optional[StrictStr] = None __properties: ClassVar[List[str]] = ["id", "password"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -62,7 +62,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -80,7 +81,10 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - {"id": obj.get("id"), "password": obj.get("password")} - ) + _obj = cls.model_validate({ + "id": obj.get("id"), + "password": obj.get("password") + }) return _obj + + diff --git a/koyeb/api/models/update_persistent_volume_reply.py b/koyeb/api/models/update_persistent_volume_reply.py index d29a5bb9..868c0ba5 100644 --- a/koyeb/api/models/update_persistent_volume_reply.py +++ b/koyeb/api/models/update_persistent_volume_reply.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -22,30 +22,30 @@ from koyeb.api.models.persistent_volume import PersistentVolume from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class UpdatePersistentVolumeReply(BaseModel): """ UpdatePersistentVolumeReply - """ # noqa: E501 - + """ # noqa: E501 volume: Optional[PersistentVolume] = None __properties: ClassVar[List[str]] = ["volume"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -62,7 +62,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -71,7 +72,7 @@ def to_dict(self) -> Dict[str, Any]: ) # override the default output from pydantic by calling `to_dict()` of volume if self.volume: - _dict["volume"] = self.volume.to_dict() + _dict['volume'] = self.volume.to_dict() return _dict @classmethod @@ -83,13 +84,9 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "volume": ( - PersistentVolume.from_dict(obj["volume"]) - if obj.get("volume") is not None - else None - ) - } - ) + _obj = cls.model_validate({ + "volume": PersistentVolume.from_dict(obj["volume"]) if obj.get("volume") is not None else None + }) return _obj + + diff --git a/koyeb/api/models/update_persistent_volume_request.py b/koyeb/api/models/update_persistent_volume_request.py index 70065649..14852a46 100644 --- a/koyeb/api/models/update_persistent_volume_request.py +++ b/koyeb/api/models/update_persistent_volume_request.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -21,31 +21,31 @@ from typing import Any, ClassVar, Dict, List, Optional from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class UpdatePersistentVolumeRequest(BaseModel): """ UpdatePersistentVolumeRequest - """ # noqa: E501 - + """ # noqa: E501 name: Optional[StrictStr] = None max_size: Optional[StrictInt] = None __properties: ClassVar[List[str]] = ["name", "max_size"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -62,7 +62,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -80,7 +81,10 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - {"name": obj.get("name"), "max_size": obj.get("max_size")} - ) + _obj = cls.model_validate({ + "name": obj.get("name"), + "max_size": obj.get("max_size") + }) return _obj + + diff --git a/koyeb/api/models/update_project_reply.py b/koyeb/api/models/update_project_reply.py new file mode 100644 index 00000000..f2e68b82 --- /dev/null +++ b/koyeb/api/models/update_project_reply.py @@ -0,0 +1,92 @@ +# coding: utf-8 + +""" + Koyeb Rest API + + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict +from typing import Any, ClassVar, Dict, List, Optional +from koyeb.api.models.project import Project +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class UpdateProjectReply(BaseModel): + """ + UpdateProjectReply + """ # noqa: E501 + project: Optional[Project] = None + __properties: ClassVar[List[str]] = ["project"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of UpdateProjectReply from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of project + if self.project: + _dict['project'] = self.project.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of UpdateProjectReply from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "project": Project.from_dict(obj["project"]) if obj.get("project") is not None else None + }) + return _obj + + diff --git a/koyeb/api/models/update_secret_reply.py b/koyeb/api/models/update_secret_reply.py index 80e77252..0841791e 100644 --- a/koyeb/api/models/update_secret_reply.py +++ b/koyeb/api/models/update_secret_reply.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -22,30 +22,30 @@ from koyeb.api.models.secret import Secret from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class UpdateSecretReply(BaseModel): """ UpdateSecretReply - """ # noqa: E501 - + """ # noqa: E501 secret: Optional[Secret] = None __properties: ClassVar[List[str]] = ["secret"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -62,7 +62,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -71,7 +72,7 @@ def to_dict(self) -> Dict[str, Any]: ) # override the default output from pydantic by calling `to_dict()` of secret if self.secret: - _dict["secret"] = self.secret.to_dict() + _dict['secret'] = self.secret.to_dict() return _dict @classmethod @@ -83,13 +84,9 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "secret": ( - Secret.from_dict(obj["secret"]) - if obj.get("secret") is not None - else None - ) - } - ) + _obj = cls.model_validate({ + "secret": Secret.from_dict(obj["secret"]) if obj.get("secret") is not None else None + }) return _obj + + diff --git a/koyeb/api/models/update_service.py b/koyeb/api/models/update_service.py index 5756e907..89c2394f 100644 --- a/koyeb/api/models/update_service.py +++ b/koyeb/api/models/update_service.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -24,43 +24,34 @@ from koyeb.api.models.service_life_cycle import ServiceLifeCycle from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class UpdateService(BaseModel): """ UpdateService - """ # noqa: E501 - + """ # noqa: E501 definition: Optional[DeploymentDefinition] = None metadata: Optional[DeploymentMetadata] = None - skip_build: Optional[StrictBool] = Field( - default=None, - description="If set to true, the build stage will be skipped and the image coming from the last successful build step will be used instead. The call fails if no previous successful builds happened.", - ) + skip_build: Optional[StrictBool] = Field(default=None, description="If set to true, the build stage will be skipped and the image coming from the last successful build step will be used instead. The call fails if no previous successful builds happened.") save_only: Optional[StrictBool] = None life_cycle: Optional[ServiceLifeCycle] = None - __properties: ClassVar[List[str]] = [ - "definition", - "metadata", - "skip_build", - "save_only", - "life_cycle", - ] + __properties: ClassVar[List[str]] = ["definition", "metadata", "skip_build", "save_only", "life_cycle"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -77,7 +68,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -86,13 +78,13 @@ def to_dict(self) -> Dict[str, Any]: ) # override the default output from pydantic by calling `to_dict()` of definition if self.definition: - _dict["definition"] = self.definition.to_dict() + _dict['definition'] = self.definition.to_dict() # override the default output from pydantic by calling `to_dict()` of metadata if self.metadata: - _dict["metadata"] = self.metadata.to_dict() + _dict['metadata'] = self.metadata.to_dict() # override the default output from pydantic by calling `to_dict()` of life_cycle if self.life_cycle: - _dict["life_cycle"] = self.life_cycle.to_dict() + _dict['life_cycle'] = self.life_cycle.to_dict() return _dict @classmethod @@ -104,25 +96,13 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "definition": ( - DeploymentDefinition.from_dict(obj["definition"]) - if obj.get("definition") is not None - else None - ), - "metadata": ( - DeploymentMetadata.from_dict(obj["metadata"]) - if obj.get("metadata") is not None - else None - ), - "skip_build": obj.get("skip_build"), - "save_only": obj.get("save_only"), - "life_cycle": ( - ServiceLifeCycle.from_dict(obj["life_cycle"]) - if obj.get("life_cycle") is not None - else None - ), - } - ) + _obj = cls.model_validate({ + "definition": DeploymentDefinition.from_dict(obj["definition"]) if obj.get("definition") is not None else None, + "metadata": DeploymentMetadata.from_dict(obj["metadata"]) if obj.get("metadata") is not None else None, + "skip_build": obj.get("skip_build"), + "save_only": obj.get("save_only"), + "life_cycle": ServiceLifeCycle.from_dict(obj["life_cycle"]) if obj.get("life_cycle") is not None else None + }) return _obj + + diff --git a/koyeb/api/models/update_service_reply.py b/koyeb/api/models/update_service_reply.py index 1aadb7e6..654fdcc8 100644 --- a/koyeb/api/models/update_service_reply.py +++ b/koyeb/api/models/update_service_reply.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -22,30 +22,30 @@ from koyeb.api.models.service import Service from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class UpdateServiceReply(BaseModel): """ UpdateServiceReply - """ # noqa: E501 - + """ # noqa: E501 service: Optional[Service] = None __properties: ClassVar[List[str]] = ["service"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -62,7 +62,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -71,7 +72,7 @@ def to_dict(self) -> Dict[str, Any]: ) # override the default output from pydantic by calling `to_dict()` of service if self.service: - _dict["service"] = self.service.to_dict() + _dict['service'] = self.service.to_dict() return _dict @classmethod @@ -83,13 +84,9 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "service": ( - Service.from_dict(obj["service"]) - if obj.get("service") is not None - else None - ) - } - ) + _obj = cls.model_validate({ + "service": Service.from_dict(obj["service"]) if obj.get("service") is not None else None + }) return _obj + + diff --git a/koyeb/api/models/update_service_scaling_request.py b/koyeb/api/models/update_service_scaling_request.py new file mode 100644 index 00000000..d0c89f0c --- /dev/null +++ b/koyeb/api/models/update_service_scaling_request.py @@ -0,0 +1,96 @@ +# coding: utf-8 + +""" + Koyeb Rest API + + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict +from typing import Any, ClassVar, Dict, List, Optional +from koyeb.api.models.manual_service_scaling import ManualServiceScaling +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class UpdateServiceScalingRequest(BaseModel): + """ + UpdateServiceScalingRequest + """ # noqa: E501 + scalings: Optional[List[ManualServiceScaling]] = None + __properties: ClassVar[List[str]] = ["scalings"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of UpdateServiceScalingRequest from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in scalings (list) + _items = [] + if self.scalings: + for _item_scalings in self.scalings: + if _item_scalings: + _items.append(_item_scalings.to_dict()) + _dict['scalings'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of UpdateServiceScalingRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "scalings": [ManualServiceScaling.from_dict(_item) for _item in obj["scalings"]] if obj.get("scalings") is not None else None + }) + return _obj + + diff --git a/koyeb/api/models/update_snapshot_reply.py b/koyeb/api/models/update_snapshot_reply.py index 6e54e4a2..61200bd1 100644 --- a/koyeb/api/models/update_snapshot_reply.py +++ b/koyeb/api/models/update_snapshot_reply.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -22,30 +22,30 @@ from koyeb.api.models.snapshot import Snapshot from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class UpdateSnapshotReply(BaseModel): """ UpdateSnapshotReply - """ # noqa: E501 - + """ # noqa: E501 snapshot: Optional[Snapshot] = None __properties: ClassVar[List[str]] = ["snapshot"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -62,7 +62,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -71,7 +72,7 @@ def to_dict(self) -> Dict[str, Any]: ) # override the default output from pydantic by calling `to_dict()` of snapshot if self.snapshot: - _dict["snapshot"] = self.snapshot.to_dict() + _dict['snapshot'] = self.snapshot.to_dict() return _dict @classmethod @@ -83,13 +84,9 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "snapshot": ( - Snapshot.from_dict(obj["snapshot"]) - if obj.get("snapshot") is not None - else None - ) - } - ) + _obj = cls.model_validate({ + "snapshot": Snapshot.from_dict(obj["snapshot"]) if obj.get("snapshot") is not None else None + }) return _obj + + diff --git a/koyeb/api/models/update_snapshot_request.py b/koyeb/api/models/update_snapshot_request.py index 9dd4ac6b..801fc6b0 100644 --- a/koyeb/api/models/update_snapshot_request.py +++ b/koyeb/api/models/update_snapshot_request.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -21,30 +21,30 @@ from typing import Any, ClassVar, Dict, List, Optional from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class UpdateSnapshotRequest(BaseModel): """ UpdateSnapshotRequest - """ # noqa: E501 - + """ # noqa: E501 name: Optional[StrictStr] = None __properties: ClassVar[List[str]] = ["name"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -61,7 +61,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -79,5 +80,9 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({"name": obj.get("name")}) + _obj = cls.model_validate({ + "name": obj.get("name") + }) return _obj + + diff --git a/koyeb/api/models/update_user_request_user_update_body.py b/koyeb/api/models/update_user_request_user_update_body.py index 2240dd4c..0a05660b 100644 --- a/koyeb/api/models/update_user_request_user_update_body.py +++ b/koyeb/api/models/update_user_request_user_update_body.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -21,42 +21,35 @@ from typing import Any, ClassVar, Dict, List, Optional from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class UpdateUserRequestUserUpdateBody(BaseModel): """ UpdateUserRequestUserUpdateBody - """ # noqa: E501 - + """ # noqa: E501 id: Optional[StrictStr] = None email: Optional[StrictStr] = None current_password: Optional[StrictStr] = None password: Optional[StrictStr] = None newsletter_subscribed: Optional[StrictBool] = None name: Optional[StrictStr] = None - __properties: ClassVar[List[str]] = [ - "id", - "email", - "current_password", - "password", - "newsletter_subscribed", - "name", - ] + __properties: ClassVar[List[str]] = ["id", "email", "current_password", "password", "newsletter_subscribed", "name"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -73,7 +66,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -91,14 +85,14 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "id": obj.get("id"), - "email": obj.get("email"), - "current_password": obj.get("current_password"), - "password": obj.get("password"), - "newsletter_subscribed": obj.get("newsletter_subscribed"), - "name": obj.get("name"), - } - ) + _obj = cls.model_validate({ + "id": obj.get("id"), + "email": obj.get("email"), + "current_password": obj.get("current_password"), + "password": obj.get("password"), + "newsletter_subscribed": obj.get("newsletter_subscribed"), + "name": obj.get("name") + }) return _obj + + diff --git a/koyeb/api/models/update_user_settings_reply.py b/koyeb/api/models/update_user_settings_reply.py index 38487dd1..574cd59b 100644 --- a/koyeb/api/models/update_user_settings_reply.py +++ b/koyeb/api/models/update_user_settings_reply.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -22,30 +22,30 @@ from koyeb.api.models.user_settings import UserSettings from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class UpdateUserSettingsReply(BaseModel): """ UpdateUserSettingsReply - """ # noqa: E501 - + """ # noqa: E501 settings: Optional[UserSettings] = None __properties: ClassVar[List[str]] = ["settings"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -62,7 +62,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -71,7 +72,7 @@ def to_dict(self) -> Dict[str, Any]: ) # override the default output from pydantic by calling `to_dict()` of settings if self.settings: - _dict["settings"] = self.settings.to_dict() + _dict['settings'] = self.settings.to_dict() return _dict @classmethod @@ -83,13 +84,9 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "settings": ( - UserSettings.from_dict(obj["settings"]) - if obj.get("settings") is not None - else None - ) - } - ) + _obj = cls.model_validate({ + "settings": UserSettings.from_dict(obj["settings"]) if obj.get("settings") is not None else None + }) return _obj + + diff --git a/koyeb/api/models/update_user_settings_request.py b/koyeb/api/models/update_user_settings_request.py index f71b7620..33ff27fe 100644 --- a/koyeb/api/models/update_user_settings_request.py +++ b/koyeb/api/models/update_user_settings_request.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -21,33 +21,30 @@ from typing import Any, ClassVar, Dict, List, Optional from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class UpdateUserSettingsRequest(BaseModel): """ UpdateUserSettingsRequest - """ # noqa: E501 - - failed_deployment_email_notification: Optional[StrictBool] = Field( - default=None, - description="(Optional) Toggle failed deployment email notification.", - ) + """ # noqa: E501 + failed_deployment_email_notification: Optional[StrictBool] = Field(default=None, description="(Optional) Toggle failed deployment email notification.") __properties: ClassVar[List[str]] = ["failed_deployment_email_notification"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -64,7 +61,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -82,11 +80,9 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "failed_deployment_email_notification": obj.get( - "failed_deployment_email_notification" - ) - } - ) + _obj = cls.model_validate({ + "failed_deployment_email_notification": obj.get("failed_deployment_email_notification") + }) return _obj + + diff --git a/koyeb/api/models/upsert_signup_qualification_reply.py b/koyeb/api/models/upsert_signup_qualification_reply.py index f1c8aa77..87a73530 100644 --- a/koyeb/api/models/upsert_signup_qualification_reply.py +++ b/koyeb/api/models/upsert_signup_qualification_reply.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -22,30 +22,30 @@ from koyeb.api.models.organization import Organization from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class UpsertSignupQualificationReply(BaseModel): """ UpsertSignupQualificationReply - """ # noqa: E501 - + """ # noqa: E501 organization: Optional[Organization] = None __properties: ClassVar[List[str]] = ["organization"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -62,7 +62,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -71,7 +72,7 @@ def to_dict(self) -> Dict[str, Any]: ) # override the default output from pydantic by calling `to_dict()` of organization if self.organization: - _dict["organization"] = self.organization.to_dict() + _dict['organization'] = self.organization.to_dict() return _dict @classmethod @@ -83,13 +84,9 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "organization": ( - Organization.from_dict(obj["organization"]) - if obj.get("organization") is not None - else None - ) - } - ) + _obj = cls.model_validate({ + "organization": Organization.from_dict(obj["organization"]) if obj.get("organization") is not None else None + }) return _obj + + diff --git a/koyeb/api/models/upsert_signup_qualification_request.py b/koyeb/api/models/upsert_signup_qualification_request.py index 7e3c96a7..f89bab9b 100644 --- a/koyeb/api/models/upsert_signup_qualification_request.py +++ b/koyeb/api/models/upsert_signup_qualification_request.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -21,30 +21,30 @@ from typing import Any, ClassVar, Dict, List, Optional from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class UpsertSignupQualificationRequest(BaseModel): """ UpsertSignupQualificationRequest - """ # noqa: E501 - + """ # noqa: E501 signup_qualification: Optional[Dict[str, Any]] = None __properties: ClassVar[List[str]] = ["signup_qualification"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -61,7 +61,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -79,7 +80,9 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - {"signup_qualification": obj.get("signup_qualification")} - ) + _obj = cls.model_validate({ + "signup_qualification": obj.get("signup_qualification") + }) return _obj + + diff --git a/koyeb/api/models/usage.py b/koyeb/api/models/usage.py index 050a0bee..e0dd8541 100644 --- a/koyeb/api/models/usage.py +++ b/koyeb/api/models/usage.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -22,31 +22,31 @@ from koyeb.api.models.period_usage import PeriodUsage from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class Usage(BaseModel): """ Usage - """ # noqa: E501 - + """ # noqa: E501 organization_id: Optional[StrictStr] = None periods: Optional[Dict[str, PeriodUsage]] = None __properties: ClassVar[List[str]] = ["organization_id", "periods"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -63,7 +63,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -76,7 +77,7 @@ def to_dict(self) -> Dict[str, Any]: for _key_periods in self.periods: if self.periods[_key_periods]: _field_dict[_key_periods] = self.periods[_key_periods].to_dict() - _dict["periods"] = _field_dict + _dict['periods'] = _field_dict return _dict @classmethod @@ -88,17 +89,15 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "organization_id": obj.get("organization_id"), - "periods": ( - dict( - (_k, PeriodUsage.from_dict(_v)) - for _k, _v in obj["periods"].items() - ) - if obj.get("periods") is not None - else None - ), - } - ) + _obj = cls.model_validate({ + "organization_id": obj.get("organization_id"), + "periods": dict( + (_k, PeriodUsage.from_dict(_v)) + for _k, _v in obj["periods"].items() + ) + if obj.get("periods") is not None + else None + }) return _obj + + diff --git a/koyeb/api/models/usage_details.py b/koyeb/api/models/usage_details.py index baafe744..1063d0da 100644 --- a/koyeb/api/models/usage_details.py +++ b/koyeb/api/models/usage_details.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -22,13 +22,12 @@ from typing import Any, ClassVar, Dict, List, Optional from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class UsageDetails(BaseModel): """ UsageDetails - """ # noqa: E501 - + """ # noqa: E501 organization_id: Optional[StrictStr] = None instance_id: Optional[StrictStr] = None app_id: Optional[StrictStr] = None @@ -42,36 +41,23 @@ class UsageDetails(BaseModel): duration_seconds: Optional[StrictInt] = None started_at: Optional[datetime] = None terminated_at: Optional[datetime] = None - __properties: ClassVar[List[str]] = [ - "organization_id", - "instance_id", - "app_id", - "app_name", - "service_id", - "service_name", - "regional_deployment_id", - "region", - "deployment_id", - "instance_type", - "duration_seconds", - "started_at", - "terminated_at", - ] + __properties: ClassVar[List[str]] = ["organization_id", "instance_id", "app_id", "app_name", "service_id", "service_name", "regional_deployment_id", "region", "deployment_id", "instance_type", "duration_seconds", "started_at", "terminated_at"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -88,7 +74,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -106,21 +93,21 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "organization_id": obj.get("organization_id"), - "instance_id": obj.get("instance_id"), - "app_id": obj.get("app_id"), - "app_name": obj.get("app_name"), - "service_id": obj.get("service_id"), - "service_name": obj.get("service_name"), - "regional_deployment_id": obj.get("regional_deployment_id"), - "region": obj.get("region"), - "deployment_id": obj.get("deployment_id"), - "instance_type": obj.get("instance_type"), - "duration_seconds": obj.get("duration_seconds"), - "started_at": obj.get("started_at"), - "terminated_at": obj.get("terminated_at"), - } - ) + _obj = cls.model_validate({ + "organization_id": obj.get("organization_id"), + "instance_id": obj.get("instance_id"), + "app_id": obj.get("app_id"), + "app_name": obj.get("app_name"), + "service_id": obj.get("service_id"), + "service_name": obj.get("service_name"), + "regional_deployment_id": obj.get("regional_deployment_id"), + "region": obj.get("region"), + "deployment_id": obj.get("deployment_id"), + "instance_type": obj.get("instance_type"), + "duration_seconds": obj.get("duration_seconds"), + "started_at": obj.get("started_at"), + "terminated_at": obj.get("terminated_at") + }) return _obj + + diff --git a/koyeb/api/models/user.py b/koyeb/api/models/user.py index 062b802a..1041b9ad 100644 --- a/koyeb/api/models/user.py +++ b/koyeb/api/models/user.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -23,13 +23,12 @@ from koyeb.api.models.user_flags import UserFlags from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class User(BaseModel): """ User - """ # noqa: E501 - + """ # noqa: E501 id: Optional[StrictStr] = None email: Optional[StrictStr] = None avatar_url: Optional[StrictStr] = None @@ -45,38 +44,23 @@ class User(BaseModel): name: Optional[StrictStr] = None email_validated: Optional[StrictBool] = None trialed: Optional[StrictBool] = None - __properties: ClassVar[List[str]] = [ - "id", - "email", - "avatar_url", - "two_factor_authentication", - "last_login", - "last_login_ip", - "updated_at", - "created_at", - "newsletter_subscribed", - "github_id", - "github_user", - "flags", - "name", - "email_validated", - "trialed", - ] + __properties: ClassVar[List[str]] = ["id", "email", "avatar_url", "two_factor_authentication", "last_login", "last_login_ip", "updated_at", "created_at", "newsletter_subscribed", "github_id", "github_user", "flags", "name", "email_validated", "trialed"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -93,7 +77,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -111,23 +96,23 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "id": obj.get("id"), - "email": obj.get("email"), - "avatar_url": obj.get("avatar_url"), - "two_factor_authentication": obj.get("two_factor_authentication"), - "last_login": obj.get("last_login"), - "last_login_ip": obj.get("last_login_ip"), - "updated_at": obj.get("updated_at"), - "created_at": obj.get("created_at"), - "newsletter_subscribed": obj.get("newsletter_subscribed"), - "github_id": obj.get("github_id"), - "github_user": obj.get("github_user"), - "flags": obj.get("flags"), - "name": obj.get("name"), - "email_validated": obj.get("email_validated"), - "trialed": obj.get("trialed"), - } - ) + _obj = cls.model_validate({ + "id": obj.get("id"), + "email": obj.get("email"), + "avatar_url": obj.get("avatar_url"), + "two_factor_authentication": obj.get("two_factor_authentication"), + "last_login": obj.get("last_login"), + "last_login_ip": obj.get("last_login_ip"), + "updated_at": obj.get("updated_at"), + "created_at": obj.get("created_at"), + "newsletter_subscribed": obj.get("newsletter_subscribed"), + "github_id": obj.get("github_id"), + "github_user": obj.get("github_user"), + "flags": obj.get("flags"), + "name": obj.get("name"), + "email_validated": obj.get("email_validated"), + "trialed": obj.get("trialed") + }) return _obj + + diff --git a/koyeb/api/models/user_flags.py b/koyeb/api/models/user_flags.py index a2b7a91e..4a31b7c9 100644 --- a/koyeb/api/models/user_flags.py +++ b/koyeb/api/models/user_flags.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -26,23 +26,23 @@ class UserFlags(str, Enum): """ allowed enum values """ - ADMIN = "ADMIN" - TEST = "TEST" - RESTRICTED = "RESTRICTED" - ACTIVE = "ACTIVE" - BETA = "BETA" - MAX_ORGANIZATIONS_25 = "MAX_ORGANIZATIONS_25" - MAX_ORGANIZATIONS_100 = "MAX_ORGANIZATIONS_100" - MAX_ORGANIZATIONS_1000 = "MAX_ORGANIZATIONS_1000" - MAX_ORGANIZATIONS_10000 = "MAX_ORGANIZATIONS_10000" - MAX_ORGANIZATIONS_100000 = "MAX_ORGANIZATIONS_100000" - MAX_ORGANIZATIONS_1000000 = "MAX_ORGANIZATIONS_1000000" - PARTNER_CSP = "PARTNER_CSP" - IGNORE_ORGANIZATION_NAME_RESERVATION_RULE_NEON_PREFIX = ( - "IGNORE_ORGANIZATION_NAME_RESERVATION_RULE_NEON_PREFIX" - ) + ADMIN = 'ADMIN' + TEST = 'TEST' + RESTRICTED = 'RESTRICTED' + ACTIVE = 'ACTIVE' + BETA = 'BETA' + MAX_ORGANIZATIONS_25 = 'MAX_ORGANIZATIONS_25' + MAX_ORGANIZATIONS_100 = 'MAX_ORGANIZATIONS_100' + MAX_ORGANIZATIONS_1000 = 'MAX_ORGANIZATIONS_1000' + MAX_ORGANIZATIONS_10000 = 'MAX_ORGANIZATIONS_10000' + MAX_ORGANIZATIONS_100000 = 'MAX_ORGANIZATIONS_100000' + MAX_ORGANIZATIONS_1000000 = 'MAX_ORGANIZATIONS_1000000' + PARTNER_CSP = 'PARTNER_CSP' + IGNORE_ORGANIZATION_NAME_RESERVATION_RULE_NEON_PREFIX = 'IGNORE_ORGANIZATION_NAME_RESERVATION_RULE_NEON_PREFIX' @classmethod def from_json(cls, json_str: str) -> Self: """Create an instance of UserFlags from a JSON string""" return cls(json.loads(json_str)) + + diff --git a/koyeb/api/models/user_reply.py b/koyeb/api/models/user_reply.py index bbb1fe8e..2adaf7c4 100644 --- a/koyeb/api/models/user_reply.py +++ b/koyeb/api/models/user_reply.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -22,30 +22,30 @@ from koyeb.api.models.user import User from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class UserReply(BaseModel): """ UserReply - """ # noqa: E501 - + """ # noqa: E501 user: Optional[User] = None __properties: ClassVar[List[str]] = ["user"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -62,7 +62,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -71,7 +72,7 @@ def to_dict(self) -> Dict[str, Any]: ) # override the default output from pydantic by calling `to_dict()` of user if self.user: - _dict["user"] = self.user.to_dict() + _dict['user'] = self.user.to_dict() return _dict @classmethod @@ -83,11 +84,9 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "user": ( - User.from_dict(obj["user"]) if obj.get("user") is not None else None - ) - } - ) + _obj = cls.model_validate({ + "user": User.from_dict(obj["user"]) if obj.get("user") is not None else None + }) return _obj + + diff --git a/koyeb/api/models/user_role_role.py b/koyeb/api/models/user_role_role.py index 966994e7..f964e609 100644 --- a/koyeb/api/models/user_role_role.py +++ b/koyeb/api/models/user_role_role.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -26,10 +26,12 @@ class UserRoleRole(str, Enum): """ allowed enum values """ - INVALID = "INVALID" - OWNER = "OWNER" + INVALID = 'INVALID' + OWNER = 'OWNER' @classmethod def from_json(cls, json_str: str) -> Self: """Create an instance of UserRoleRole from a JSON string""" return cls(json.loads(json_str)) + + diff --git a/koyeb/api/models/user_settings.py b/koyeb/api/models/user_settings.py index cc7463b9..1e7118b4 100644 --- a/koyeb/api/models/user_settings.py +++ b/koyeb/api/models/user_settings.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -21,36 +21,32 @@ from typing import Any, ClassVar, Dict, List, Optional from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class UserSettings(BaseModel): """ UserSettings - """ # noqa: E501 - + """ # noqa: E501 id: Optional[StrictStr] = None user_id: Optional[StrictStr] = None failed_deployment_email_notification: Optional[StrictBool] = None - __properties: ClassVar[List[str]] = [ - "id", - "user_id", - "failed_deployment_email_notification", - ] + __properties: ClassVar[List[str]] = ["id", "user_id", "failed_deployment_email_notification"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -67,7 +63,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -85,13 +82,11 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "id": obj.get("id"), - "user_id": obj.get("user_id"), - "failed_deployment_email_notification": obj.get( - "failed_deployment_email_notification" - ), - } - ) + _obj = cls.model_validate({ + "id": obj.get("id"), + "user_id": obj.get("user_id"), + "failed_deployment_email_notification": obj.get("failed_deployment_email_notification") + }) return _obj + + diff --git a/koyeb/api/models/verify_docker_image_reply.py b/koyeb/api/models/verify_docker_image_reply.py index 1fa3d0fa..31e475ac 100644 --- a/koyeb/api/models/verify_docker_image_reply.py +++ b/koyeb/api/models/verify_docker_image_reply.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -19,39 +19,35 @@ from pydantic import BaseModel, ConfigDict, StrictBool, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from koyeb.api.models.verify_docker_image_reply_err_code import ( - VerifyDockerImageReplyErrCode, -) +from koyeb.api.models.verify_docker_image_reply_err_code import VerifyDockerImageReplyErrCode from typing import Optional, Set from typing_extensions import Self - +from pydantic_core import to_jsonable_python class VerifyDockerImageReply(BaseModel): """ VerifyDockerImageReply - """ # noqa: E501 - + """ # noqa: E501 success: Optional[StrictBool] = None reason: Optional[StrictStr] = None - code: Optional[VerifyDockerImageReplyErrCode] = ( - VerifyDockerImageReplyErrCode.UNKNOWN - ) + code: Optional[VerifyDockerImageReplyErrCode] = VerifyDockerImageReplyErrCode.UNKNOWN __properties: ClassVar[List[str]] = ["success", "reason", "code"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -68,7 +64,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -86,15 +83,11 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "success": obj.get("success"), - "reason": obj.get("reason"), - "code": ( - obj.get("code") - if obj.get("code") is not None - else VerifyDockerImageReplyErrCode.UNKNOWN - ), - } - ) + _obj = cls.model_validate({ + "success": obj.get("success"), + "reason": obj.get("reason"), + "code": obj.get("code") if obj.get("code") is not None else VerifyDockerImageReplyErrCode.UNKNOWN + }) return _obj + + diff --git a/koyeb/api/models/verify_docker_image_reply_err_code.py b/koyeb/api/models/verify_docker_image_reply_err_code.py index 9dedc7d2..fb4d4ae6 100644 --- a/koyeb/api/models/verify_docker_image_reply_err_code.py +++ b/koyeb/api/models/verify_docker_image_reply_err_code.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -26,21 +26,23 @@ class VerifyDockerImageReplyErrCode(str, Enum): """ allowed enum values """ - UNKNOWN = "UNKNOWN" - AUTH_ACCESS_DENIED = "AUTH_ACCESS_DENIED" - ANON_ACCESS_DENIED = "ANON_ACCESS_DENIED" - AUTH_NOT_FOUND = "AUTH_NOT_FOUND" - ANON_NOT_FOUND = "ANON_NOT_FOUND" - REGISTRY_ERROR = "REGISTRY_ERROR" - TIMEOUT = "TIMEOUT" - DNS = "DNS" - MALFORMED = "MALFORMED" - INVALID_OS = "INVALID_OS" - INVALID_ARCH = "INVALID_ARCH" - INVALID_SCHEME = "INVALID_SCHEME" - GENERIC = "GENERIC" + UNKNOWN = 'UNKNOWN' + AUTH_ACCESS_DENIED = 'AUTH_ACCESS_DENIED' + ANON_ACCESS_DENIED = 'ANON_ACCESS_DENIED' + AUTH_NOT_FOUND = 'AUTH_NOT_FOUND' + ANON_NOT_FOUND = 'ANON_NOT_FOUND' + REGISTRY_ERROR = 'REGISTRY_ERROR' + TIMEOUT = 'TIMEOUT' + DNS = 'DNS' + MALFORMED = 'MALFORMED' + INVALID_OS = 'INVALID_OS' + INVALID_ARCH = 'INVALID_ARCH' + INVALID_SCHEME = 'INVALID_SCHEME' + GENERIC = 'GENERIC' @classmethod def from_json(cls, json_str: str) -> Self: """Create an instance of VerifyDockerImageReplyErrCode from a JSON string""" return cls(json.loads(json_str)) + + diff --git a/koyeb/api/rest.py b/koyeb/api/rest.py index aa3c62bb..ae704a63 100644 --- a/koyeb/api/rest.py +++ b/koyeb/api/rest.py @@ -1,14 +1,14 @@ # coding: utf-8 """ -Koyeb Rest API + Koyeb Rest API -The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. + Do not edit the class manually. """ # noqa: E501 @@ -84,19 +84,22 @@ def __init__(self, configuration) -> None: "ca_cert_data": configuration.ca_cert_data, } if configuration.assert_hostname is not None: - pool_args["assert_hostname"] = configuration.assert_hostname + pool_args['assert_hostname'] = ( + configuration.assert_hostname + ) if configuration.retries is not None: - pool_args["retries"] = configuration.retries + pool_args['retries'] = configuration.retries if configuration.tls_server_name: - pool_args["server_hostname"] = configuration.tls_server_name + pool_args['server_hostname'] = configuration.tls_server_name + if configuration.socket_options is not None: - pool_args["socket_options"] = configuration.socket_options + pool_args['socket_options'] = configuration.socket_options if configuration.connection_pool_maxsize is not None: - pool_args["maxsize"] = configuration.connection_pool_maxsize + pool_args['maxsize'] = configuration.connection_pool_maxsize # https pool manager self.pool_manager: urllib3.PoolManager @@ -104,7 +107,6 @@ def __init__(self, configuration) -> None: if configuration.proxy: if is_socks_proxy_url(configuration.proxy): from urllib3.contrib.socks import SOCKSProxyManager - pool_args["proxy_url"] = configuration.proxy pool_args["headers"] = configuration.proxy_headers self.pool_manager = SOCKSProxyManager(**pool_args) @@ -122,7 +124,7 @@ def request( headers=None, body=None, post_params=None, - _request_timeout=None, + _request_timeout=None ): """Perform requests. @@ -139,7 +141,15 @@ def request( (connection, read) timeouts. """ method = method.upper() - assert method in ["GET", "HEAD", "DELETE", "POST", "PUT", "PATCH", "OPTIONS"] + assert method in [ + 'GET', + 'HEAD', + 'DELETE', + 'POST', + 'PUT', + 'PATCH', + 'OPTIONS' + ] if post_params and body: raise ApiValueError( @@ -153,18 +163,25 @@ def request( if _request_timeout: if isinstance(_request_timeout, (int, float)): timeout = urllib3.Timeout(total=_request_timeout) - elif isinstance(_request_timeout, tuple) and len(_request_timeout) == 2: + elif ( + isinstance(_request_timeout, tuple) + and len(_request_timeout) == 2 + ): timeout = urllib3.Timeout( - connect=_request_timeout[0], read=_request_timeout[1] + connect=_request_timeout[0], + read=_request_timeout[1] ) try: # For `POST`, `PUT`, `PATCH`, `OPTIONS`, `DELETE` - if method in ["POST", "PUT", "PATCH", "OPTIONS", "DELETE"]: + if method in ['POST', 'PUT', 'PATCH', 'OPTIONS', 'DELETE']: # no content type provided or payload is json - content_type = headers.get("Content-Type") - if not content_type or re.search("json", content_type, re.IGNORECASE): + content_type = headers.get('Content-Type') + if ( + not content_type + or re.search('json', content_type, re.IGNORECASE) + ): request_body = None if body is not None: request_body = json.dumps(body) @@ -174,9 +191,9 @@ def request( body=request_body, timeout=timeout, headers=headers, - preload_content=False, + preload_content=False ) - elif content_type == "application/x-www-form-urlencoded": + elif content_type == 'application/x-www-form-urlencoded': r = self.pool_manager.request( method, url, @@ -184,18 +201,15 @@ def request( encode_multipart=False, timeout=timeout, headers=headers, - preload_content=False, + preload_content=False ) - elif content_type == "multipart/form-data": + elif content_type == 'multipart/form-data': # must del headers['Content-Type'], or the correct # Content-Type which generated by urllib3 will be # overwritten. - del headers["Content-Type"] + del headers['Content-Type'] # Ensures that dict objects are serialized - post_params = [ - (a, json.dumps(b)) if isinstance(b, dict) else (a, b) - for a, b in post_params - ] + post_params = [(a, json.dumps(b)) if isinstance(b, dict) else (a,b) for a, b in post_params] r = self.pool_manager.request( method, url, @@ -203,7 +217,7 @@ def request( encode_multipart=True, timeout=timeout, headers=headers, - preload_content=False, + preload_content=False ) # Pass a `string` parameter directly in the body to support # other content types than JSON when `body` argument is @@ -215,11 +229,9 @@ def request( body=body, timeout=timeout, headers=headers, - preload_content=False, + preload_content=False ) - elif headers["Content-Type"].startswith("text/") and isinstance( - body, bool - ): + elif headers['Content-Type'].startswith('text/') and isinstance(body, bool): request_body = "true" if body else "false" r = self.pool_manager.request( method, @@ -227,8 +239,7 @@ def request( body=request_body, preload_content=False, timeout=timeout, - headers=headers, - ) + headers=headers) else: # Cannot generate the request from given parameters msg = """Cannot prepare a request message for provided @@ -243,7 +254,7 @@ def request( fields={}, timeout=timeout, headers=headers, - preload_content=False, + preload_content=False ) except urllib3.exceptions.SSLError as e: msg = "\n".join([type(e).__name__, str(e)]) diff --git a/koyeb/api/test/test_basic_auth_policy.py b/koyeb/api/test/test_basic_auth_policy.py new file mode 100644 index 00000000..ba33119b --- /dev/null +++ b/koyeb/api/test/test_basic_auth_policy.py @@ -0,0 +1,52 @@ +# coding: utf-8 + +""" + Koyeb Rest API + + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from koyeb.api.models.basic_auth_policy import BasicAuthPolicy + +class TestBasicAuthPolicy(unittest.TestCase): + """BasicAuthPolicy unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> BasicAuthPolicy: + """Test BasicAuthPolicy + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `BasicAuthPolicy` + """ + model = BasicAuthPolicy() + if include_optional: + return BasicAuthPolicy( + username = '', + password = '' + ) + else: + return BasicAuthPolicy( + ) + """ + + def testBasicAuthPolicy(self): + """Test BasicAuthPolicy""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/koyeb/api/test/test_check_coupon_reply.py b/koyeb/api/test/test_check_coupon_reply.py new file mode 100644 index 00000000..a5b15b15 --- /dev/null +++ b/koyeb/api/test/test_check_coupon_reply.py @@ -0,0 +1,54 @@ +# coding: utf-8 + +""" + Koyeb Rest API + + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from koyeb.api.models.check_coupon_reply import CheckCouponReply + +class TestCheckCouponReply(unittest.TestCase): + """CheckCouponReply unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> CheckCouponReply: + """Test CheckCouponReply + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `CheckCouponReply` + """ + model = CheckCouponReply() + if include_optional: + return CheckCouponReply( + name = '', + percent_off = 1.337, + amount_off = '', + currency = '' + ) + else: + return CheckCouponReply( + ) + """ + + def testCheckCouponReply(self): + """Test CheckCouponReply""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/koyeb/api/test/test_create_project.py b/koyeb/api/test/test_create_project.py new file mode 100644 index 00000000..03797d9e --- /dev/null +++ b/koyeb/api/test/test_create_project.py @@ -0,0 +1,52 @@ +# coding: utf-8 + +""" + Koyeb Rest API + + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from koyeb.api.models.create_project import CreateProject + +class TestCreateProject(unittest.TestCase): + """CreateProject unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> CreateProject: + """Test CreateProject + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `CreateProject` + """ + model = CreateProject() + if include_optional: + return CreateProject( + name = '', + description = '' + ) + else: + return CreateProject( + ) + """ + + def testCreateProject(self): + """Test CreateProject""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/koyeb/api/test/test_create_project_reply.py b/koyeb/api/test/test_create_project_reply.py new file mode 100644 index 00000000..3710e99a --- /dev/null +++ b/koyeb/api/test/test_create_project_reply.py @@ -0,0 +1,58 @@ +# coding: utf-8 + +""" + Koyeb Rest API + + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from koyeb.api.models.create_project_reply import CreateProjectReply + +class TestCreateProjectReply(unittest.TestCase): + """CreateProjectReply unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> CreateProjectReply: + """Test CreateProjectReply + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `CreateProjectReply` + """ + model = CreateProjectReply() + if include_optional: + return CreateProjectReply( + project = koyeb.api.models.project.Project( + id = '', + name = '', + description = '', + organization_id = '', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + service_count = '', ) + ) + else: + return CreateProjectReply( + ) + """ + + def testCreateProjectReply(self): + """Test CreateProjectReply""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/koyeb/api/test/test_get_project_reply.py b/koyeb/api/test/test_get_project_reply.py new file mode 100644 index 00000000..9fcbbed4 --- /dev/null +++ b/koyeb/api/test/test_get_project_reply.py @@ -0,0 +1,58 @@ +# coding: utf-8 + +""" + Koyeb Rest API + + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from koyeb.api.models.get_project_reply import GetProjectReply + +class TestGetProjectReply(unittest.TestCase): + """GetProjectReply unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> GetProjectReply: + """Test GetProjectReply + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `GetProjectReply` + """ + model = GetProjectReply() + if include_optional: + return GetProjectReply( + project = koyeb.api.models.project.Project( + id = '', + name = '', + description = '', + organization_id = '', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + service_count = '', ) + ) + else: + return GetProjectReply( + ) + """ + + def testGetProjectReply(self): + """Test GetProjectReply""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/koyeb/api/test/test_get_service_scaling_reply.py b/koyeb/api/test/test_get_service_scaling_reply.py new file mode 100644 index 00000000..4b178a20 --- /dev/null +++ b/koyeb/api/test/test_get_service_scaling_reply.py @@ -0,0 +1,57 @@ +# coding: utf-8 + +""" + Koyeb Rest API + + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from koyeb.api.models.get_service_scaling_reply import GetServiceScalingReply + +class TestGetServiceScalingReply(unittest.TestCase): + """GetServiceScalingReply unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> GetServiceScalingReply: + """Test GetServiceScalingReply + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `GetServiceScalingReply` + """ + model = GetServiceScalingReply() + if include_optional: + return GetServiceScalingReply( + scalings = [ + koyeb.api.models.manual_service_scaling.ManualServiceScaling( + scopes = [ + '' + ], + instances = 56, ) + ] + ) + else: + return GetServiceScalingReply( + ) + """ + + def testGetServiceScalingReply(self): + """Test GetServiceScalingReply""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/koyeb/api/test/test_lifecycle_quotas.py b/koyeb/api/test/test_lifecycle_quotas.py new file mode 100644 index 00000000..6226a224 --- /dev/null +++ b/koyeb/api/test/test_lifecycle_quotas.py @@ -0,0 +1,54 @@ +# coding: utf-8 + +""" + Koyeb Rest API + + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from koyeb.api.models.lifecycle_quotas import LifecycleQuotas + +class TestLifecycleQuotas(unittest.TestCase): + """LifecycleQuotas unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> LifecycleQuotas: + """Test LifecycleQuotas + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `LifecycleQuotas` + """ + model = LifecycleQuotas() + if include_optional: + return LifecycleQuotas( + delete_after_sleep_min = 56, + delete_after_sleep_max = 56, + delete_after_create_min = 56, + delete_after_create_max = 56 + ) + else: + return LifecycleQuotas( + ) + """ + + def testLifecycleQuotas(self): + """Test LifecycleQuotas""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/koyeb/api/test/test_list_projects_reply.py b/koyeb/api/test/test_list_projects_reply.py new file mode 100644 index 00000000..e30bb8ca --- /dev/null +++ b/koyeb/api/test/test_list_projects_reply.py @@ -0,0 +1,62 @@ +# coding: utf-8 + +""" + Koyeb Rest API + + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from koyeb.api.models.list_projects_reply import ListProjectsReply + +class TestListProjectsReply(unittest.TestCase): + """ListProjectsReply unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> ListProjectsReply: + """Test ListProjectsReply + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `ListProjectsReply` + """ + model = ListProjectsReply() + if include_optional: + return ListProjectsReply( + projects = [ + koyeb.api.models.project.Project( + id = '', + name = '', + description = '', + organization_id = '', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + service_count = '', ) + ], + limit = 56, + offset = 56 + ) + else: + return ListProjectsReply( + ) + """ + + def testListProjectsReply(self): + """Test ListProjectsReply""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/koyeb/api/test/test_manual_service_scaling.py b/koyeb/api/test/test_manual_service_scaling.py new file mode 100644 index 00000000..c90b8f52 --- /dev/null +++ b/koyeb/api/test/test_manual_service_scaling.py @@ -0,0 +1,54 @@ +# coding: utf-8 + +""" + Koyeb Rest API + + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from koyeb.api.models.manual_service_scaling import ManualServiceScaling + +class TestManualServiceScaling(unittest.TestCase): + """ManualServiceScaling unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> ManualServiceScaling: + """Test ManualServiceScaling + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `ManualServiceScaling` + """ + model = ManualServiceScaling() + if include_optional: + return ManualServiceScaling( + scopes = [ + '' + ], + instances = 56 + ) + else: + return ManualServiceScaling( + ) + """ + + def testManualServiceScaling(self): + """Test ManualServiceScaling""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/koyeb/api/test/test_project.py b/koyeb/api/test/test_project.py new file mode 100644 index 00000000..250f3999 --- /dev/null +++ b/koyeb/api/test/test_project.py @@ -0,0 +1,57 @@ +# coding: utf-8 + +""" + Koyeb Rest API + + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from koyeb.api.models.project import Project + +class TestProject(unittest.TestCase): + """Project unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> Project: + """Test Project + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `Project` + """ + model = Project() + if include_optional: + return Project( + id = '', + name = '', + description = '', + organization_id = '', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + service_count = '' + ) + else: + return Project( + ) + """ + + def testProject(self): + """Test Project""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/koyeb/api/test/test_projects_api.py b/koyeb/api/test/test_projects_api.py new file mode 100644 index 00000000..3669edcd --- /dev/null +++ b/koyeb/api/test/test_projects_api.py @@ -0,0 +1,73 @@ +# coding: utf-8 + +""" + Koyeb Rest API + + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from koyeb.api.api.projects_api import ProjectsApi + + +class TestProjectsApi(unittest.TestCase): + """ProjectsApi unit test stubs""" + + def setUp(self) -> None: + self.api = ProjectsApi() + + def tearDown(self) -> None: + pass + + def test_create_project(self) -> None: + """Test case for create_project + + Create project + """ + pass + + def test_delete_project(self) -> None: + """Test case for delete_project + + Delete project + """ + pass + + def test_get_project(self) -> None: + """Test case for get_project + + Get project + """ + pass + + def test_list_projects(self) -> None: + """Test case for list_projects + + List projects + """ + pass + + def test_update_project(self) -> None: + """Test case for update_project + + Update project + """ + pass + + def test_update_project2(self) -> None: + """Test case for update_project2 + + Update project + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/koyeb/api/test/test_sandbox_metadata.py b/koyeb/api/test/test_sandbox_metadata.py new file mode 100644 index 00000000..48b8aa94 --- /dev/null +++ b/koyeb/api/test/test_sandbox_metadata.py @@ -0,0 +1,52 @@ +# coding: utf-8 + +""" + Koyeb Rest API + + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from koyeb.api.models.sandbox_metadata import SandboxMetadata + +class TestSandboxMetadata(unittest.TestCase): + """SandboxMetadata unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> SandboxMetadata: + """Test SandboxMetadata + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `SandboxMetadata` + """ + model = SandboxMetadata() + if include_optional: + return SandboxMetadata( + public_url = '', + routing_key = '' + ) + else: + return SandboxMetadata( + ) + """ + + def testSandboxMetadata(self): + """Test SandboxMetadata""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/koyeb/api/test/test_security_policies.py b/koyeb/api/test/test_security_policies.py new file mode 100644 index 00000000..03d1b61f --- /dev/null +++ b/koyeb/api/test/test_security_policies.py @@ -0,0 +1,58 @@ +# coding: utf-8 + +""" + Koyeb Rest API + + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from koyeb.api.models.security_policies import SecurityPolicies + +class TestSecurityPolicies(unittest.TestCase): + """SecurityPolicies unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> SecurityPolicies: + """Test SecurityPolicies + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `SecurityPolicies` + """ + model = SecurityPolicies() + if include_optional: + return SecurityPolicies( + basic_auths = [ + koyeb.api.models.basic_auth_policy.BasicAuthPolicy( + username = '', + password = '', ) + ], + api_keys = [ + '' + ] + ) + else: + return SecurityPolicies( + ) + """ + + def testSecurityPolicies(self): + """Test SecurityPolicies""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/koyeb/api/test/test_update_organization_default_project_reply.py b/koyeb/api/test/test_update_organization_default_project_reply.py new file mode 100644 index 00000000..5a1c1dd2 --- /dev/null +++ b/koyeb/api/test/test_update_organization_default_project_reply.py @@ -0,0 +1,85 @@ +# coding: utf-8 + +""" + Koyeb Rest API + + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from koyeb.api.models.update_organization_default_project_reply import UpdateOrganizationDefaultProjectReply + +class TestUpdateOrganizationDefaultProjectReply(unittest.TestCase): + """UpdateOrganizationDefaultProjectReply unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> UpdateOrganizationDefaultProjectReply: + """Test UpdateOrganizationDefaultProjectReply + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `UpdateOrganizationDefaultProjectReply` + """ + model = UpdateOrganizationDefaultProjectReply() + if include_optional: + return UpdateOrganizationDefaultProjectReply( + organization = koyeb.api.models.represent_an_organization.Represent an Organization( + id = '', + external_id = '', + provisioning = True, + address1 = '', + address2 = '', + city = '', + postal_code = '', + state = '', + country = '', + company = True, + vat_number = '', + billing_name = '', + billing_email = '', + name = '', + plan = 'hobby', + plan_updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + has_payment_method = True, + subscription_id = '', + current_subscription_id = '', + latest_subscription_id = '', + signup_qualification = koyeb.api.models.signup_qualification.signup_qualification(), + status = 'WARNING', + status_message = 'NEW', + deactivation_reason = 'INVALID', + verified = True, + qualifies_for_hobby23 = True, + reprocess_after = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + trialing = True, + trial_starts_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + trial_ends_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + email_domain_allowlist = [ + '' + ], + default_project_id = '', ) + ) + else: + return UpdateOrganizationDefaultProjectReply( + ) + """ + + def testUpdateOrganizationDefaultProjectReply(self): + """Test UpdateOrganizationDefaultProjectReply""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/koyeb/api/test/test_update_organization_default_project_request.py b/koyeb/api/test/test_update_organization_default_project_request.py new file mode 100644 index 00000000..e37d6620 --- /dev/null +++ b/koyeb/api/test/test_update_organization_default_project_request.py @@ -0,0 +1,51 @@ +# coding: utf-8 + +""" + Koyeb Rest API + + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from koyeb.api.models.update_organization_default_project_request import UpdateOrganizationDefaultProjectRequest + +class TestUpdateOrganizationDefaultProjectRequest(unittest.TestCase): + """UpdateOrganizationDefaultProjectRequest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> UpdateOrganizationDefaultProjectRequest: + """Test UpdateOrganizationDefaultProjectRequest + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `UpdateOrganizationDefaultProjectRequest` + """ + model = UpdateOrganizationDefaultProjectRequest() + if include_optional: + return UpdateOrganizationDefaultProjectRequest( + default_project_id = '' + ) + else: + return UpdateOrganizationDefaultProjectRequest( + ) + """ + + def testUpdateOrganizationDefaultProjectRequest(self): + """Test UpdateOrganizationDefaultProjectRequest""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/koyeb/api/test/test_update_project_reply.py b/koyeb/api/test/test_update_project_reply.py new file mode 100644 index 00000000..242f8e6c --- /dev/null +++ b/koyeb/api/test/test_update_project_reply.py @@ -0,0 +1,58 @@ +# coding: utf-8 + +""" + Koyeb Rest API + + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from koyeb.api.models.update_project_reply import UpdateProjectReply + +class TestUpdateProjectReply(unittest.TestCase): + """UpdateProjectReply unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> UpdateProjectReply: + """Test UpdateProjectReply + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `UpdateProjectReply` + """ + model = UpdateProjectReply() + if include_optional: + return UpdateProjectReply( + project = koyeb.api.models.project.Project( + id = '', + name = '', + description = '', + organization_id = '', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + service_count = '', ) + ) + else: + return UpdateProjectReply( + ) + """ + + def testUpdateProjectReply(self): + """Test UpdateProjectReply""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/koyeb/api/test/test_update_service_scaling_request.py b/koyeb/api/test/test_update_service_scaling_request.py new file mode 100644 index 00000000..461606dd --- /dev/null +++ b/koyeb/api/test/test_update_service_scaling_request.py @@ -0,0 +1,57 @@ +# coding: utf-8 + +""" + Koyeb Rest API + + The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from koyeb.api.models.update_service_scaling_request import UpdateServiceScalingRequest + +class TestUpdateServiceScalingRequest(unittest.TestCase): + """UpdateServiceScalingRequest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> UpdateServiceScalingRequest: + """Test UpdateServiceScalingRequest + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `UpdateServiceScalingRequest` + """ + model = UpdateServiceScalingRequest() + if include_optional: + return UpdateServiceScalingRequest( + scalings = [ + koyeb.api.models.manual_service_scaling.ManualServiceScaling( + scopes = [ + '' + ], + instances = 56, ) + ] + ) + else: + return UpdateServiceScalingRequest( + ) + """ + + def testUpdateServiceScalingRequest(self): + """Test UpdateServiceScalingRequest""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/koyeb/api_README.md b/koyeb/api_README.md index 88acdaf0..d6b315aa 100644 --- a/koyeb/api_README.md +++ b/koyeb/api_README.md @@ -5,7 +5,7 @@ The `koyeb.api` package is automatically generated by the [OpenAPI Generator](ht - API version: 1.0.0 - Package version: 1.3.3 -- Generator version: 7.18.0-SNAPSHOT +- Generator version: 7.21.0-SNAPSHOT - Build package: org.openapitools.codegen.languages.PythonClientCodegen ## Requirements. @@ -20,7 +20,7 @@ To be able to use it, you will need these dependencies in your own package that * urllib3 >= 2.1.0, < 3.0.0 * python-dateutil >= 2.8.2 -* pydantic >= 2 +* pydantic >= 2.11 * typing-extensions >= 4.7.1 ## Getting Started @@ -91,6 +91,7 @@ Class | Method | HTTP request | Description *CatalogRegionsApi* | [**get_region**](koyeb/api/docs/CatalogRegionsApi.md#get_region) | **GET** /v1/catalog/regions/{id} | Get Region *CatalogRegionsApi* | [**list_regions**](koyeb/api/docs/CatalogRegionsApi.md#list_regions) | **GET** /v1/catalog/regions | List Region *ComposeApi* | [**compose**](koyeb/api/docs/ComposeApi.md#compose) | **POST** /v1/compose | Create resources from compose. +*CouponsApi* | [**check_coupon**](koyeb/api/docs/CouponsApi.md#check_coupon) | **GET** /v1/coupons/{code} | Check Coupon *CouponsApi* | [**redeem_coupon**](koyeb/api/docs/CouponsApi.md#redeem_coupon) | **POST** /v1/coupons | Redeem Coupon *CredentialsApi* | [**create_credential**](koyeb/api/docs/CredentialsApi.md#create_credential) | **POST** /v1/credentials | Create credential *CredentialsApi* | [**delete_credential**](koyeb/api/docs/CredentialsApi.md#delete_credential) | **DELETE** /v1/credentials/{id} | Delete credential @@ -161,6 +162,12 @@ Class | Method | HTTP request | Description *ProfileApi* | [**update_user_v2**](koyeb/api/docs/ProfileApi.md#update_user_v2) | **PUT** /v2/account/profile | Update User V2 *ProfileApi* | [**update_user_v22**](koyeb/api/docs/ProfileApi.md#update_user_v22) | **PATCH** /v2/account/profile | Update User V2 *ProfileApi* | [**validate**](koyeb/api/docs/ProfileApi.md#validate) | **POST** /v1/account/validate/{id} | Validate +*ProjectsApi* | [**create_project**](koyeb/api/docs/ProjectsApi.md#create_project) | **POST** /v1/projects | Create project +*ProjectsApi* | [**delete_project**](koyeb/api/docs/ProjectsApi.md#delete_project) | **DELETE** /v1/projects/{id} | Delete project +*ProjectsApi* | [**get_project**](koyeb/api/docs/ProjectsApi.md#get_project) | **GET** /v1/projects/{id} | Get project +*ProjectsApi* | [**list_projects**](koyeb/api/docs/ProjectsApi.md#list_projects) | **GET** /v1/projects | List projects +*ProjectsApi* | [**update_project**](koyeb/api/docs/ProjectsApi.md#update_project) | **PUT** /v1/projects/{id} | Update project +*ProjectsApi* | [**update_project2**](koyeb/api/docs/ProjectsApi.md#update_project2) | **PATCH** /v1/projects/{id} | Update project *ProvisioningApi* | [**create_stage_attempt**](koyeb/api/docs/ProvisioningApi.md#create_stage_attempt) | **POST** /v1/provisioning/{deployment_id}/status/{stage}/{attempt} | Create an attempt for a stage *ProvisioningApi* | [**declare_stage_progress**](koyeb/api/docs/ProvisioningApi.md#declare_stage_progress) | **PATCH** /v1/provisioning/{deployment_id}/status/{stage}/{attempt} | Declare stage progress *ProvisioningApi* | [**declare_step_progress**](koyeb/api/docs/ProvisioningApi.md#declare_step_progress) | **PATCH** /v1/provisioning/{deployment_id}/status/{stage}/{attempt}/{step} | Declare step progress @@ -182,7 +189,9 @@ Class | Method | HTTP request | Description *ServicesApi* | [**autocomplete**](koyeb/api/docs/ServicesApi.md#autocomplete) | **POST** /v1/services-autocomplete | Autocomplete definition *ServicesApi* | [**create_service**](koyeb/api/docs/ServicesApi.md#create_service) | **POST** /v1/services | Create Service *ServicesApi* | [**delete_service**](koyeb/api/docs/ServicesApi.md#delete_service) | **DELETE** /v1/services/{id} | Delete Service +*ServicesApi* | [**delete_service_scaling**](koyeb/api/docs/ServicesApi.md#delete_service_scaling) | **DELETE** /v1/services/{id}/scale | Delete Service Scaling *ServicesApi* | [**get_service**](koyeb/api/docs/ServicesApi.md#get_service) | **GET** /v1/services/{id} | Get Service +*ServicesApi* | [**get_service_scaling**](koyeb/api/docs/ServicesApi.md#get_service_scaling) | **GET** /v1/services/{id}/scale | Get Service Scaling *ServicesApi* | [**list_service_events**](koyeb/api/docs/ServicesApi.md#list_service_events) | **GET** /v1/service_events | List Service events *ServicesApi* | [**list_services**](koyeb/api/docs/ServicesApi.md#list_services) | **GET** /v1/services | List Services *ServicesApi* | [**pause_service**](koyeb/api/docs/ServicesApi.md#pause_service) | **POST** /v1/services/{id}/pause | Pause Service @@ -190,6 +199,7 @@ Class | Method | HTTP request | Description *ServicesApi* | [**resume_service**](koyeb/api/docs/ServicesApi.md#resume_service) | **POST** /v1/services/{id}/resume | Resume Service *ServicesApi* | [**update_service**](koyeb/api/docs/ServicesApi.md#update_service) | **PUT** /v1/services/{id} | Update Service *ServicesApi* | [**update_service2**](koyeb/api/docs/ServicesApi.md#update_service2) | **PATCH** /v1/services/{id} | Update Service +*ServicesApi* | [**update_service_scaling**](koyeb/api/docs/ServicesApi.md#update_service_scaling) | **PUT** /v1/services/{id}/scale | Update Service Scaling *SessionsApi* | [**login**](koyeb/api/docs/SessionsApi.md#login) | **POST** /v1/account/login | Login user *SessionsApi* | [**logout**](koyeb/api/docs/SessionsApi.md#logout) | **DELETE** /v1/account/logout | Logout user *SessionsApi* | [**new_session**](koyeb/api/docs/SessionsApi.md#new_session) | **POST** /v1/account/session | New session @@ -228,7 +238,8 @@ Class | Method | HTTP request | Description *OrganizationApi* | [**update_budget**](koyeb/api/docs/OrganizationApi.md#update_budget) | **PUT** /v1/organizations/{organization_id}/budget | Update Budget *OrganizationApi* | [**update_organization**](koyeb/api/docs/OrganizationApi.md#update_organization) | **PUT** /v1/organizations/{id} | Update Organization *OrganizationApi* | [**update_organization2**](koyeb/api/docs/OrganizationApi.md#update_organization2) | **PATCH** /v1/organizations/{id} | Update Organization -*OrganizationApi* | [**update_organization_name**](koyeb/api/docs/OrganizationApi.md#update_organization_name) | **PUT** /v1/organizations/{id}/name | Update Organization +*OrganizationApi* | [**update_organization_default_project**](koyeb/api/docs/OrganizationApi.md#update_organization_default_project) | **PUT** /v1/organizations/{id}/default_project | Update Organization's default project +*OrganizationApi* | [**update_organization_name**](koyeb/api/docs/OrganizationApi.md#update_organization_name) | **PUT** /v1/organizations/{id}/name | Update Organization Name *OrganizationApi* | [**update_organization_plan**](koyeb/api/docs/OrganizationApi.md#update_organization_plan) | **POST** /v1/organizations/{id}/plan | Update Organization plan *OrganizationApi* | [**upsert_signup_qualification**](koyeb/api/docs/OrganizationApi.md#upsert_signup_qualification) | **POST** /v1/organizations/{id}/signup_qualification | Upsert Organization's signup qualification *SsoApi* | [**canny_auth**](koyeb/api/docs/SsoApi.md#canny_auth) | **POST** /v1/sso/canny | @@ -257,6 +268,7 @@ Class | Method | HTTP request | Description - [AutocompleteRequest](koyeb/api/docs/AutocompleteRequest.md) - [AvailabilityLevel](koyeb/api/docs/AvailabilityLevel.md) - [AzureContainerRegistryConfiguration](koyeb/api/docs/AzureContainerRegistryConfiguration.md) + - [BasicAuthPolicy](koyeb/api/docs/BasicAuthPolicy.md) - [Budget](koyeb/api/docs/Budget.md) - [BuildpackBuilder](koyeb/api/docs/BuildpackBuilder.md) - [CannyAuthReply](koyeb/api/docs/CannyAuthReply.md) @@ -264,6 +276,7 @@ Class | Method | HTTP request | Description - [CatalogInstance](koyeb/api/docs/CatalogInstance.md) - [CatalogInstanceListItem](koyeb/api/docs/CatalogInstanceListItem.md) - [CatalogUsage](koyeb/api/docs/CatalogUsage.md) + - [CheckCouponReply](koyeb/api/docs/CheckCouponReply.md) - [ClearIdenfyVerificationResultRequest](koyeb/api/docs/ClearIdenfyVerificationResultRequest.md) - [ComposeReply](koyeb/api/docs/ComposeReply.md) - [ConfigFile](koyeb/api/docs/ConfigFile.md) @@ -288,6 +301,8 @@ Class | Method | HTTP request | Description - [CreatePaymentAuthorizationReply](koyeb/api/docs/CreatePaymentAuthorizationReply.md) - [CreatePersistentVolumeReply](koyeb/api/docs/CreatePersistentVolumeReply.md) - [CreatePersistentVolumeRequest](koyeb/api/docs/CreatePersistentVolumeRequest.md) + - [CreateProject](koyeb/api/docs/CreateProject.md) + - [CreateProjectReply](koyeb/api/docs/CreateProjectReply.md) - [CreateSecret](koyeb/api/docs/CreateSecret.md) - [CreateSecretReply](koyeb/api/docs/CreateSecretReply.md) - [CreateService](koyeb/api/docs/CreateService.md) @@ -392,11 +407,13 @@ Class | Method | HTTP request | Description - [GetOrganizationUsageReply](koyeb/api/docs/GetOrganizationUsageReply.md) - [GetPaymentMethodReply](koyeb/api/docs/GetPaymentMethodReply.md) - [GetPersistentVolumeReply](koyeb/api/docs/GetPersistentVolumeReply.md) + - [GetProjectReply](koyeb/api/docs/GetProjectReply.md) - [GetQuotasReply](koyeb/api/docs/GetQuotasReply.md) - [GetRegionReply](koyeb/api/docs/GetRegionReply.md) - [GetRegionalDeploymentReply](koyeb/api/docs/GetRegionalDeploymentReply.md) - [GetSecretReply](koyeb/api/docs/GetSecretReply.md) - [GetServiceReply](koyeb/api/docs/GetServiceReply.md) + - [GetServiceScalingReply](koyeb/api/docs/GetServiceScalingReply.md) - [GetSnapshotReply](koyeb/api/docs/GetSnapshotReply.md) - [GetSubscriptionReply](koyeb/api/docs/GetSubscriptionReply.md) - [GetUserOrganizationInvitationReply](koyeb/api/docs/GetUserOrganizationInvitationReply.md) @@ -438,6 +455,7 @@ Class | Method | HTTP request | Description - [KsearchSearchReply](koyeb/api/docs/KsearchSearchReply.md) - [KsearchService](koyeb/api/docs/KsearchService.md) - [KsearchUser](koyeb/api/docs/KsearchUser.md) + - [LifecycleQuotas](koyeb/api/docs/LifecycleQuotas.md) - [ListAppEventsReply](koyeb/api/docs/ListAppEventsReply.md) - [ListAppsReply](koyeb/api/docs/ListAppsReply.md) - [ListCatalogInstancesReply](koyeb/api/docs/ListCatalogInstancesReply.md) @@ -453,6 +471,7 @@ Class | Method | HTTP request | Description - [ListPaymentMethodsReply](koyeb/api/docs/ListPaymentMethodsReply.md) - [ListPersistentVolumeEventsReply](koyeb/api/docs/ListPersistentVolumeEventsReply.md) - [ListPersistentVolumesReply](koyeb/api/docs/ListPersistentVolumesReply.md) + - [ListProjectsReply](koyeb/api/docs/ListProjectsReply.md) - [ListRegionalDeploymentEventsReply](koyeb/api/docs/ListRegionalDeploymentEventsReply.md) - [ListRegionalDeploymentsReply](koyeb/api/docs/ListRegionalDeploymentsReply.md) - [ListRegionsReply](koyeb/api/docs/ListRegionsReply.md) @@ -469,6 +488,7 @@ Class | Method | HTTP request | Description - [LoginReply](koyeb/api/docs/LoginReply.md) - [LoginRequest](koyeb/api/docs/LoginRequest.md) - [ManageReply](koyeb/api/docs/ManageReply.md) + - [ManualServiceScaling](koyeb/api/docs/ManualServiceScaling.md) - [MembersSummary](koyeb/api/docs/MembersSummary.md) - [MetricName](koyeb/api/docs/MetricName.md) - [NeonPostgresDatabase](koyeb/api/docs/NeonPostgresDatabase.md) @@ -508,6 +528,7 @@ Class | Method | HTTP request | Description - [Plan](koyeb/api/docs/Plan.md) - [Port](koyeb/api/docs/Port.md) - [PrivateRegistryConfiguration](koyeb/api/docs/PrivateRegistryConfiguration.md) + - [Project](koyeb/api/docs/Project.md) - [ProxyPortProtocol](koyeb/api/docs/ProxyPortProtocol.md) - [PublicOrganization](koyeb/api/docs/PublicOrganization.md) - [PublicUser](koyeb/api/docs/PublicUser.md) @@ -538,11 +559,13 @@ Class | Method | HTTP request | Description - [ReviewOrganizationCapacityRequest](koyeb/api/docs/ReviewOrganizationCapacityRequest.md) - [Route](koyeb/api/docs/Route.md) - [Sample](koyeb/api/docs/Sample.md) + - [SandboxMetadata](koyeb/api/docs/SandboxMetadata.md) - [ScaleToZeroQuotas](koyeb/api/docs/ScaleToZeroQuotas.md) - [Scaling](koyeb/api/docs/Scaling.md) - [Secret](koyeb/api/docs/Secret.md) - [SecretType](koyeb/api/docs/SecretType.md) - [SecretsSummary](koyeb/api/docs/SecretsSummary.md) + - [SecurityPolicies](koyeb/api/docs/SecurityPolicies.md) - [Service](koyeb/api/docs/Service.md) - [ServiceEvent](koyeb/api/docs/ServiceEvent.md) - [ServiceLifeCycle](koyeb/api/docs/ServiceLifeCycle.md) @@ -575,6 +598,8 @@ Class | Method | HTTP request | Description - [UpdateCredentialReply](koyeb/api/docs/UpdateCredentialReply.md) - [UpdateDomain](koyeb/api/docs/UpdateDomain.md) - [UpdateDomainReply](koyeb/api/docs/UpdateDomainReply.md) + - [UpdateOrganizationDefaultProjectReply](koyeb/api/docs/UpdateOrganizationDefaultProjectReply.md) + - [UpdateOrganizationDefaultProjectRequest](koyeb/api/docs/UpdateOrganizationDefaultProjectRequest.md) - [UpdateOrganizationNameReply](koyeb/api/docs/UpdateOrganizationNameReply.md) - [UpdateOrganizationNameRequest](koyeb/api/docs/UpdateOrganizationNameRequest.md) - [UpdateOrganizationPlanReply](koyeb/api/docs/UpdateOrganizationPlanReply.md) @@ -583,9 +608,11 @@ Class | Method | HTTP request | Description - [UpdatePasswordRequest](koyeb/api/docs/UpdatePasswordRequest.md) - [UpdatePersistentVolumeReply](koyeb/api/docs/UpdatePersistentVolumeReply.md) - [UpdatePersistentVolumeRequest](koyeb/api/docs/UpdatePersistentVolumeRequest.md) + - [UpdateProjectReply](koyeb/api/docs/UpdateProjectReply.md) - [UpdateSecretReply](koyeb/api/docs/UpdateSecretReply.md) - [UpdateService](koyeb/api/docs/UpdateService.md) - [UpdateServiceReply](koyeb/api/docs/UpdateServiceReply.md) + - [UpdateServiceScalingRequest](koyeb/api/docs/UpdateServiceScalingRequest.md) - [UpdateSnapshotReply](koyeb/api/docs/UpdateSnapshotReply.md) - [UpdateSnapshotRequest](koyeb/api/docs/UpdateSnapshotRequest.md) - [UpdateUserRequestUserUpdateBody](koyeb/api/docs/UpdateUserRequestUserUpdateBody.md) diff --git a/koyeb/sandbox/exec.py b/koyeb/sandbox/exec.py index 2ad4e786..7d0e530f 100644 --- a/koyeb/sandbox/exec.py +++ b/koyeb/sandbox/exec.py @@ -74,10 +74,8 @@ def __init__(self, sandbox: Sandbox) -> None: def _get_client(self) -> SandboxClient: """Get or create SandboxClient instance""" if self._client is None: - sandbox_url = self.sandbox._get_sandbox_url() - self._client = create_sandbox_client( - sandbox_url, self.sandbox.sandbox_secret - ) + conn_info = self.sandbox._get_conn_info() + self._client = create_sandbox_client(conn_info) return self._client def __call__( diff --git a/koyeb/sandbox/executor_client.py b/koyeb/sandbox/executor_client.py index 95b6c0a5..73a687f8 100644 --- a/koyeb/sandbox/executor_client.py +++ b/koyeb/sandbox/executor_client.py @@ -4,6 +4,7 @@ A simple Python client for interacting with the Sandbox Executor API. """ +from dataclasses import dataclass import json import logging import time @@ -16,27 +17,46 @@ logger = logging.getLogger(__name__) +@dataclass +class ConnectionInfo: + """Information needed to connect to a sandbox""" + + public_url: str + routing_key: Optional[str] + secret: Optional[str] + + def __str__(self) -> str: + return f"ConnectionInfo(public_url={self.public_url}, routing_key={self.routing_key}, secret={'********' if self.secret else 'None'})" + + def validate(self) -> None: + if not self.public_url: + raise ValueError("Unable to get sandbox URL") + if not self.secret: + raise ValueError("Sandbox secret not available") + + class SandboxClient: """Client for the Sandbox Executor API.""" def __init__( - self, base_url: str, secret: str, timeout: float = DEFAULT_HTTP_TIMEOUT + self, conn_info: ConnectionInfo, timeout: float = DEFAULT_HTTP_TIMEOUT ): """ Initialize the Sandbox Client. Args: - base_url: The base URL of the sandbox server (e.g., 'http://localhost:8080') - secret: The authentication secret/token + conn_info: The parameters needed to connect to the sandbox timeout: Request timeout in seconds (default: 30) """ - self.base_url = base_url.rstrip("/") - self.secret = secret + self.base_url = conn_info.public_url.rstrip("/") + self.secret = conn_info.secret self.timeout = timeout self.headers = { - "Authorization": f"Bearer {secret}", + "Authorization": f"Bearer {conn_info.secret}", "Content-Type": "application/json", } + if conn_info.routing_key: + self.headers["X-Routing-Key"] = conn_info.routing_key # Use session for connection pooling self._session = requests.Session() self._session.headers.update(self.headers) diff --git a/koyeb/sandbox/filesystem.py b/koyeb/sandbox/filesystem.py index b3a7c380..25998044 100644 --- a/koyeb/sandbox/filesystem.py +++ b/koyeb/sandbox/filesystem.py @@ -62,10 +62,8 @@ def __init__(self, sandbox: Sandbox) -> None: def _get_client(self) -> SandboxClient: """Get or create SandboxClient instance""" if self._client is None: - sandbox_url = self.sandbox._get_sandbox_url() - self._client = create_sandbox_client( - sandbox_url, self.sandbox.sandbox_secret - ) + conn_info = self.sandbox._get_conn_info() + self._client = create_sandbox_client(conn_info) return self._client def _get_executor(self) -> "SandboxExecutor": diff --git a/koyeb/sandbox/sandbox.py b/koyeb/sandbox/sandbox.py index 6fbfa1d0..a45dc2e1 100644 --- a/koyeb/sandbox/sandbox.py +++ b/koyeb/sandbox/sandbox.py @@ -11,7 +11,7 @@ import secrets import time from dataclasses import dataclass -from typing import TYPE_CHECKING, Dict, List, Optional +from typing import TYPE_CHECKING, Dict, List, Optional, Tuple from koyeb.api.api.deployments_api import DeploymentsApi from koyeb.api.exceptions import ApiException, NotFoundException @@ -19,6 +19,7 @@ from koyeb.api.models.create_service import CreateService, ServiceLifeCycle from koyeb.api.models.update_service import UpdateService +from .executor_client import ConnectionInfo from .utils import ( DEFAULT_INSTANCE_WAIT_TIMEOUT, DEFAULT_POLL_INTERVAL, @@ -90,7 +91,8 @@ def __init__( self.api_token = api_token self.sandbox_secret = sandbox_secret self._created_at = time.time() - self._sandbox_url = None + self._sandbox_url: Optional[Tuple[str, Optional[str]]] = None + self._domain: Optional[str] = None self._client = None @property @@ -439,9 +441,30 @@ def delete(self) -> None: apps_api, _, _, _, _ = get_api_client(self.api_token) apps_api.delete_app(self.app_id) - def get_domain(self) -> Optional[str]: + def get_url_and_header_from_metadata(self) -> Optional[Tuple[str, str]]: """ - Get the public domain of the sandbox. + Get the public url of the sandbox and the routing key to use to reach it. + """ + try: + from koyeb.api.exceptions import ApiException, NotFoundException + + from .utils import get_api_client + + _, services_api, _, _, deployments_api = get_api_client(self.api_token) + service_response = services_api.get_service(self.service_id) + service = service_response.service + deployment = deployments_api.get_deployment(service.active_deployment_id or service.latest_deployment_id) + metadata = deployment.deployment.metadata + if metadata and metadata.sandbox: + return metadata.sandbox.public_url, metadata.sandbox.routing_key + return None + + except (NotFoundException, ApiException, Exception): + return None + + def _get_domain(self) -> Optional[str]: + """ + Internal method to get the public domain of the sandbox. Returns the domain name (e.g., "app-name-org.koyeb.app") without protocol or path. To construct the URL, use: f"https://{sandbox.get_domain()}" @@ -468,6 +491,28 @@ def get_domain(self) -> Optional[str]: except (NotFoundException, ApiException, Exception): return None + def get_domain(self) -> Optional[str]: + """ + Get the public domain of the sandbox. + + Returns the domain name (e.g., "app-name-org.koyeb.app") without protocol or path. + To construct the URL, use: f"https://{sandbox.get_domain()}" + + Returns: + Optional[str]: The domain name or None if unavailable + """ + if self._domain is None: + url_data = self.get_url_and_header_from_metadata() + if url_data: + domain = url_data[0].split("://")[1] + self._domain = f"{domain}/r/{url_data[1]}/" + return self._domain + + domain = self._get_domain() + if domain: + self._domain = domain + return self._domain + def get_tcp_proxy_info(self) -> Optional[tuple[str, int]]: """ Get the TCP proxy host and port for the sandbox. @@ -514,20 +559,40 @@ def get_tcp_proxy_info(self) -> Optional[tuple[str, int]]: except (NotFoundException, ApiException, Exception): return None - def _get_sandbox_url(self) -> Optional[str]: + def _get_sandbox_url(self) -> Optional[Tuple[str, Optional[str]]]: """ Internal method to get the sandbox URL for health checks and client initialization. Caches the URL after first retrieval. Returns: - Optional[str]: The sandbox URL or None if unavailable + str: the public url where to reach the sandbox + Optional[str]: the routing key to use to reach the sandbox, if needed """ if self._sandbox_url is None: - domain = self.get_domain() + url_data = self.get_url_and_header_from_metadata() + if url_data: + self._sandbox_url = (f"{url_data[0]}/koyeb-sandbox", url_data[1]) + return self._sandbox_url + + domain = self._get_domain() if domain: - self._sandbox_url = f"https://{domain}/koyeb-sandbox" + self._sandbox_url = (f"https://{domain}/koyeb-sandbox", None) return self._sandbox_url + def _get_conn_info(self) -> Optional[ConnectionInfo]: + """ + Internal method to get the parameters needed to connect to the sandbox. + Caches the info after first retrieval. + + Returns: + Optional[ConnectionInfo]: the information needed to connect to the sandbox + """ + sandbox_url, routing_key = self._get_sandbox_url() + if sandbox_url: + return ConnectionInfo(sandbox_url, routing_key, self.sandbox_secret) + + return None + def _get_client(self) -> "SandboxClient": # type: ignore[name-defined] """ Get or create SandboxClient instance with validation. @@ -539,8 +604,9 @@ def _get_client(self) -> "SandboxClient": # type: ignore[name-defined] SandboxError: If sandbox URL or secret is not available """ if self._client is None: - sandbox_url = self._get_sandbox_url() - self._client = create_sandbox_client(sandbox_url, self.sandbox_secret) + sandbox_url, routing_key = self._get_sandbox_url() + conn_info = ConnectionInfo(sandbox_url, routing_key, self.sandbox_secret) + self._client = create_sandbox_client(conn_info) return self._client def _check_response_error(self, response: Dict, operation: str) -> None: @@ -560,7 +626,7 @@ def _check_response_error(self, response: Dict, operation: str) -> None: def is_healthy(self) -> bool: """Check if sandbox is healthy and ready for operations""" - sandbox_url = self._get_sandbox_url() + sandbox_url, header = self._get_sandbox_url() if not sandbox_url or not self.sandbox_secret: return False @@ -569,7 +635,7 @@ def is_healthy(self) -> bool: try: from .executor_client import SandboxClient - client = SandboxClient(sandbox_url, self.sandbox_secret) + client = SandboxClient(ConnectionInfo(sandbox_url, header, self.sandbox_secret)) health_response = client.health() if isinstance(health_response, dict): status = health_response.get("status", "").lower() diff --git a/koyeb/sandbox/utils.py b/koyeb/sandbox/utils.py index 2f86cc7a..dd23846f 100644 --- a/koyeb/sandbox/utils.py +++ b/koyeb/sandbox/utils.py @@ -432,8 +432,7 @@ async def wrapper(self, *args, **kwargs): def create_sandbox_client( - sandbox_url: Optional[str], - sandbox_secret: Optional[str], + conn_info: Optional['ConnectionInfo'], existing_client: Optional[Any] = None, ) -> Any: """ @@ -443,8 +442,7 @@ def create_sandbox_client( Used by Sandbox, SandboxExecutor, and SandboxFilesystem to avoid duplication. Args: - sandbox_url: The sandbox URL (from _get_sandbox_url() or sandbox._get_sandbox_url()) - sandbox_secret: The sandbox secret + conn_info: The information needed to connect to the sandbox executor API existing_client: Existing client instance to return if not None Returns: @@ -456,14 +454,14 @@ def create_sandbox_client( if existing_client is not None: return existing_client - if not sandbox_url: - raise SandboxError("Unable to get sandbox URL") - if not sandbox_secret: - raise SandboxError("Sandbox secret not available") + try: + conn_info.validate() + except ValueError as e: + raise SandboxError(str(e)) from .executor_client import SandboxClient - return SandboxClient(sandbox_url, sandbox_secret) + return SandboxClient(conn_info) class SandboxError(Exception): diff --git a/spec/openapi.json b/spec/openapi.json index dd660aa7..99c45a90 100644 --- a/spec/openapi.json +++ b/spec/openapi.json @@ -312,56 +312,51 @@ ] } }, - "/v1/usages": { - "get": { - "summary": "Get organization usage", - "operationId": "GetOrganizationUsage", + "/v1/users/{id}": { + "delete": { + "summary": "Delete user", + "operationId": "DeleteUser", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/GetOrganizationUsageReply" + "$ref": "#/definitions/DeleteUserReply" } }, - "default": { - "description": "An unexpected error response.", + "400": { + "description": "Validation error", "schema": { - "$ref": "#/definitions/google.rpc.Status" + "$ref": "#/definitions/ErrorWithFields" } - } - }, - "parameters": [ - { - "name": "starting_time", - "description": "The starting time of the period to get data from", - "in": "query", - "required": false, - "type": "string", - "format": "date-time" }, - { - "name": "ending_time", - "description": "The ending time of the period to get data from", - "in": "query", - "required": false, - "type": "string", - "format": "date-time" - } - ], - "tags": [ - "Usages" - ] - } - }, - "/v1/usages/details": { - "get": { - "summary": "Get organization usage details", - "operationId": "GetOrganizationUsageDetails", - "responses": { - "200": { - "description": "A successful response.", + "401": { + "description": "Returned when the token is not valid.", "schema": { - "$ref": "#/definitions/GetOrganizationUsageDetailsReply" + "$ref": "#/definitions/Error" + } + }, + "403": { + "description": "Returned when the user does not have permission to access the resource.", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "404": { + "description": "Returned when the resource does not exist.", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "500": { + "description": "Returned in case of server error.", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "503": { + "description": "Service is unavailable.", + "schema": { + "$ref": "#/definitions/Error" } }, "default": { @@ -373,64 +368,27 @@ }, "parameters": [ { - "name": "starting_time", - "description": "The starting time of the period to get data from", - "in": "query", - "required": false, - "type": "string", - "format": "date-time" - }, - { - "name": "ending_time", - "description": "The ending time of the period to get data from", - "in": "query", - "required": false, - "type": "string", - "format": "date-time" - }, - { - "name": "limit", - "description": "(Optional) The number of items to return", - "in": "query", - "required": false, - "type": "string" - }, - { - "name": "offset", - "description": "(Optional) The offset in the list of item to return", - "in": "query", - "required": false, - "type": "string" - }, - { - "name": "order", - "description": "(Optional) Sorts the list in the ascending or the descending order", - "in": "query", - "required": false, - "type": "string" - }, - { - "name": "Accept", - "description": "If defined with the value 'text/csv', a csv file is returned", - "in": "header", - "required": false, + "name": "id", + "description": "The id of the user", + "in": "path", + "required": true, "type": "string" } ], "tags": [ - "Usages" + "Users" ] } }, - "/v1/regional_deployment_events": { - "get": { - "summary": "List Regional Deployment events", - "operationId": "ListRegionalDeploymentEvents", + "/v2/users/{id}": { + "delete": { + "summary": "V2 Delete user", + "operationId": "DeleteUserV2", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/ListRegionalDeploymentEventsReply" + "$ref": "#/definitions/DeleteUserReply" } }, "400": { @@ -478,60 +436,26 @@ }, "parameters": [ { - "name": "regional_deployment_id", - "description": "(Optional) Filter on regional deployment id", - "in": "query", - "required": false, - "type": "string" - }, - { - "name": "types", - "description": "(Optional) Filter on regional deployment event types", - "in": "query", - "required": false, - "type": "array", - "items": { - "type": "string" - }, - "collectionFormat": "multi" - }, - { - "name": "limit", - "description": "(Optional) The number of items to return", - "in": "query", - "required": false, - "type": "string" - }, - { - "name": "offset", - "description": "(Optional) The offset in the list of item to return", - "in": "query", - "required": false, - "type": "string" - }, - { - "name": "order", - "description": "(Optional) Sorts the list in the ascending or the descending order", - "in": "query", - "required": false, + "name": "id", + "description": "The id of the user", + "in": "path", + "required": true, "type": "string" } ], "tags": [ - "RegionalDeployments" + "Users" ] } }, - "/v1/regional_deployments": { + "/v1/account/activities": { "get": { - "summary": "List Regional Deployments", - "description": "Experimental: use at your own risk", - "operationId": "ListRegionalDeployments", + "operationId": "GetAccountActivities", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/ListRegionalDeploymentsReply" + "$ref": "#/definitions/ActivityList" } }, "400": { @@ -578,43 +502,33 @@ } }, "parameters": [ - { - "name": "deployment_id", - "description": "(Optional) Filter on deployment id", - "in": "query", - "required": false, - "type": "string" - }, { "name": "limit", - "description": "(Optional) The number of items to return", "in": "query", "required": false, "type": "string" }, { "name": "offset", - "description": "(Optional) The offset in the list of item to return", "in": "query", "required": false, "type": "string" } ], "tags": [ - "RegionalDeployments" + "activity" ] } }, - "/v1/regional_deployments/{id}": { + "/v1/account/idenfy": { "get": { - "summary": "Get Regional Deployment", - "description": "Experimental: use at your own risk", - "operationId": "GetRegionalDeployment", + "summary": "Begin a session with iDenfy, emit an authToken", + "operationId": "GetIdenfyToken", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/GetRegionalDeploymentReply" + "$ref": "#/definitions/GetIdenfyTokenReply" } }, "400": { @@ -660,29 +574,18 @@ } } }, - "parameters": [ - { - "name": "id", - "description": "The id of the regional deployment", - "in": "path", - "required": true, - "type": "string" - } - ], "tags": [ - "RegionalDeployments" + "Profile" ] - } - }, - "/v1/compose": { + }, "post": { - "summary": "Create resources from compose.", - "operationId": "Compose", + "summary": "ClearIdenfyVerificationResult marks the current result for idenfy as\nsuperseded", + "operationId": "ClearIdenfyVerificationResult", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/ComposeReply" + "$ref": "#/definitions/ClearIdenfyVerificationResultReply" } }, "400": { @@ -730,29 +633,27 @@ }, "parameters": [ { - "name": "compose", + "name": "body", "in": "body", "required": true, "schema": { - "$ref": "#/definitions/CreateCompose" + "$ref": "#/definitions/ClearIdenfyVerificationResultRequest" } } ], "tags": [ - "Compose" + "Profile" ] } }, - "/v1/docker-helper/verify": { - "get": { - "summary": "Verify Docker Image", - "description": "Verify if a docker image is reachable", - "operationId": "VerifyDockerImage", + "/v1/account/invite": { + "post": { + "operationId": "CreateInvite", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/VerifyDockerImageReply" + "$ref": "#/definitions/Empty" } }, "400": { @@ -800,34 +701,28 @@ }, "parameters": [ { - "name": "image", - "description": "The full image uri to be verified", - "in": "query", - "required": false, - "type": "string" - }, - { - "name": "secret_id", - "description": "(Optional) the id of the secret to use to authenticate to the registry", - "in": "query", - "required": false, - "type": "string" - } - ], - "tags": [ - "DockerHelper" - ] + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/InviteUserRequest" + } + } + ], + "tags": [ + "invite" + ] } }, - "/v1/deployment/{id}/scaling": { + "/v1/account/login_method": { "get": { - "summary": "Get Deployment Scaling", - "operationId": "GetDeploymentScaling", + "summary": "Get the login method for an email address", + "operationId": "LoginMethod", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/GetDeploymentScalingReply" + "$ref": "#/definitions/LoginMethodReply" } }, "400": { @@ -875,41 +770,26 @@ }, "parameters": [ { - "name": "id", - "in": "path", - "required": true, - "type": "string" - }, - { - "name": "region", - "description": "(Optional) Filter on region", + "name": "email", "in": "query", "required": false, "type": "string" - }, - { - "name": "replica_index", - "description": "(Optional) Filter on replica_index", - "in": "query", - "required": false, - "type": "integer", - "format": "int64" } ], "tags": [ - "Deployments" + "Profile" ] } }, - "/v1/deployment_events": { + "/v1/account/oauth": { "get": { - "summary": "List Deployment events", - "operationId": "ListDeploymentEvents", + "summary": "Get OAuth Providers", + "operationId": "GetOAuthOptions", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/ListDeploymentEventsReply" + "$ref": "#/definitions/GetOAuthOptionsReply" } }, "400": { @@ -957,59 +837,38 @@ }, "parameters": [ { - "name": "deployment_id", - "description": "(Optional) Filter on deployment id", - "in": "query", - "required": false, - "type": "string" - }, - { - "name": "types", - "description": "(Optional) Filter on deployment event types", - "in": "query", - "required": false, - "type": "array", - "items": { - "type": "string" - }, - "collectionFormat": "multi" - }, - { - "name": "limit", - "description": "(Optional) The number of items to return", - "in": "query", - "required": false, - "type": "string" - }, - { - "name": "offset", - "description": "(Optional) The offset in the list of item to return", + "name": "action", + "description": "Which authentication flow is being initiated", "in": "query", "required": false, - "type": "string" + "type": "string", + "enum": [ + "signin", + "signup", + "register" + ], + "default": "signin" }, { - "name": "order", - "description": "(Optional) Sorts the list in the ascending or the descending order", + "name": "metadata", + "description": "A small (limited to 400 characters) string of arbitrary metadata which will\nbe encoded in the state", "in": "query", "required": false, "type": "string" } ], "tags": [ - "Deployments" + "Profile" ] - } - }, - "/v1/deployments": { - "get": { - "summary": "List Deployments", - "operationId": "ListDeployments", + }, + "post": { + "summary": "Authenticate using OAuth", + "operationId": "OAuthCallback", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/ListDeploymentsReply" + "$ref": "#/definitions/OAuthCallbackReply" } }, "400": { @@ -1057,77 +916,35 @@ }, "parameters": [ { - "name": "app_id", - "description": "(Optional) Filter on application id", - "in": "query", - "required": false, - "type": "string" - }, - { - "name": "service_id", - "description": "(Optional) Filter on service id", - "in": "query", - "required": false, - "type": "string" - }, - { - "name": "limit", - "description": "(Optional) The number of items to return", - "in": "query", - "required": false, - "type": "string" + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/OAuthCallbackRequest" + } }, { - "name": "offset", - "description": "(Optional) The offset in the list of item to return", - "in": "query", + "name": "seon-fp", + "description": "Seon Fingerprint", + "in": "header", "required": false, "type": "string" - }, - { - "name": "statuses", - "description": "(Optional) Filter on statuses", - "in": "query", - "required": false, - "type": "array", - "items": { - "type": "string", - "enum": [ - "PENDING", - "PROVISIONING", - "SCHEDULED", - "CANCELING", - "CANCELED", - "ALLOCATING", - "STARTING", - "HEALTHY", - "DEGRADED", - "UNHEALTHY", - "STOPPING", - "STOPPED", - "ERRORING", - "ERROR", - "STASHED", - "SLEEPING" - ] - }, - "collectionFormat": "multi" } ], "tags": [ - "Deployments" + "Profile" ] } }, - "/v1/deployments/{id}": { + "/v1/account/organization": { "get": { - "summary": "Get Deployment", - "operationId": "GetDeployment", + "summary": "Get Current Organization", + "operationId": "GetCurrentOrganization", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/GetDeploymentReply" + "$ref": "#/definitions/GetOrganizationReply" } }, "400": { @@ -1173,30 +990,20 @@ } } }, - "parameters": [ - { - "name": "id", - "description": "The id of the deployment", - "in": "path", - "required": true, - "type": "string" - } - ], "tags": [ - "Deployments" + "Profile" ] } }, - "/v1/deployments/{id}/cancel": { - "post": { - "summary": "Cancel Deployment", - "description": "Deployment cancellation is allowed for the following status:\n - pending\n - provisioning\n - scheduled", - "operationId": "CancelDeployment", + "/v1/account/organization_invitations": { + "get": { + "summary": "List User Organization Invitations", + "operationId": "ListUserOrganizationInvitations", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/CancelDeploymentReply" + "$ref": "#/definitions/ListUserOrganizationInvitationsReply" } }, "400": { @@ -1244,27 +1051,52 @@ }, "parameters": [ { - "name": "id", - "description": "The id of the deployment to cancel.", - "in": "path", - "required": true, + "name": "limit", + "description": "(Optional) The number of items to return", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "offset", + "description": "(Optional) The offset in the list of item to return", + "in": "query", + "required": false, "type": "string" + }, + { + "name": "statuses", + "description": "(Optional) Filter on organization invitation statuses", + "in": "query", + "required": false, + "type": "array", + "items": { + "type": "string", + "enum": [ + "INVALID", + "PENDING", + "ACCEPTED", + "REFUSED", + "EXPIRED" + ] + }, + "collectionFormat": "multi" } ], "tags": [ - "Deployments" + "Profile" ] } }, - "/v1/provisioning/{deployment_id}/status/{stage}/{attempt}": { - "post": { - "summary": "Create an attempt for a stage", - "operationId": "CreateStageAttempt", + "/v1/account/organization_invitations/{id}": { + "get": { + "summary": "Get User Organization Invitation", + "operationId": "GetUserOrganizationInvitation", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/CreateStageAttemptReply" + "$ref": "#/definitions/GetUserOrganizationInvitationReply" } }, "400": { @@ -1312,68 +1144,27 @@ }, "parameters": [ { - "name": "deployment_id", - "in": "path", - "required": true, - "type": "string" - }, - { - "name": "stage", - "in": "path", - "required": true, - "type": "string" - }, - { - "name": "attempt", + "name": "id", + "description": "The id of the organization invitation to get", "in": "path", "required": true, "type": "string" - }, - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "secret": { - "type": "string" - }, - "status": { - "$ref": "#/definitions/DeploymentProvisioningInfo.Stage.Status" - }, - "started_at": { - "type": "string", - "format": "date-time" - }, - "messages": { - "type": "array", - "items": { - "type": "string" - } - }, - "steps": { - "type": "array", - "items": { - "type": "string" - } - } - } - } } ], "tags": [ - "Provisioning" + "Profile" ] - }, - "patch": { - "summary": "Declare stage progress", - "operationId": "DeclareStageProgress", + } + }, + "/v1/account/organization_invitations/{id}/accept": { + "post": { + "summary": "Accept Organization Invitation", + "operationId": "AcceptOrganizationInvitation", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/DeclareStageProgressReply" + "$ref": "#/definitions/AcceptOrganizationInvitationReply" } }, "400": { @@ -1421,19 +1212,8 @@ }, "parameters": [ { - "name": "deployment_id", - "in": "path", - "required": true, - "type": "string" - }, - { - "name": "stage", - "in": "path", - "required": true, - "type": "string" - }, - { - "name": "attempt", + "name": "id", + "description": "The id of the organization invitation to accept", "in": "path", "required": true, "type": "string" @@ -1443,51 +1223,24 @@ "in": "body", "required": true, "schema": { - "type": "object", - "properties": { - "secret": { - "type": "string" - }, - "status": { - "$ref": "#/definitions/DeploymentProvisioningInfo.Stage.Status" - }, - "finished_at": { - "type": "string", - "format": "date-time" - }, - "messages": { - "type": "array", - "items": { - "type": "string" - } - }, - "image_pushed": { - "type": "boolean" - }, - "internal_failure": { - "type": "boolean" - }, - "retryable_failure": { - "type": "boolean" - } - } + "type": "object" } } ], "tags": [ - "Provisioning" + "Profile" ] } }, - "/v1/provisioning/{deployment_id}/status/{stage}/{attempt}/{step}": { - "patch": { - "summary": "Declare step progress", - "operationId": "DeclareStepProgress", + "/v1/account/organization_invitations/{id}/decline": { + "post": { + "summary": "Decline Organization Invitation", + "operationId": "DeclineOrganizationInvitation", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/DeclareStepProgressReply" + "$ref": "#/definitions/DeclineOrganizationInvitationReply" } }, "400": { @@ -1535,25 +1288,8 @@ }, "parameters": [ { - "name": "deployment_id", - "in": "path", - "required": true, - "type": "string" - }, - { - "name": "stage", - "in": "path", - "required": true, - "type": "string" - }, - { - "name": "attempt", - "in": "path", - "required": true, - "type": "string" - }, - { - "name": "step", + "name": "id", + "description": "The id of the organization invitation to decline", "in": "path", "required": true, "type": "string" @@ -1563,46 +1299,25 @@ "in": "body", "required": true, "schema": { - "type": "object", - "properties": { - "secret": { - "type": "string" - }, - "status": { - "$ref": "#/definitions/DeploymentProvisioningInfo.Stage.Status" - }, - "started_at": { - "type": "string", - "format": "date-time" - }, - "finished_at": { - "type": "string", - "format": "date-time" - }, - "messages": { - "type": "array", - "items": { - "type": "string" - } - } - } + "type": "object" } } ], "tags": [ - "Provisioning" + "Profile" ] } }, - "/v1/volume_events": { + "/v1/account/organizations": { "get": { - "summary": "List Persistent Volume events", - "operationId": "ListPersistentVolumeEvents", + "summary": "List User Organizations", + "description": "List all organizations that the current user is a member of.", + "operationId": "ListUserOrganizations", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/ListPersistentVolumeEventsReply" + "$ref": "#/definitions/ListUserOrganizationsReply" } }, "400": { @@ -1650,59 +1365,68 @@ }, "parameters": [ { - "name": "persistent_volume_id", - "description": "(Optional) Filter on persistent volume id", + "name": "limit", + "description": "(Optional) Define pagination limit", "in": "query", "required": false, "type": "string" }, { - "name": "types", - "description": "(Optional) Filter on persistent volume event types", + "name": "offset", + "description": "(Optional) Define pagination offset", "in": "query", "required": false, - "type": "array", - "items": { - "type": "string" - }, - "collectionFormat": "multi" + "type": "string" }, { - "name": "limit", - "description": "(Optional) The number of items to return", + "name": "order", + "description": "(Optional) Sorts the list in the ascending or the descending order", "in": "query", "required": false, "type": "string" }, { - "name": "offset", - "description": "(Optional) The offset in the list of item to return", + "name": "search", + "description": "(Optional) Fuzzy case-insensitive search based on organization name or\norganization id", "in": "query", "required": false, "type": "string" }, { - "name": "order", - "description": "(Optional) Sorts the list in the ascending or the descending order", + "name": "statuses", + "description": "(Optional) Only return organizations which status match one in the list", "in": "query", "required": false, - "type": "string" + "type": "array", + "items": { + "type": "string", + "enum": [ + "WARNING", + "LOCKED", + "ACTIVE", + "DEACTIVATING", + "DEACTIVATED", + "DELETING", + "DELETED" + ] + }, + "collectionFormat": "multi" } ], "tags": [ - "PersistentVolumes" + "Profile" ] } }, - "/v1/volumes": { + "/v1/account/profile": { "get": { - "summary": "List all PersistentVolumes", - "operationId": "ListPersistentVolumes", + "summary": "Get Current User", + "operationId": "GetCurrentUser", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/ListPersistentVolumesReply" + "$ref": "#/definitions/UserReply" } }, "400": { @@ -1750,53 +1474,25 @@ }, "parameters": [ { - "name": "limit", - "description": "(Optional) The number of items to return", - "in": "query", - "required": false, - "type": "string" - }, - { - "name": "offset", - "description": "(Optional) The offset in the list of item to return", - "in": "query", - "required": false, - "type": "string" - }, - { - "name": "service_id", - "description": "(Optional) A filter for the service id", - "in": "query", - "required": false, - "type": "string" - }, - { - "name": "region", - "description": "(Optional) A filter for the region", - "in": "query", - "required": false, - "type": "string" - }, - { - "name": "name", - "description": "(Optional) A filter for the name", - "in": "query", + "name": "seon-fp", + "description": "Seon Fingerprint", + "in": "header", "required": false, "type": "string" } ], "tags": [ - "PersistentVolumes" + "Profile" ] }, - "post": { - "summary": "Create a PersistentVolume", - "operationId": "CreatePersistentVolume", + "put": { + "summary": "Update User", + "operationId": "UpdateUser", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/CreatePersistentVolumeReply" + "$ref": "#/definitions/UserReply" } }, "400": { @@ -1844,28 +1540,32 @@ }, "parameters": [ { - "name": "body", + "name": "user", "in": "body", "required": true, "schema": { - "$ref": "#/definitions/CreatePersistentVolumeRequest" + "$ref": "#/definitions/UpdateUserRequest.UserUpdateBody" } - } - ], + }, + { + "name": "update_mask", + "in": "query", + "required": false, + "type": "string" + } + ], "tags": [ - "PersistentVolumes" + "Profile" ] - } - }, - "/v1/volumes/{id}": { - "get": { - "summary": "Get a PersistentVolume", - "operationId": "GetPersistentVolume", + }, + "patch": { + "summary": "Update User", + "operationId": "UpdateUser2", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/GetPersistentVolumeReply" + "$ref": "#/definitions/UserReply" } }, "400": { @@ -1913,24 +1613,34 @@ }, "parameters": [ { - "name": "id", - "in": "path", + "name": "user", + "in": "body", "required": true, + "schema": { + "$ref": "#/definitions/UpdateUserRequest.UserUpdateBody" + } + }, + { + "name": "update_mask", + "in": "query", + "required": false, "type": "string" } ], "tags": [ - "PersistentVolumes" + "Profile" ] - }, - "delete": { - "summary": "Delete a PersistentVolume", - "operationId": "DeletePersistentVolume", + } + }, + "/v1/account/resend_validation": { + "post": { + "summary": "Resend Email Verification", + "operationId": "ResendEmailValidation", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/DeletePersistentVolumeReply" + "$ref": "#/definitions/ResendEmailValidationReply" } }, "400": { @@ -1978,24 +1688,28 @@ }, "parameters": [ { - "name": "id", - "in": "path", + "name": "body", + "in": "body", "required": true, - "type": "string" + "schema": { + "$ref": "#/definitions/ResendEmailValidationRequest" + } } ], "tags": [ - "PersistentVolumes" + "Profile" ] - }, + } + }, + "/v1/account/reset_password": { "post": { - "summary": "Update a PersistentVolume", - "operationId": "UpdatePersistentVolume", + "summary": "Reset Password", + "operationId": "ResetPassword", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/UpdatePersistentVolumeReply" + "$ref": "#/definitions/ResetPasswordReply" } }, "400": { @@ -2042,46 +1756,28 @@ } }, "parameters": [ - { - "name": "id", - "in": "path", - "required": true, - "type": "string" - }, { "name": "body", "in": "body", "required": true, "schema": { - "type": "object", - "properties": { - "name": { - "type": "string", - "title": "(Optional) change the name of the volume" - }, - "max_size": { - "type": "integer", - "format": "int64", - "title": "(Optional) increase the volume size (in Gigabyte / GB)" - } - } + "$ref": "#/definitions/ResetPasswordRequest" } } ], "tags": [ - "PersistentVolumes" + "Profile" ] } }, - "/v1/domains": { + "/v1/account/settings": { "get": { - "summary": "List Domains", - "operationId": "ListDomains", + "operationId": "GetUserSettings", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/ListDomainsReply" + "$ref": "#/definitions/GetUserSettingsReply" } }, "400": { @@ -2127,85 +1823,17 @@ } } }, - "parameters": [ - { - "name": "limit", - "description": "(Optional) The number of items to return", - "in": "query", - "required": false, - "type": "string" - }, - { - "name": "offset", - "description": "(Optional) The offset in the list of item to return", - "in": "query", - "required": false, - "type": "string" - }, - { - "name": "types", - "description": "(Optional) A filter for types\n\n - AUTOASSIGNED: Domain like -.koyeb.app", - "in": "query", - "required": false, - "type": "array", - "items": { - "type": "string", - "enum": [ - "AUTOASSIGNED", - "CUSTOM" - ] - }, - "collectionFormat": "multi" - }, - { - "name": "statuses", - "description": "(Optional) A filter for statuses", - "in": "query", - "required": false, - "type": "array", - "items": { - "type": "string", - "enum": [ - "PENDING", - "ACTIVE", - "ERROR", - "DELETING", - "DELETED" - ] - }, - "collectionFormat": "multi" - }, - { - "name": "app_ids", - "description": "(Optional) A filter for apps", - "in": "query", - "required": false, - "type": "array", - "items": { - "type": "string" - }, - "collectionFormat": "multi" - }, - { - "name": "name", - "description": "(Optional) A filter for name", - "in": "query", - "required": false, - "type": "string" - } - ], "tags": [ - "Domains" + "Profile" ] }, - "post": { - "summary": "Create Domain", - "operationId": "CreateDomain", + "patch": { + "operationId": "UpdateUserSettings", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/CreateDomainReply" + "$ref": "#/definitions/UpdateUserSettingsReply" } }, "400": { @@ -2253,28 +1881,28 @@ }, "parameters": [ { - "name": "domain", + "name": "body", "in": "body", "required": true, "schema": { - "$ref": "#/definitions/CreateDomain" + "$ref": "#/definitions/UpdateUserSettingsRequest" } } ], "tags": [ - "Domains" + "Profile" ] } }, - "/v1/domains/{id}": { - "get": { - "summary": "Get Domain", - "operationId": "GetDomain", + "/v1/account/signup": { + "post": { + "summary": "Signup", + "operationId": "Signup", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/GetDomainReply" + "$ref": "#/definitions/LoginReply" } }, "400": { @@ -2322,24 +1950,36 @@ }, "parameters": [ { - "name": "id", - "in": "path", + "name": "body", + "description": "Create new account", + "in": "body", "required": true, + "schema": { + "$ref": "#/definitions/CreateAccountRequest" + } + }, + { + "name": "seon-fp", + "description": "Seon Fingerprint", + "in": "header", + "required": false, "type": "string" } ], "tags": [ - "Domains" + "Profile" ] - }, - "delete": { - "summary": "Delete Domain", - "operationId": "DeleteDomain", + } + }, + "/v1/account/update_password": { + "post": { + "summary": "Update Password", + "operationId": "UpdatePassword", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/DeleteDomainReply" + "$ref": "#/definitions/LoginReply" } }, "400": { @@ -2387,24 +2027,35 @@ }, "parameters": [ { - "name": "id", - "in": "path", + "name": "body", + "in": "body", "required": true, + "schema": { + "$ref": "#/definitions/UpdatePasswordRequest" + } + }, + { + "name": "seon-fp", + "description": "Seon Fingerprint", + "in": "header", + "required": false, "type": "string" } ], "tags": [ - "Domains" + "Profile" ] - }, - "patch": { - "summary": "Update Domain", - "operationId": "UpdateDomain", + } + }, + "/v1/account/validate/{id}": { + "post": { + "summary": "Validate", + "operationId": "Validate", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/UpdateDomainReply" + "$ref": "#/definitions/LoginReply" } }, "400": { @@ -2458,41 +2109,28 @@ "type": "string" }, { - "name": "domain", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/UpdateDomain" - } - }, - { - "name": "update_mask", - "in": "query", + "name": "seon-fp", + "description": "Seon Fingerprint", + "in": "header", "required": false, "type": "string" - }, - { - "name": "dry_run", - "description": "If set, run validation and check that the domain is available.", - "in": "query", - "required": false, - "type": "boolean" } ], "tags": [ - "Domains" + "Profile" ] } }, - "/v1/domains/{id}/refresh": { - "post": { - "summary": "Refresh Domain Status", - "operationId": "RefreshDomainStatus", + "/v1/billing/has_unpaid_invoices": { + "get": { + "summary": "Experimental: Has unpaid invoices", + "description": "WARNING: Please don't use the following method.\nKoyeb doesn't guarantee backwards compatible breaking change and reserve\nthe right to completely drop it without notice. USE AT YOUR OWN RISK.", + "operationId": "HasUnpaidInvoices", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/RefreshDomainStatusReply" + "$ref": "#/definitions/HasUnpaidInvoicesReply" } }, "400": { @@ -2538,28 +2176,19 @@ } } }, - "parameters": [ - { - "name": "id", - "in": "path", - "required": true, - "type": "string" - } - ], "tags": [ - "Domains" + "billing" ] } }, - "/v1/instance_events": { + "/v1/billing/manage": { "get": { - "summary": "List Instance events", - "operationId": "ListInstanceEvents", + "operationId": "Manage", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/ListInstanceEventsReply" + "$ref": "#/definitions/ManageReply" } }, "400": { @@ -2605,65 +2234,21 @@ } } }, - "parameters": [ - { - "name": "instance_ids", - "description": "(Optional) Filter on list of instance id", - "in": "query", - "required": false, - "type": "array", - "items": { - "type": "string" - }, - "collectionFormat": "multi" - }, - { - "name": "types", - "description": "(Optional) Filter on instance event types", - "in": "query", - "required": false, - "type": "array", - "items": { - "type": "string" - }, - "collectionFormat": "multi" - }, - { - "name": "limit", - "description": "(Optional) The number of items to return", - "in": "query", - "required": false, - "type": "string" - }, - { - "name": "offset", - "description": "(Optional) The offset in the list of item to return", - "in": "query", - "required": false, - "type": "string" - }, - { - "name": "order", - "description": "(Optional) Sorts the list in the ascending or the descending order", - "in": "query", - "required": false, - "type": "string" - } - ], "tags": [ - "Instances" + "billing" ] } }, - "/v1/instances": { + "/v1/billing/next_invoice": { "get": { - "summary": "List Instances", - "operationId": "ListInstances", + "summary": "Experimental: Fetch next invoice", + "description": "WARNING: Please don't use the following method.\nKoyeb doesn't guarantee backwards compatible breaking change and reserve\nthe right to completely drop it without notice. USE AT YOUR OWN RISK.", + "operationId": "NextInvoice", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/ListInstancesReply" + "$ref": "#/definitions/NextInvoiceReply" } }, "400": { @@ -2709,122 +2294,20 @@ } } }, - "parameters": [ - { - "name": "app_id", - "description": "(Optional) Filter on application id", - "in": "query", - "required": false, - "type": "string" - }, - { - "name": "service_id", - "description": "(Optional) Filter on service id", - "in": "query", - "required": false, - "type": "string" - }, - { - "name": "deployment_id", - "description": "(Optional) Filter on deployment id", - "in": "query", - "required": false, - "type": "string" - }, - { - "name": "regional_deployment_id", - "description": "(Optional) Filter on regional deployment id", - "in": "query", - "required": false, - "type": "string" - }, - { - "name": "allocation_id", - "description": "(Optional) Filter on allocation id", - "in": "query", - "required": false, - "type": "string" - }, - { - "name": "replica_index", - "description": "(Optional) Filter on replica index", - "in": "query", - "required": false, - "type": "string" - }, - { - "name": "statuses", - "description": "(Optional) Filter on instance statuses", - "in": "query", - "required": false, - "type": "array", - "items": { - "type": "string", - "enum": [ - "ALLOCATING", - "STARTING", - "HEALTHY", - "UNHEALTHY", - "STOPPING", - "STOPPED", - "ERROR", - "SLEEPING" - ] - }, - "collectionFormat": "multi" - }, - { - "name": "limit", - "description": "(Optional) The number of items to return", - "in": "query", - "required": false, - "type": "string" - }, - { - "name": "offset", - "description": "(Optional) The offset in the list of item to return", - "in": "query", - "required": false, - "type": "string" - }, - { - "name": "order", - "description": "(Optional) Sorts the list in the ascending or the descending order", - "in": "query", - "required": false, - "type": "string" - }, - { - "name": "starting_time", - "description": "(Optional) The starting time of the period of running instance", - "in": "query", - "required": false, - "type": "string", - "format": "date-time" - }, - { - "name": "ending_time", - "description": "(Optional) The ending time of the period of running instance", - "in": "query", - "required": false, - "type": "string", - "format": "date-time" - } - ], "tags": [ - "Instances" + "billing" ] } }, - "/v1/instances/{id}": { + "/v1/github/installation": { "get": { - "summary": "Get Instance", - "operationId": "GetInstance", + "summary": "Fetch Github Installation configuration", + "operationId": "GetGithubInstallation", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/GetInstanceReply" + "$ref": "#/definitions/GetGithubInstallationReply" } }, "400": { @@ -2870,30 +2353,18 @@ } } }, - "parameters": [ - { - "name": "id", - "description": "The id of the instance", - "in": "path", - "required": true, - "type": "string" - } - ], "tags": [ - "Instances" + "organization" ] - } - }, - "/v1/archives": { + }, "post": { - "summary": "Create Archive", - "description": "Create a signed URL to upload an archive.", - "operationId": "CreateArchive", + "summary": "Start Github Installation", + "operationId": "GithubInstallation", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/CreateArchiveReply" + "$ref": "#/definitions/GithubInstallationReply" } }, "400": { @@ -2941,28 +2412,28 @@ }, "parameters": [ { - "name": "archive", + "name": "body", "in": "body", "required": true, "schema": { - "$ref": "#/definitions/CreateArchive" + "$ref": "#/definitions/GithubInstallationRequest" } } ], "tags": [ - "Archives" + "organization" ] } }, - "/v1/app_events": { - "get": { - "summary": "List App events", - "operationId": "ListAppEvents", + "/v1/organizations": { + "post": { + "summary": "Create Organization", + "operationId": "CreateOrganization", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/ListAppEventsReply" + "$ref": "#/definitions/CreateOrganizationReply" } }, "400": { @@ -3010,59 +2481,28 @@ }, "parameters": [ { - "name": "app_id", - "description": "(Optional) Filter on app id", - "in": "query", - "required": false, - "type": "string" - }, - { - "name": "types", - "description": "(Optional) Filter on app event types", - "in": "query", - "required": false, - "type": "array", - "items": { - "type": "string" - }, - "collectionFormat": "multi" - }, - { - "name": "limit", - "description": "(Optional) The number of items to return", - "in": "query", - "required": false, - "type": "string" - }, - { - "name": "offset", - "description": "(Optional) The offset in the list of item to return", - "in": "query", - "required": false, - "type": "string" - }, - { - "name": "order", - "description": "(Optional) Sorts the list in the ascending or the descending order", - "in": "query", - "required": false, - "type": "string" + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/CreateOrganizationRequest" + } } ], "tags": [ - "Apps" + "organization" ] } }, - "/v1/apps": { + "/v1/organizations/{id}": { "get": { - "summary": "List App", - "operationId": "ListApps", + "summary": "Get Organization", + "operationId": "GetOrganization", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/ListAppsReply" + "$ref": "#/definitions/GetOrganizationReply" } }, "400": { @@ -3110,39 +2550,24 @@ }, "parameters": [ { - "name": "limit", - "description": "(Optional) The number of items to return", - "in": "query", - "required": false, - "type": "string" - }, - { - "name": "offset", - "description": "(Optional) The offset in the list of item to return", - "in": "query", - "required": false, - "type": "string" - }, - { - "name": "name", - "description": "(Optional) A filter for name", - "in": "query", - "required": false, + "name": "id", + "in": "path", + "required": true, "type": "string" } ], "tags": [ - "Apps" + "organization" ] }, - "post": { - "summary": "Create App", - "operationId": "CreateApp", + "delete": { + "summary": "Delete an Organization", + "operationId": "DeleteOrganization", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/CreateAppReply" + "$ref": "#/definitions/DeleteOrganizationReply" } }, "400": { @@ -3190,28 +2615,24 @@ }, "parameters": [ { - "name": "app", - "in": "body", + "name": "id", + "in": "path", "required": true, - "schema": { - "$ref": "#/definitions/CreateApp" - } + "type": "string" } ], "tags": [ - "Apps" + "organization" ] - } - }, - "/v1/apps/{id}": { - "get": { - "summary": "Get App", - "operationId": "GetApp", + }, + "put": { + "summary": "Update Organization", + "operationId": "UpdateOrganization", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/GetAppReply" + "$ref": "#/definitions/UpdateOrganizationReply" } }, "400": { @@ -3260,25 +2681,37 @@ "parameters": [ { "name": "id", - "description": "The id of the App", "in": "path", "required": true, "type": "string" + }, + { + "name": "organization", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/Organization" + } + }, + { + "name": "update_mask", + "in": "query", + "required": false, + "type": "string" } ], "tags": [ - "Apps" + "organization" ] }, - "delete": { - "summary": "Delete App", - "description": "App deletion is allowed for all status.", - "operationId": "DeleteApp", + "patch": { + "summary": "Update Organization", + "operationId": "UpdateOrganization2", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/DeleteAppReply" + "$ref": "#/definitions/UpdateOrganizationReply" } }, "400": { @@ -3327,24 +2760,40 @@ "parameters": [ { "name": "id", - "description": "The id of the App to delete", "in": "path", "required": true, "type": "string" + }, + { + "name": "organization", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/Organization" + } + }, + { + "name": "update_mask", + "in": "query", + "required": false, + "type": "string" } ], "tags": [ - "Apps" + "organization" ] - }, - "put": { - "summary": "Update App", - "operationId": "UpdateApp", + } + }, + "/v1/organizations/{id}/access_token": { + "post": { + "summary": "CreateAccessToken", + "description": "CreateAccessToken creates a short-lived access token in the scope of the\nspecified organization, provided the user making the request is part of\nsaid organization.\n\nIt's possible to specify a validity for the token, which defaults to 1h\nand must be no more than 24h. The format is `s`, where ``\nis a floating point in seconds (so `123.456789012s` means 123 seconds and\n456789012 nanoseconds). See:\nhttps://protobuf.dev/reference/php/api-docs/Google/Protobuf/Duration.html.", + "operationId": "CreateAccessToken", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/UpdateAppReply" + "$ref": "#/definitions/CreateAccessTokenReply" } }, "400": { @@ -3393,38 +2842,40 @@ "parameters": [ { "name": "id", - "description": "The id of the app to update.", + "description": "Organization id for ephemeral credential", "in": "path", "required": true, "type": "string" }, { - "name": "app", + "name": "body", "in": "body", "required": true, "schema": { - "$ref": "#/definitions/UpdateApp" + "type": "object", + "properties": { + "validity": { + "type": "string", + "title": "Validity of the credential" + } + } } - }, - { - "name": "update_mask", - "in": "query", - "required": false, - "type": "string" } ], "tags": [ - "Apps" + "organization" ] - }, - "patch": { - "summary": "Update App", - "operationId": "UpdateApp2", + } + }, + "/v1/organizations/{id}/deactivate": { + "post": { + "summary": "Deactivate an Organization", + "operationId": "DeactivateOrganization", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/UpdateAppReply" + "$ref": "#/definitions/DeactivateOrganizationReply" } }, "400": { @@ -3473,41 +2924,39 @@ "parameters": [ { "name": "id", - "description": "The id of the app to update.", "in": "path", "required": true, "type": "string" }, { - "name": "app", + "name": "body", "in": "body", "required": true, "schema": { - "$ref": "#/definitions/UpdateApp" + "type": "object", + "properties": { + "skip_confirmation": { + "type": "boolean", + "description": "if set to true, skip_confirmation will directly start the deactivation\nprocess, without sending a confirmation email beforehand." + } + } } - }, - { - "name": "update_mask", - "in": "query", - "required": false, - "type": "string" } ], "tags": [ - "Apps" + "organization" ] } }, - "/v1/apps/{id}/pause": { - "post": { - "summary": "Pause App", - "description": "App pause action is allowed for the following status:\n - starting\n - healthy\n - degraded\n - unhealthy\n - resuming", - "operationId": "PauseApp", + "/v1/organizations/{id}/default_project": { + "put": { + "summary": "Update Organization's default project", + "operationId": "UpdateOrganizationDefaultProject", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/PauseAppReply" + "$ref": "#/definitions/UpdateOrganizationDefaultProjectReply" } }, "400": { @@ -3556,27 +3005,38 @@ "parameters": [ { "name": "id", - "description": "The id of the app to pause.", "in": "path", "required": true, "type": "string" + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object", + "properties": { + "default_project_id": { + "type": "string" + } + } + } } ], "tags": [ - "Apps" + "organization" ] } }, - "/v1/apps/{id}/resume": { - "post": { - "summary": "Resume App", - "description": "App resume action is allowed for the following status:\n - paused", - "operationId": "ResumeApp", + "/v1/organizations/{id}/name": { + "put": { + "summary": "Update Organization Name", + "operationId": "UpdateOrganizationName", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/ResumeAppReply" + "$ref": "#/definitions/UpdateOrganizationNameReply" } }, "400": { @@ -3625,26 +3085,38 @@ "parameters": [ { "name": "id", - "description": "The id of the app to resume.", "in": "path", "required": true, "type": "string" + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string" + } + } + } } ], "tags": [ - "Apps" + "organization" ] } }, - "/v1/quotas/capacity": { + "/v1/organizations/{id}/plan": { "post": { - "summary": "DEPRECATED: Review Organization Capacity", - "operationId": "ReviewOrganizationCapacity", + "summary": "Update Organization plan", + "operationId": "UpdateOrganizationPlan", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/ReviewOrganizationCapacityReply" + "$ref": "#/definitions/UpdateOrganizationPlanReply" } }, "400": { @@ -3691,29 +3163,43 @@ } }, "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "type": "string" + }, { "name": "body", "in": "body", "required": true, "schema": { - "$ref": "#/definitions/ReviewOrganizationCapacityRequest" + "type": "object", + "properties": { + "plan": { + "$ref": "#/definitions/Plan" + }, + "coupon_code": { + "type": "string" + } + } } } ], "tags": [ - "Quotas" + "organization" ] } }, - "/v1/service_events": { - "get": { - "summary": "List Service events", - "operationId": "ListServiceEvents", + "/v1/organizations/{id}/reactivate": { + "post": { + "summary": "Reactivate an Organization", + "operationId": "ReactivateOrganization", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/ListServiceEventsReply" + "$ref": "#/definitions/ReactivateOrganizationReply" } }, "400": { @@ -3761,59 +3247,34 @@ }, "parameters": [ { - "name": "service_id", - "description": "(Optional) Filter on service id", - "in": "query", - "required": false, - "type": "string" - }, - { - "name": "types", - "description": "(Optional) Filter on service event types", - "in": "query", - "required": false, - "type": "array", - "items": { - "type": "string" - }, - "collectionFormat": "multi" - }, - { - "name": "limit", - "description": "(Optional) The number of items to return", - "in": "query", - "required": false, - "type": "string" - }, - { - "name": "offset", - "description": "(Optional) The offset in the list of item to return", - "in": "query", - "required": false, + "name": "id", + "in": "path", + "required": true, "type": "string" }, { - "name": "order", - "description": "(Optional) Sorts the list in the ascending or the descending order", - "in": "query", - "required": false, - "type": "string" + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object" + } } ], "tags": [ - "Services" + "organization" ] } }, - "/v1/services": { - "get": { - "summary": "List Services", - "operationId": "ListServices", + "/v1/organizations/{id}/signup_qualification": { + "post": { + "summary": "Upsert Organization's signup qualification", + "operationId": "UpsertSignupQualification", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/ListServicesReply" + "$ref": "#/definitions/UpsertSignupQualificationReply" } }, "400": { @@ -3861,86 +3322,39 @@ }, "parameters": [ { - "name": "app_id", - "description": "(Optional) The id of the app", - "in": "query", - "required": false, - "type": "string" - }, - { - "name": "limit", - "description": "(Optional) The number of items to return", - "in": "query", - "required": false, - "type": "string" - }, - { - "name": "offset", - "description": "(Optional) The offset in the list of item to return", - "in": "query", - "required": false, - "type": "string" - }, - { - "name": "name", - "description": "(Optional) A filter for name", - "in": "query", - "required": false, + "name": "id", + "in": "path", + "required": true, "type": "string" }, { - "name": "types", - "description": "(Optional) Filter on service types", - "in": "query", - "required": false, - "type": "array", - "items": { - "type": "string", - "enum": [ - "INVALID_TYPE", - "WEB", - "WORKER", - "DATABASE", - "SANDBOX" - ] - }, - "collectionFormat": "multi" - }, - { - "name": "statuses", - "description": "(Optional) Filter on service statuses", - "in": "query", - "required": false, - "type": "array", - "items": { - "type": "string", - "enum": [ - "STARTING", - "HEALTHY", - "DEGRADED", - "UNHEALTHY", - "DELETING", - "DELETED", - "PAUSING", - "PAUSED", - "RESUMING" - ] - }, - "collectionFormat": "multi" + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object", + "properties": { + "signup_qualification": { + "type": "object" + } + } + } } ], "tags": [ - "Services" + "organization" ] - }, + } + }, + "/v1/organizations/{id}/switch": { "post": { - "summary": "Create Service", - "operationId": "CreateService", + "summary": "Switch Organization context", + "operationId": "SwitchOrganization", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/CreateServiceReply" + "$ref": "#/definitions/LoginReply" } }, "400": { @@ -3988,36 +3402,41 @@ }, "parameters": [ { - "name": "service", + "name": "id", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "body", "in": "body", "required": true, "schema": { - "$ref": "#/definitions/CreateService" + "type": "object" } }, { - "name": "dry_run", - "description": "If set only run validation", - "in": "query", + "name": "seon-fp", + "description": "Seon Fingerprint", + "in": "header", "required": false, - "type": "boolean" + "type": "string" } ], "tags": [ - "Services" + "organization" ] } }, - "/v1/services-autocomplete": { - "post": { - "summary": "Autocomplete definition", - "description": "Generate autocomplete definition for a service", - "operationId": "Autocomplete", + "/v1/organizations/{organization_id}/budget": { + "get": { + "summary": "Get Budget", + "operationId": "GetBudget", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/AutocompleteReply" + "$ref": "#/definitions/GetBudgetReply" } }, "400": { @@ -4065,28 +3484,24 @@ }, "parameters": [ { - "name": "body", - "in": "body", + "name": "organization_id", + "in": "path", "required": true, - "schema": { - "$ref": "#/definitions/AutocompleteRequest" - } + "type": "string" } ], "tags": [ - "Services" + "organization" ] - } - }, - "/v1/services/{id}": { - "get": { - "summary": "Get Service", - "operationId": "GetService", + }, + "delete": { + "summary": "Delete Budget", + "operationId": "DeleteBudget", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/GetServiceReply" + "$ref": "#/definitions/DeleteBudgetReply" } }, "400": { @@ -4134,26 +3549,24 @@ }, "parameters": [ { - "name": "id", - "description": "The id of the Service", + "name": "organization_id", "in": "path", "required": true, "type": "string" } ], "tags": [ - "Services" + "organization" ] }, - "delete": { - "summary": "Delete Service", - "description": "Service deletion is allowed for all status.", - "operationId": "DeleteService", + "post": { + "summary": "Create Budget", + "operationId": "CreateBudget", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/DeleteServiceReply" + "$ref": "#/definitions/CreateBudgetReply" } }, "400": { @@ -4201,25 +3614,39 @@ }, "parameters": [ { - "name": "id", - "description": "The id of the entity to delete", + "name": "organization_id", "in": "path", "required": true, "type": "string" + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object", + "properties": { + "amount": { + "type": "string", + "format": "int64", + "description": "In cents." + } + } + } } ], "tags": [ - "Services" + "organization" ] }, "put": { - "summary": "Update Service", - "operationId": "UpdateService", + "summary": "Update Budget", + "operationId": "UpdateBudget", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/UpdateServiceReply" + "$ref": "#/definitions/UpdateBudgetReply" } }, "400": { @@ -4267,40 +3694,40 @@ }, "parameters": [ { - "name": "id", - "description": "The id of the entity to update", + "name": "organization_id", "in": "path", "required": true, "type": "string" }, { - "name": "service", + "name": "body", "in": "body", "required": true, "schema": { - "$ref": "#/definitions/UpdateService" + "type": "object", + "properties": { + "amount": { + "type": "string", + "format": "int64", + "description": "In cents." + } + } } - }, - { - "name": "dry_run", - "description": "If set, run validation and check that the service exists", - "in": "query", - "required": false, - "type": "boolean" } ], "tags": [ - "Services" + "organization" ] - }, - "patch": { - "summary": "Update Service", - "operationId": "UpdateService2", + } + }, + "/v1/sso/canny": { + "post": { + "operationId": "CannyAuth", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/UpdateServiceReply" + "$ref": "#/definitions/CannyAuthReply" } }, "400": { @@ -4348,43 +3775,27 @@ }, "parameters": [ { - "name": "id", - "description": "The id of the entity to update", - "in": "path", - "required": true, - "type": "string" - }, - { - "name": "service", + "name": "body", "in": "body", "required": true, "schema": { - "$ref": "#/definitions/UpdateService" + "$ref": "#/definitions/CannyAuthRequest" } - }, - { - "name": "dry_run", - "description": "If set, run validation and check that the service exists", - "in": "query", - "required": false, - "type": "boolean" } ], "tags": [ - "Services" + "sso" ] } }, - "/v1/services/{id}/pause": { + "/v1/sso/discourse": { "post": { - "summary": "Pause Service", - "description": "Service pause action is allowed for the following status:\n - starting\n - healthy\n - degraded\n - unhealthy\n - resuming", - "operationId": "PauseService", + "operationId": "DiscourseAuth", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/PauseServiceReply" + "$ref": "#/definitions/DiscourseAuthReply" } }, "400": { @@ -4432,27 +3843,29 @@ }, "parameters": [ { - "name": "id", - "description": "The id of the service to pause.", - "in": "path", + "name": "body", + "in": "body", "required": true, - "type": "string" + "schema": { + "$ref": "#/definitions/DiscourseAuthRequest" + } } ], "tags": [ - "Services" + "sso" ] } }, - "/v1/services/{id}/redeploy": { + "/v1/unscope_organization_token": { "post": { - "summary": "ReDeploy Service", - "operationId": "ReDeploy", + "summary": "Unscope Organization Token", + "description": "UnscopeOrganizationToken removes the organization scope from a token. This\nendpoint is useful when a user wants to remove an organization: by\nunscoping the token first, the user can then delete the organization\nwithout invalidating his token.", + "operationId": "UnscopeOrganizationToken", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/RedeployReply" + "$ref": "#/definitions/LoginReply" } }, "400": { @@ -4500,35 +3913,35 @@ }, "parameters": [ { - "name": "id", - "in": "path", - "required": true, - "type": "string" - }, - { - "name": "info", + "name": "body", "in": "body", "required": true, "schema": { - "$ref": "#/definitions/RedeployRequest.Info" + "$ref": "#/definitions/UnscopeOrganizationTokenRequest" } + }, + { + "name": "seon-fp", + "description": "Seon Fingerprint", + "in": "header", + "required": false, + "type": "string" } ], "tags": [ - "Services" + "organization" ] } }, - "/v1/services/{id}/resume": { - "post": { - "summary": "Resume Service", - "description": "Service resume action is allowed for the following status:\n - paused", - "operationId": "ResumeService", + "/v2/account/profile": { + "put": { + "summary": "Update User V2", + "operationId": "UpdateUserV2", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/ResumeServiceReply" + "$ref": "#/definitions/UserReply" } }, "400": { @@ -4576,40 +3989,32 @@ }, "parameters": [ { - "name": "id", - "description": "The id of the service to pause.", - "in": "path", + "name": "user", + "in": "body", "required": true, - "type": "string" - }, - { - "name": "skip_build", - "description": "If set to true, the build stage will be skipped and the image coming from the last successful build step will be used instead.\nThe call fails if no previous successful builds happened.", - "in": "query", - "required": false, - "type": "boolean" + "schema": { + "$ref": "#/definitions/UpdateUserRequest.UserUpdateBody" + } }, { - "name": "use_cache", + "name": "update_mask", "in": "query", "required": false, - "type": "boolean" + "type": "string" } ], "tags": [ - "Services" + "Profile" ] - } - }, - "/v1/secrets": { - "get": { - "summary": "List Secrets", - "operationId": "ListSecrets", + }, + "patch": { + "summary": "Update User V2", + "operationId": "UpdateUserV22", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/ListSecretsReply" + "$ref": "#/definitions/UserReply" } }, "400": { @@ -4657,52 +4062,34 @@ }, "parameters": [ { - "name": "name", - "in": "query", - "required": false, - "type": "string" - }, - { - "name": "limit", - "in": "query", - "required": false, - "type": "string" + "name": "user", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/UpdateUserRequest.UserUpdateBody" + } }, { - "name": "offset", + "name": "update_mask", "in": "query", "required": false, "type": "string" - }, - { - "name": "types", - "description": "Filter by secret types", - "in": "query", - "required": false, - "type": "array", - "items": { - "type": "string", - "enum": [ - "SIMPLE", - "REGISTRY", - "MANAGED" - ] - }, - "collectionFormat": "multi" } ], "tags": [ - "Secrets" + "Profile" ] - }, - "post": { - "summary": "Create Secret", - "operationId": "CreateSecret", + } + }, + "/v1/organizations/{organization_id}/summary": { + "get": { + "summary": "Get organization usage summary", + "operationId": "GetOrganizationSummary", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/CreateSecretReply" + "$ref": "#/definitions/GetOrganizationSummaryReply" } }, "400": { @@ -4750,28 +4137,27 @@ }, "parameters": [ { - "name": "secret", - "in": "body", + "name": "organization_id", + "description": "Organization ID", + "in": "path", "required": true, - "schema": { - "$ref": "#/definitions/CreateSecret" - } + "type": "string" } ], "tags": [ - "Secrets" + "Summary" ] } }, - "/v1/secrets/{id}": { + "/v1/credentials": { "get": { - "summary": "Get Secret", - "operationId": "GetSecret", + "summary": "List credentials", + "operationId": "ListCredentials", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/GetSecretReply" + "$ref": "#/definitions/ListCredentialsReply" } }, "400": { @@ -4819,25 +4205,67 @@ }, "parameters": [ { - "name": "id", - "in": "path", - "required": true, + "name": "type", + "description": "(Optional) A filter for type", + "in": "query", + "required": false, + "type": "string", + "enum": [ + "INVALID", + "USER", + "ORGANIZATION" + ], + "default": "INVALID" + }, + { + "name": "name", + "description": "(Optional) A filter for name", + "in": "query", + "required": false, "type": "string" - } - ], - "tags": [ - "Secrets" - ] - }, - "delete": { - "summary": "Delete Secret", - "operationId": "DeleteSecret", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/DeleteSecretReply" - } + }, + { + "name": "organization_id", + "description": "(Optional) Filter for an organization", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "user_id", + "description": "(Optional) Filter for an user", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "limit", + "description": "(Optional) The number of items to return", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "offset", + "description": "(Optional) The offset in the list of item to return", + "in": "query", + "required": false, + "type": "string" + } + ], + "tags": [ + "Credentials" + ] + }, + "post": { + "summary": "Create credential", + "operationId": "CreateCredential", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/CreateCredentialReply" + } }, "400": { "description": "Validation error", @@ -4884,24 +4312,28 @@ }, "parameters": [ { - "name": "id", - "in": "path", + "name": "credential", + "in": "body", "required": true, - "type": "string" + "schema": { + "$ref": "#/definitions/CreateCredential" + } } ], "tags": [ - "Secrets" + "Credentials" ] - }, - "put": { - "summary": "Update Secret", - "operationId": "UpdateSecret", + } + }, + "/v1/credentials/{id}": { + "get": { + "summary": "Get credential", + "operationId": "GetCredential", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/UpdateSecretReply" + "$ref": "#/definitions/GetCredentialReply" } }, "400": { @@ -4953,34 +4385,20 @@ "in": "path", "required": true, "type": "string" - }, - { - "name": "secret", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/Secret" - } - }, - { - "name": "update_mask", - "in": "query", - "required": false, - "type": "string" } ], "tags": [ - "Secrets" + "Credentials" ] }, - "patch": { - "summary": "Update Secret", - "operationId": "UpdateSecret2", + "delete": { + "summary": "Delete credential", + "operationId": "DeleteCredential", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/UpdateSecretReply" + "$ref": "#/definitions/DeleteCredentialReply" } }, "400": { @@ -5032,36 +4450,20 @@ "in": "path", "required": true, "type": "string" - }, - { - "name": "secret", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/Secret" - } - }, - { - "name": "update_mask", - "in": "query", - "required": false, - "type": "string" } ], "tags": [ - "Secrets" + "Credentials" ] - } - }, - "/v1/secrets/{id}/reveal": { - "post": { - "summary": "Reveal Secret", - "operationId": "RevealSecret", + }, + "put": { + "summary": "Update credential", + "operationId": "UpdateCredential", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/RevealSecretReply" + "$ref": "#/definitions/UpdateCredentialReply" } }, "400": { @@ -5115,28 +4517,32 @@ "type": "string" }, { - "name": "body", + "name": "credential", "in": "body", "required": true, "schema": { - "type": "object" + "$ref": "#/definitions/Credential" } + }, + { + "name": "update_mask", + "in": "query", + "required": false, + "type": "string" } ], "tags": [ - "Secrets" + "Credentials" ] - } - }, - "/v1/snapshots": { - "get": { - "summary": "List all Snapshots", - "operationId": "ListSnapshots", + }, + "patch": { + "summary": "Update credential", + "operationId": "UpdateCredential2", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/ListSnapshotsReply" + "$ref": "#/definitions/UpdateCredentialReply" } }, "400": { @@ -5184,65 +4590,40 @@ }, "parameters": [ { - "name": "limit", - "description": "(Optional) The number of items to return", - "in": "query", - "required": false, - "type": "string" - }, - { - "name": "offset", - "description": "(Optional) The offset in the list of item to return", - "in": "query", - "required": false, - "type": "string" - }, - { - "name": "organization_id", - "description": "(Optional) Filter by organization_id", - "in": "query", - "required": false, + "name": "id", + "in": "path", + "required": true, "type": "string" }, { - "name": "statuses", - "description": "(Optional) Filter by status\n\n - SNAPSHOT_STATUS_INVALID: zero value, invalid\n - SNAPSHOT_STATUS_CREATING: the snapshot is being created\n - SNAPSHOT_STATUS_AVAILABLE: the snapshot is complete and available\n - SNAPSHOT_STATUS_MIGRATING: the snapshot is being migrated\n - SNAPSHOT_STATUS_DELETING: the snapshot is being deleted\n - SNAPSHOT_STATUS_DELETED: the snapshot is deleted", - "in": "query", - "required": false, - "type": "array", - "items": { - "type": "string", - "enum": [ - "SNAPSHOT_STATUS_INVALID", - "SNAPSHOT_STATUS_CREATING", - "SNAPSHOT_STATUS_AVAILABLE", - "SNAPSHOT_STATUS_MIGRATING", - "SNAPSHOT_STATUS_DELETING", - "SNAPSHOT_STATUS_DELETED" - ] - }, - "collectionFormat": "multi" + "name": "credential", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/Credential" + } }, { - "name": "region", - "description": "(Optional) A filter for the region", + "name": "update_mask", "in": "query", "required": false, "type": "string" } ], "tags": [ - "Snapshots" + "Credentials" ] - }, + } + }, + "/v1/account/login": { "post": { - "summary": "Create a Snapshot", - "operationId": "CreateSnapshot", + "summary": "Login user", + "operationId": "Login", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/CreateSnapshotReply" + "$ref": "#/definitions/LoginReply" } }, "400": { @@ -5294,24 +4675,31 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/CreateSnapshotRequest" + "$ref": "#/definitions/LoginRequest" } + }, + { + "name": "seon-fp", + "description": "Seon Fingerprint", + "in": "header", + "required": false, + "type": "string" } ], "tags": [ - "Snapshots" + "Sessions" ] } }, - "/v1/snapshots/{id}": { - "get": { - "summary": "Get a Snapshot", - "operationId": "GetSnapshot", + "/v1/account/logout": { + "delete": { + "summary": "Logout user", + "operationId": "Logout", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/GetSnapshotReply" + "$ref": "#/definitions/LogoutReply" } }, "400": { @@ -5357,26 +4745,20 @@ } } }, - "parameters": [ - { - "name": "id", - "in": "path", - "required": true, - "type": "string" - } - ], "tags": [ - "Snapshots" + "Sessions" ] - }, - "delete": { - "summary": "Delete a Snapshot", - "operationId": "DeleteSnapshot", + } + }, + "/v1/account/refresh": { + "put": { + "summary": "Refresh token", + "operationId": "RefreshToken", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/DeleteSnapshotReply" + "$ref": "#/definitions/LoginReply" } }, "400": { @@ -5422,26 +4804,80 @@ } } }, - "parameters": [ - { - "name": "id", - "in": "path", - "required": true, - "type": "string" - } - ], "tags": [ - "Snapshots" + "Sessions" ] - }, - "post": { - "summary": "Update a Snapshot", - "operationId": "UpdateSnapshot", + } + }, + "/v1/account/session": { + "post": { + "summary": "New session", + "description": "Creates a new session without an organization for current user.\nNOTE: If you want a session linked to another organization, please use \"Switch organization\".", + "operationId": "NewSession", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/UpdateSnapshotReply" + "$ref": "#/definitions/LoginReply" + } + }, + "400": { + "description": "Validation error", + "schema": { + "$ref": "#/definitions/ErrorWithFields" + } + }, + "401": { + "description": "Returned when the token is not valid.", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "403": { + "description": "Returned when the user does not have permission to access the resource.", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "404": { + "description": "Returned when the resource does not exist.", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "500": { + "description": "Returned in case of server error.", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "503": { + "description": "Service is unavailable.", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/google.rpc.Status" + } + } + }, + "tags": [ + "Sessions" + ] + } + }, + "/v1/organization_confirmations/{id}": { + "post": { + "summary": "Confirm organization action", + "operationId": "ConfirmOrganizationAction", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/ConfirmOrganizationActionReply" } }, "400": { @@ -5490,40 +4926,25 @@ "parameters": [ { "name": "id", - "description": "The id of the snapshot", "in": "path", "required": true, "type": "string" - }, - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "name": { - "type": "string", - "title": "Change the name of the snapshot" - } - } - } } ], "tags": [ - "Snapshots" + "OrganizationConfirmations" ] } }, - "/v1/search": { + "/v1/intercom/profile": { "get": { - "summary": "Search", - "operationId": "Search", + "summary": "Get intercom profile", + "operationId": "GetIntercomProfile", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/ksearch.SearchReply" + "$ref": "#/definitions/GetIntercomProfileReply" } }, "400": { @@ -5569,29 +4990,21 @@ } } }, - "parameters": [ - { - "name": "query", - "description": "(Optional) Search query", - "in": "query", - "required": false, - "type": "string" - } - ], "tags": [ - "Search" + "Intercom" ] } }, - "/v1/activities": { - "get": { - "summary": "List Activities", - "operationId": "ListActivities", + "/v1/coupons": { + "post": { + "summary": "Redeem Coupon", + "description": "This API allows to redeem a coupon. Pass the code you received in the body.", + "operationId": "RedeemCoupon", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/ActivityList" + "$ref": "#/definitions/RedeemCouponReply" } }, "400": { @@ -5639,43 +5052,29 @@ }, "parameters": [ { - "name": "limit", - "in": "query", - "required": false, - "type": "string" - }, - { - "name": "offset", - "in": "query", - "required": false, - "type": "string" - }, - { - "name": "types", - "description": "(Optional) Filter on object type", - "in": "query", - "required": false, - "type": "array", - "items": { - "type": "string" - }, - "collectionFormat": "multi" + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/RedeemCouponRequest" + } } ], "tags": [ - "activity" + "Coupons" ] } }, - "/v1/notifications": { + "/v1/coupons/{code}": { "get": { - "summary": "List Notifications", - "operationId": "ListNotifications", + "summary": "Check Coupon", + "description": "This API allows to check if a given coupon is valid. It is heavily rate-limited.", + "operationId": "CheckCoupon", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/NotificationList" + "$ref": "#/definitions/CheckCouponReply" } }, "400": { @@ -5723,56 +5122,62 @@ }, "parameters": [ { - "name": "limit", - "in": "query", - "required": false, - "type": "string" - }, - { - "name": "offset", - "in": "query", - "required": false, - "type": "string" - }, - { - "name": "mark_read", - "in": "query", - "required": false, - "type": "string" - }, - { - "name": "mark_seen", - "in": "query", - "required": false, - "type": "string" - }, - { - "name": "unread", - "in": "query", - "required": false, - "type": "string" - }, - { - "name": "unseen", - "in": "query", - "required": false, + "name": "code", + "in": "path", + "required": true, "type": "string" } ], "tags": [ - "activity" + "Coupons" ] } }, - "/v1/catalog/regions": { + "/v1/projects": { "get": { - "summary": "List Region", - "operationId": "ListRegions", + "summary": "List projects", + "operationId": "ListProjects", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/ListRegionsReply" + "$ref": "#/definitions/ListProjectsReply" + } + }, + "400": { + "description": "Validation error", + "schema": { + "$ref": "#/definitions/ErrorWithFields" + } + }, + "401": { + "description": "Returned when the token is not valid.", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "403": { + "description": "Returned when the user does not have permission to access the resource.", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "404": { + "description": "Returned when the resource does not exist.", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "500": { + "description": "Returned in case of server error.", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "503": { + "description": "Service is unavailable.", + "schema": { + "$ref": "#/definitions/Error" } }, "default": { @@ -5798,105 +5203,61 @@ "type": "string" }, { - "name": "id", - "description": "(Optional) A filter for regions", + "name": "name", + "description": "(Optional) Filter by project name", "in": "query", "required": false, "type": "string" } ], "tags": [ - "CatalogRegions" + "Projects" ] - } - }, - "/v1/catalog/regions/{id}": { - "get": { - "summary": "Get Region", - "operationId": "GetRegion", + }, + "post": { + "summary": "Create project", + "operationId": "CreateProject", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/GetRegionReply" + "$ref": "#/definitions/CreateProjectReply" } }, - "default": { - "description": "An unexpected error response.", + "400": { + "description": "Validation error", "schema": { - "$ref": "#/definitions/google.rpc.Status" + "$ref": "#/definitions/ErrorWithFields" } - } - }, - "parameters": [ - { - "name": "id", - "description": "The name of the region", - "in": "path", - "required": true, - "type": "string" - } - ], - "tags": [ - "CatalogRegions" - ] - } - }, - "/v1/catalog/instances": { - "get": { - "summary": "List Instances", - "operationId": "ListCatalogInstances", - "responses": { - "200": { - "description": "A successful response.", + }, + "401": { + "description": "Returned when the token is not valid.", "schema": { - "$ref": "#/definitions/ListCatalogInstancesReply" + "$ref": "#/definitions/Error" } }, - "default": { - "description": "An unexpected error response.", + "403": { + "description": "Returned when the user does not have permission to access the resource.", "schema": { - "$ref": "#/definitions/google.rpc.Status" + "$ref": "#/definitions/Error" } - } - }, - "parameters": [ - { - "name": "limit", - "description": "(Optional) The number of items to return", - "in": "query", - "required": false, - "type": "string" }, - { - "name": "offset", - "description": "(Optional) The offset in the list of item to return", - "in": "query", - "required": false, - "type": "string" + "404": { + "description": "Returned when the resource does not exist.", + "schema": { + "$ref": "#/definitions/Error" + } }, - { - "name": "id", - "description": "(Optional) A filter for instances", - "in": "query", - "required": false, - "type": "string" - } - ], - "tags": [ - "CatalogInstances" - ] - } - }, - "/v1/catalog/instances/{id}": { - "get": { - "summary": "Get Instance", - "operationId": "GetCatalogInstance", - "responses": { - "200": { - "description": "A successful response.", + "500": { + "description": "Returned in case of server error.", "schema": { - "$ref": "#/definitions/GetCatalogInstanceReply" + "$ref": "#/definitions/Error" + } + }, + "503": { + "description": "Service is unavailable.", + "schema": { + "$ref": "#/definitions/Error" } }, "default": { @@ -5908,49 +5269,64 @@ }, "parameters": [ { - "name": "id", - "description": "The name of the instance", - "in": "path", + "name": "project", + "in": "body", "required": true, - "type": "string" + "schema": { + "$ref": "#/definitions/CreateProject" + } } ], "tags": [ - "CatalogInstances" + "Projects" ] } }, - "/v1/catalog/datacenters": { + "/v1/projects/{id}": { "get": { - "summary": "List datacenters", - "operationId": "ListDatacenters", + "summary": "Get project", + "operationId": "GetProject", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/ListDatacentersReply" + "$ref": "#/definitions/GetProjectReply" } }, - "default": { - "description": "An unexpected error response.", + "400": { + "description": "Validation error", "schema": { - "$ref": "#/definitions/google.rpc.Status" + "$ref": "#/definitions/ErrorWithFields" } - } - }, - "tags": [ - "CatalogDatacenters" - ] - } - }, - "/v1/catalog/usage": { - "get": { - "operationId": "ListUsage", - "responses": { - "200": { - "description": "A successful response.", + }, + "401": { + "description": "Returned when the token is not valid.", "schema": { - "$ref": "#/definitions/ListUsageReply" + "$ref": "#/definitions/Error" + } + }, + "403": { + "description": "Returned when the user does not have permission to access the resource.", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "404": { + "description": "Returned when the resource does not exist.", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "500": { + "description": "Returned in case of server error.", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "503": { + "description": "Service is unavailable.", + "schema": { + "$ref": "#/definitions/Error" } }, "default": { @@ -5962,36 +5338,24 @@ }, "parameters": [ { - "name": "region", - "in": "query", - "required": false, + "name": "id", + "in": "path", + "required": true, "type": "string" } ], "tags": [ - "CatalogInstanceUsage" + "Projects" ] - } - }, - "/v1/streams/instances/exec": { - "get": { - "summary": "Exec Command", - "description": "This endpoint opens a websocket. Once open, all frames going through the websocket should be formatted in JSON. Input frames should match the format specified below. Output frames will match the response schema.", - "operationId": "ExecCommand", + }, + "delete": { + "summary": "Delete project", + "operationId": "DeleteProject", "responses": { "200": { - "description": "A successful response.(streaming responses)", + "description": "A successful response.", "schema": { - "type": "object", - "properties": { - "result": { - "$ref": "#/definitions/ExecCommandReply" - }, - "error": { - "$ref": "#/definitions/google.rpc.Status" - } - }, - "title": "Stream result of ExecCommandReply" + "$ref": "#/definitions/DeleteProjectReply" } }, "400": { @@ -6040,86 +5404,23 @@ "parameters": [ { "name": "id", - "description": "ID of the resource to exec on.", - "in": "query", - "required": false, + "in": "path", + "required": true, "type": "string" - }, - { - "name": "body.command", - "description": "Command to exec. Mandatory in the first frame sent", - "in": "query", - "required": false, - "type": "array", - "items": { - "type": "string" - }, - "collectionFormat": "multi" - }, - { - "name": "body.tty_size.height", - "in": "query", - "required": false, - "type": "integer", - "format": "int32" - }, - { - "name": "body.tty_size.width", - "in": "query", - "required": false, - "type": "integer", - "format": "int32" - }, - { - "name": "body.stdin.data", - "description": "Data is base64 encoded", - "in": "query", - "required": false, - "type": "string", - "format": "byte" - }, - { - "name": "body.stdin.close", - "description": "Indicate last data frame", - "in": "query", - "required": false, - "type": "boolean" - }, - { - "name": "body.disableTty", - "description": "Disable TTY. It's enough to specify it in the first frame", - "in": "query", - "required": false, - "type": "boolean" - }, - { - "name": "id_type", - "description": "When specified, it is used to determine if the kind of resource the id refers to. If missing, defaults to the instance id.", - "in": "query", - "required": false, - "type": "string", - "enum": [ - "INVALID", - "INSTANCE_ID", - "SERVICE_ID" - ], - "default": "INVALID" } ], "tags": [ - "Instances" + "Projects" ] - } - }, - "/v1/streams/metrics": { - "get": { - "summary": "Get Metrics", - "operationId": "GetMetrics", + }, + "put": { + "summary": "Update project", + "operationId": "UpdateProject", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/GetMetricsReply" + "$ref": "#/definitions/UpdateProjectReply" } }, "400": { @@ -6167,77 +5468,38 @@ }, "parameters": [ { - "name": "service_id", - "description": "ID of the service to query instances metrics for. Ignored if instance_id is set.", - "in": "query", - "required": false, + "name": "id", + "in": "path", + "required": true, "type": "string" }, { - "name": "instance_id", - "description": "ID of the instance to query metrics for.", - "in": "query", - "required": false, - "type": "string" + "name": "project", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/Project" + } }, { - "name": "name", - "description": "Metric to query.", - "in": "query", - "required": false, - "type": "string", - "enum": [ - "UNKNOWN", - "CPU_TOTAL_PERCENT", - "MEM_RSS", - "HTTP_THROUGHPUT", - "HTTP_RESPONSE_TIME_50P", - "HTTP_RESPONSE_TIME_90P", - "HTTP_RESPONSE_TIME_99P", - "HTTP_RESPONSE_TIME_MAX", - "PUBLIC_DATA_TRANSFER_IN", - "PUBLIC_DATA_TRANSFER_OUT" - ], - "default": "UNKNOWN" - }, - { - "name": "start", - "description": "(Optional) Defaults to an hour prior to end.", - "in": "query", - "required": false, - "type": "string", - "format": "date-time" - }, - { - "name": "end", - "description": "(Optional) Defaults to now.", - "in": "query", - "required": false, - "type": "string", - "format": "date-time" - }, - { - "name": "step", - "description": "(Optional) Must be a valid duration in hours (h) or minutes (m). Defaulst to 5m.", + "name": "update_mask", "in": "query", "required": false, "type": "string" } ], "tags": [ - "Metrics" + "Projects" ] - } - }, - "/v1/streams/logs/query": { - "get": { - "summary": "Query logs", - "operationId": "QueryLogs", + }, + "patch": { + "summary": "Update project", + "operationId": "UpdateProject2", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/QueryLogsReply" + "$ref": "#/definitions/UpdateProjectReply" } }, "400": { @@ -6285,156 +5547,149 @@ }, "parameters": [ { - "name": "type", - "description": "Type of logs to retrieve, either \"build\" or \"runtime\". Defaults to \"runtime\".", - "in": "query", - "required": false, - "type": "string" - }, - { - "name": "app_id", - "description": "(Optional) Filter on the provided app_id. At least one of app_id, service_id, deployment_id, regional_deployment_id or instance_ids must be set.", - "in": "query", - "required": false, - "type": "string" - }, - { - "name": "service_id", - "description": "(Optional) Filter on the provided service_id. At least one of app_id, service_id, deployment_id, regional_deployment_id or instance_ids must be set.", - "in": "query", - "required": false, + "name": "id", + "in": "path", + "required": true, "type": "string" }, { - "name": "deployment_id", - "description": "(Optional) Filter on the provided deployment_id. At least one of app_id, service_id, deployment_id, regional_deployment_id or instance_ids must be set.", - "in": "query", - "required": false, - "type": "string" + "name": "project", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/Project" + } }, { - "name": "regional_deployment_id", - "description": "(Optional) Filter on the provided regional_deployment_id. At least one of app_id, service_id, deployment_id, regional_deployment_id or instance_ids must be set.", + "name": "update_mask", "in": "query", "required": false, "type": "string" + } + ], + "tags": [ + "Projects" + ] + } + }, + "/v1/organization_members": { + "get": { + "summary": "List organization members", + "operationId": "ListOrganizationMembers", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/ListOrganizationMembersReply" + } }, - { - "name": "instance_id", - "description": "Deprecated, prefer using instance_ids instead.", - "in": "query", - "required": false, - "type": "string" + "400": { + "description": "Validation error", + "schema": { + "$ref": "#/definitions/ErrorWithFields" + } }, - { - "name": "instance_ids", - "description": "(Optional) Filter on the provided instance_ids. At least one of app_id, service_id, deployment_id, regional_deployment_id or instance_ids must be set.", - "in": "query", - "required": false, - "type": "array", - "items": { - "type": "string" - }, - "collectionFormat": "multi" + "401": { + "description": "Returned when the token is not valid.", + "schema": { + "$ref": "#/definitions/Error" + } }, - { - "name": "stream", - "description": "Deprecated, prefer using streams instead.", - "in": "query", - "required": false, - "type": "string" + "403": { + "description": "Returned when the user does not have permission to access the resource.", + "schema": { + "$ref": "#/definitions/Error" + } }, - { - "name": "streams", - "description": "(Optional) Filter on stream: either \"stdout\", \"stderr\" or \"koyeb\" (for system logs).", - "in": "query", - "required": false, - "type": "array", - "items": { - "type": "string" - }, - "collectionFormat": "multi" + "404": { + "description": "Returned when the resource does not exist.", + "schema": { + "$ref": "#/definitions/Error" + } }, - { - "name": "start", - "description": "(Optional) Must always be before `end`. Defaults to 15 minutes ago.", - "in": "query", - "required": false, - "type": "string", - "format": "date-time" + "500": { + "description": "Returned in case of server error.", + "schema": { + "$ref": "#/definitions/Error" + } }, - { - "name": "end", - "description": "(Optional) Must always be after `start`. Defaults to now.", - "in": "query", - "required": false, - "type": "string", - "format": "date-time" + "503": { + "description": "Service is unavailable.", + "schema": { + "$ref": "#/definitions/Error" + } }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/google.rpc.Status" + } + } + }, + "parameters": [ { - "name": "order", - "description": "(Optional) `asc` or `desc`. Defaults to `desc`.", + "name": "limit", + "description": "(Optional) The number of items to return", "in": "query", "required": false, "type": "string" }, { - "name": "limit", - "description": "(Optional) Defaults to 100. Maximum of 1000.", + "name": "offset", + "description": "(Optional) The offset in the list of item to return", "in": "query", "required": false, - "type": "string", - "format": "int64" + "type": "string" }, { - "name": "regex", - "description": "(Optional) Apply a regex to filter logs. Can't be used with `text`.", + "name": "organization_id", + "description": "(Optional) Filter for an organization", "in": "query", "required": false, "type": "string" }, { - "name": "text", - "description": "(Optional) Looks for this string in logs. Can't be used with `regex`.", + "name": "user_id", + "description": "(Optional) Filter for an user", "in": "query", "required": false, "type": "string" }, { - "name": "regions", - "description": "(Optional) Filter on the provided regions (e.g. [\"fra\", \"was\"]).", + "name": "organization_statuses", + "description": "(Optional) Filter for organization statuses", "in": "query", "required": false, "type": "array", "items": { - "type": "string" + "type": "string", + "enum": [ + "WARNING", + "LOCKED", + "ACTIVE", + "DEACTIVATING", + "DEACTIVATED", + "DELETING", + "DELETED" + ] }, "collectionFormat": "multi" } ], "tags": [ - "Logs" + "OrganizationMembers" ] } }, - "/v1/streams/logs/tail": { - "get": { - "summary": "Tails logs", - "operationId": "TailLogs", + "/v1/organization_members/{id}": { + "delete": { + "summary": "Remove an organization member", + "operationId": "RemoveOrganizationMember", "responses": { "200": { - "description": "A successful response.(streaming responses)", + "description": "A successful response.", "schema": { - "type": "object", - "properties": { - "result": { - "$ref": "#/definitions/LogEntry" - }, - "error": { - "$ref": "#/definitions/google.rpc.Status" - } - }, - "title": "Stream result of LogEntry" + "$ref": "#/definitions/RemoveOrganizationMemberReply" } }, "400": { @@ -6482,132 +5737,119 @@ }, "parameters": [ { - "name": "type", - "description": "Type of logs to retrieve, either \"build\" or \"runtime\". Defaults to \"runtime\".", - "in": "query", - "required": false, - "type": "string" - }, - { - "name": "app_id", - "description": "(Optional) Filter on the provided app_id. At least one of app_id, service_id, deployment_id, regional_deployment_id or instance_ids must be set.", - "in": "query", - "required": false, - "type": "string" - }, - { - "name": "service_id", - "description": "(Optional) Filter on the provided service_id. At least one of app_id, service_id, deployment_id, regional_deployment_id or instance_ids must be set.", - "in": "query", - "required": false, - "type": "string" - }, - { - "name": "deployment_id", - "description": "(Optional) Filter on the provided deployment_id. At least one of app_id, service_id, deployment_id, regional_deployment_id or instance_ids must be set.", - "in": "query", - "required": false, + "name": "id", + "in": "path", + "required": true, "type": "string" + } + ], + "tags": [ + "OrganizationMembers" + ] + } + }, + "/v1/payment_methods": { + "get": { + "summary": "List payment methods", + "operationId": "ListPaymentMethods", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/ListPaymentMethodsReply" + } }, - { - "name": "regional_deployment_id", - "description": "(Optional) Filter on the provided regional_deployment_id. At least one of app_id, service_id, deployment_id, regional_deployment_id or instance_ids must be set.", - "in": "query", - "required": false, - "type": "string" + "400": { + "description": "Validation error", + "schema": { + "$ref": "#/definitions/ErrorWithFields" + } }, - { - "name": "instance_id", - "description": "Deprecated, prefer using instance_ids instead.", - "in": "query", - "required": false, - "type": "string" + "401": { + "description": "Returned when the token is not valid.", + "schema": { + "$ref": "#/definitions/Error" + } }, - { - "name": "instance_ids", - "description": "(Optional) Filter on the provided instance_ids. At least one of app_id, service_id, deployment_id, regional_deployment_id or instance_ids must be set.", - "in": "query", - "required": false, - "type": "array", - "items": { - "type": "string" - }, - "collectionFormat": "multi" + "403": { + "description": "Returned when the user does not have permission to access the resource.", + "schema": { + "$ref": "#/definitions/Error" + } }, - { - "name": "stream", - "description": "Deprecated, prefer using streams instead.", - "in": "query", - "required": false, - "type": "string" + "404": { + "description": "Returned when the resource does not exist.", + "schema": { + "$ref": "#/definitions/Error" + } }, - { - "name": "streams", - "description": "(Optional) Filter on stream: either \"stdout\", \"stderr\" or \"koyeb\" (for system logs).", - "in": "query", - "required": false, - "type": "array", - "items": { - "type": "string" - }, - "collectionFormat": "multi" + "500": { + "description": "Returned in case of server error.", + "schema": { + "$ref": "#/definitions/Error" + } }, - { - "name": "start", - "description": "(Optional) Defaults to 24 hours ago.", - "in": "query", - "required": false, - "type": "string", - "format": "date-time" + "503": { + "description": "Service is unavailable.", + "schema": { + "$ref": "#/definitions/Error" + } }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/google.rpc.Status" + } + } + }, + "parameters": [ { "name": "limit", - "description": "(Optional) Defaults to 1000. Maximum of 1000.", - "in": "query", - "required": false, - "type": "string", - "format": "int64" - }, - { - "name": "regex", - "description": "(Optional) Apply a regex to filter logs. Can't be used with `text`.", + "description": "(Optional) The number of items to return", "in": "query", "required": false, "type": "string" }, { - "name": "text", - "description": "(Optional) Looks for this string in logs. Can't be used with `regex`.", + "name": "offset", + "description": "(Optional) The offset in the list of item to return", "in": "query", "required": false, "type": "string" }, { - "name": "regions", - "description": "(Optional) Filter on the provided regions (e.g. [\"fra\", \"was\"]).", + "name": "statuses", + "description": "(Optional) Filter on payment method statuses", "in": "query", "required": false, "type": "array", "items": { - "type": "string" + "type": "string", + "enum": [ + "INVALID", + "CREATED", + "AUTHORIZED", + "DECLINED", + "CANCELED", + "EXPIRED", + "UNCHECKED" + ] }, "collectionFormat": "multi" } ], "tags": [ - "Logs" + "PaymentMethods" ] - } - }, - "/v1/account/login": { + }, "post": { - "summary": "Login user", - "operationId": "Login", + "summary": "Create payment authorization", + "operationId": "CreatePaymentAuthorization", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/LoginReply" + "$ref": "#/definitions/CreatePaymentAuthorizationReply" } }, "400": { @@ -6659,31 +5901,24 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/LoginRequest" + "$ref": "#/definitions/CreatePaymentAuthorizationRequest" } - }, - { - "name": "seon-fp", - "description": "Seon Fingerprint", - "in": "header", - "required": false, - "type": "string" } ], "tags": [ - "Sessions" + "PaymentMethods" ] } }, - "/v1/account/logout": { - "delete": { - "summary": "Logout user", - "operationId": "Logout", + "/v1/payment_methods/{id}": { + "get": { + "summary": "Get payment method", + "operationId": "GetPaymentMethod", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/LogoutReply" + "$ref": "#/definitions/GetPaymentMethodReply" } }, "400": { @@ -6729,20 +5964,26 @@ } } }, + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "type": "string" + } + ], "tags": [ - "Sessions" + "PaymentMethods" ] - } - }, - "/v1/account/refresh": { - "put": { - "summary": "Refresh token", - "operationId": "RefreshToken", + }, + "delete": { + "summary": "Delete payment method", + "operationId": "DeletePaymentMethod", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/LoginReply" + "$ref": "#/definitions/DeletePaymentMethodReply" } }, "400": { @@ -6788,21 +6029,28 @@ } } }, + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "type": "string" + } + ], "tags": [ - "Sessions" + "PaymentMethods" ] } }, - "/v1/account/session": { + "/v1/payment_methods/{id}/confirm": { "post": { - "summary": "New session", - "description": "Creates a new session without an organization for current user.\nNOTE: If you want a session linked to another organization, please use \"Switch organization\".", - "operationId": "NewSession", + "summary": "Confirm payment authorization", + "operationId": "ConfirmPaymentAuthorization", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/LoginReply" + "$ref": "#/definitions/ConfirmPaymentAuthorizationReply" } }, "400": { @@ -6848,20 +6096,35 @@ } } }, + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object" + } + } + ], "tags": [ - "Sessions" + "PaymentMethods" ] } }, - "/v1/intercom/profile": { + "/v1/organizations/{organization_id}/quotas": { "get": { - "summary": "Get intercom profile", - "operationId": "GetIntercomProfile", + "operationId": "GetQuotas", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/GetIntercomProfileReply" + "$ref": "#/definitions/GetQuotasReply" } }, "400": { @@ -6907,156 +6170,28 @@ } } }, + "parameters": [ + { + "name": "organization_id", + "in": "path", + "required": true, + "type": "string" + } + ], "tags": [ - "Intercom" + "OrganizationQuotas" ] } }, - "/v1/users/{id}": { - "delete": { - "summary": "Delete user", - "operationId": "DeleteUser", + "/v1/organization_invitations": { + "get": { + "summary": "List Organization Invitations", + "operationId": "ListOrganizationInvitations", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/DeleteUserReply" - } - }, - "400": { - "description": "Validation error", - "schema": { - "$ref": "#/definitions/ErrorWithFields" - } - }, - "401": { - "description": "Returned when the token is not valid.", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "403": { - "description": "Returned when the user does not have permission to access the resource.", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "404": { - "description": "Returned when the resource does not exist.", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "500": { - "description": "Returned in case of server error.", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "503": { - "description": "Service is unavailable.", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/google.rpc.Status" - } - } - }, - "parameters": [ - { - "name": "id", - "description": "The id of the user", - "in": "path", - "required": true, - "type": "string" - } - ], - "tags": [ - "Users" - ] - } - }, - "/v2/users/{id}": { - "delete": { - "summary": "V2 Delete user", - "operationId": "DeleteUserV2", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/DeleteUserReply" - } - }, - "400": { - "description": "Validation error", - "schema": { - "$ref": "#/definitions/ErrorWithFields" - } - }, - "401": { - "description": "Returned when the token is not valid.", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "403": { - "description": "Returned when the user does not have permission to access the resource.", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "404": { - "description": "Returned when the resource does not exist.", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "500": { - "description": "Returned in case of server error.", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "503": { - "description": "Service is unavailable.", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/google.rpc.Status" - } - } - }, - "parameters": [ - { - "name": "id", - "description": "The id of the user", - "in": "path", - "required": true, - "type": "string" - } - ], - "tags": [ - "Users" - ] - } - }, - "/v1/payment_methods": { - "get": { - "summary": "List payment methods", - "operationId": "ListPaymentMethods", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/ListPaymentMethodsReply" + "$ref": "#/definitions/ListOrganizationInvitationsReply" } }, "400": { @@ -7119,7 +6254,7 @@ }, { "name": "statuses", - "description": "(Optional) Filter on payment method statuses", + "description": "(Optional) Filter on organization invitation statuses", "in": "query", "required": false, "type": "array", @@ -7127,29 +6262,34 @@ "type": "string", "enum": [ "INVALID", - "CREATED", - "AUTHORIZED", - "DECLINED", - "CANCELED", - "EXPIRED", - "UNCHECKED" + "PENDING", + "ACCEPTED", + "REFUSED", + "EXPIRED" ] }, "collectionFormat": "multi" + }, + { + "name": "user_id", + "description": "(Optional) Filter on invitee ID. Will match both invitations sent to\nthat user_id and invitations sent to the email of that user_id.\nThe only valid value is the requester's user_id", + "in": "query", + "required": false, + "type": "string" } ], "tags": [ - "PaymentMethods" + "OrganizationInvitations" ] }, "post": { - "summary": "Create payment authorization", - "operationId": "CreatePaymentAuthorization", + "summary": "Create Organization Invitation", + "operationId": "CreateOrganizationInvitation", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/CreatePaymentAuthorizationReply" + "$ref": "#/definitions/CreateOrganizationInvitationReply" } }, "400": { @@ -7201,24 +6341,24 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/CreatePaymentAuthorizationRequest" + "$ref": "#/definitions/CreateOrganizationInvitationRequest" } } ], "tags": [ - "PaymentMethods" + "OrganizationInvitations" ] } }, - "/v1/payment_methods/{id}": { + "/v1/organization_invitations/{id}": { "get": { - "summary": "Get payment method", - "operationId": "GetPaymentMethod", + "summary": "Get Organization Invitation", + "operationId": "GetOrganizationInvitation", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/GetPaymentMethodReply" + "$ref": "#/definitions/GetOrganizationInvitationReply" } }, "400": { @@ -7267,23 +6407,24 @@ "parameters": [ { "name": "id", + "description": "The id of the invitation to get", "in": "path", "required": true, "type": "string" } ], "tags": [ - "PaymentMethods" + "OrganizationInvitations" ] }, "delete": { - "summary": "Delete payment method", - "operationId": "DeletePaymentMethod", + "summary": "Delete Organization Invitation", + "operationId": "DeleteOrganizationInvitation", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/DeletePaymentMethodReply" + "$ref": "#/definitions/DeleteOrganizationInvitationReply" } }, "400": { @@ -7332,25 +6473,26 @@ "parameters": [ { "name": "id", + "description": "The id of the organization invitation to delete", "in": "path", "required": true, "type": "string" } ], "tags": [ - "PaymentMethods" + "OrganizationInvitations" ] } }, - "/v1/payment_methods/{id}/confirm": { + "/v1/organization_invitations/{id}/resend": { "post": { - "summary": "Confirm payment authorization", - "operationId": "ConfirmPaymentAuthorization", + "summary": "Resend Organization Invitation", + "operationId": "ResendOrganizationInvitation", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/ConfirmPaymentAuthorizationReply" + "$ref": "#/definitions/ResendOrganizationInvitationReply" } }, "400": { @@ -7399,6 +6541,7 @@ "parameters": [ { "name": "id", + "description": "The id of the organization invitation to resend", "in": "path", "required": true, "type": "string" @@ -7413,20 +6556,19 @@ } ], "tags": [ - "PaymentMethods" + "OrganizationInvitations" ] } }, - "/v1/coupons": { - "post": { - "summary": "Redeem Coupon", - "description": "This API allows to redeem a coupon. Pass the code you received in the body.", - "operationId": "RedeemCoupon", + "/v1/subscriptions/{id}": { + "get": { + "summary": "Get Subscription", + "operationId": "GetSubscription", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/RedeemCouponReply" + "$ref": "#/definitions/GetSubscriptionReply" } }, "400": { @@ -7474,28 +6616,27 @@ }, "parameters": [ { - "name": "body", - "in": "body", + "name": "id", + "description": "The id of the instance", + "in": "path", "required": true, - "schema": { - "$ref": "#/definitions/RedeemCouponRequest" - } + "type": "string" } ], "tags": [ - "Coupons" + "Subscriptions" ] } }, - "/v1/credentials": { + "/v1/streams/logs/query": { "get": { - "summary": "List credentials", - "operationId": "ListCredentials", + "summary": "Query logs", + "operationId": "QueryLogs", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/ListCredentialsReply" + "$ref": "#/definitions/QueryLogsReply" } }, "400": { @@ -7544,65 +6685,155 @@ "parameters": [ { "name": "type", - "description": "(Optional) A filter for type", + "description": "Type of logs to retrieve, either \"build\" or \"runtime\". Defaults to \"runtime\".", "in": "query", "required": false, - "type": "string", - "enum": [ - "INVALID", - "USER", - "ORGANIZATION" - ], - "default": "INVALID" + "type": "string" }, { - "name": "name", - "description": "(Optional) A filter for name", + "name": "app_id", + "description": "(Optional) Filter on the provided app_id. At least one of app_id, service_id, deployment_id, regional_deployment_id or instance_ids must be set.", "in": "query", "required": false, "type": "string" }, { - "name": "organization_id", - "description": "(Optional) Filter for an organization", + "name": "service_id", + "description": "(Optional) Filter on the provided service_id. At least one of app_id, service_id, deployment_id, regional_deployment_id or instance_ids must be set.", "in": "query", "required": false, "type": "string" }, { - "name": "user_id", - "description": "(Optional) Filter for an user", + "name": "deployment_id", + "description": "(Optional) Filter on the provided deployment_id. At least one of app_id, service_id, deployment_id, regional_deployment_id or instance_ids must be set.", "in": "query", "required": false, "type": "string" }, { - "name": "limit", - "description": "(Optional) The number of items to return", + "name": "regional_deployment_id", + "description": "(Optional) Filter on the provided regional_deployment_id. At least one of app_id, service_id, deployment_id, regional_deployment_id or instance_ids must be set.", "in": "query", "required": false, "type": "string" }, { - "name": "offset", - "description": "(Optional) The offset in the list of item to return", - "in": "query", + "name": "instance_id", + "description": "Deprecated, prefer using instance_ids instead.", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "instance_ids", + "description": "(Optional) Filter on the provided instance_ids. At least one of app_id, service_id, deployment_id, regional_deployment_id or instance_ids must be set.", + "in": "query", + "required": false, + "type": "array", + "items": { + "type": "string" + }, + "collectionFormat": "multi" + }, + { + "name": "stream", + "description": "Deprecated, prefer using streams instead.", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "streams", + "description": "(Optional) Filter on stream: either \"stdout\", \"stderr\" or \"koyeb\" (for system logs).", + "in": "query", + "required": false, + "type": "array", + "items": { + "type": "string" + }, + "collectionFormat": "multi" + }, + { + "name": "start", + "description": "(Optional) Must always be before `end`. Defaults to 15 minutes ago.", + "in": "query", + "required": false, + "type": "string", + "format": "date-time" + }, + { + "name": "end", + "description": "(Optional) Must always be after `start`. Defaults to now.", + "in": "query", + "required": false, + "type": "string", + "format": "date-time" + }, + { + "name": "order", + "description": "(Optional) `asc` or `desc`. Defaults to `desc`.", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "limit", + "description": "(Optional) Defaults to 100. Maximum of 1000.", + "in": "query", + "required": false, + "type": "string", + "format": "int64" + }, + { + "name": "regex", + "description": "(Optional) Apply a regex to filter logs. Can't be used with `text`.", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "text", + "description": "(Optional) Looks for this string in logs. Can't be used with `regex`.", + "in": "query", "required": false, "type": "string" + }, + { + "name": "regions", + "description": "(Optional) Filter on the provided regions (e.g. [\"fra\", \"was\"]).", + "in": "query", + "required": false, + "type": "array", + "items": { + "type": "string" + }, + "collectionFormat": "multi" } ], "tags": [ - "Credentials" + "Logs" ] - }, - "post": { - "summary": "Create credential", - "operationId": "CreateCredential", + } + }, + "/v1/streams/logs/tail": { + "get": { + "summary": "Tails logs", + "operationId": "TailLogs", "responses": { "200": { - "description": "A successful response.", + "description": "A successful response.(streaming responses)", "schema": { - "$ref": "#/definitions/CreateCredentialReply" + "type": "object", + "properties": { + "result": { + "$ref": "#/definitions/LogEntry" + }, + "error": { + "$ref": "#/definitions/google.rpc.Status" + } + }, + "title": "Stream result of LogEntry" } }, "400": { @@ -7650,28 +6881,132 @@ }, "parameters": [ { - "name": "credential", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/CreateCredential" - } + "name": "type", + "description": "Type of logs to retrieve, either \"build\" or \"runtime\". Defaults to \"runtime\".", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "app_id", + "description": "(Optional) Filter on the provided app_id. At least one of app_id, service_id, deployment_id, regional_deployment_id or instance_ids must be set.", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "service_id", + "description": "(Optional) Filter on the provided service_id. At least one of app_id, service_id, deployment_id, regional_deployment_id or instance_ids must be set.", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "deployment_id", + "description": "(Optional) Filter on the provided deployment_id. At least one of app_id, service_id, deployment_id, regional_deployment_id or instance_ids must be set.", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "regional_deployment_id", + "description": "(Optional) Filter on the provided regional_deployment_id. At least one of app_id, service_id, deployment_id, regional_deployment_id or instance_ids must be set.", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "instance_id", + "description": "Deprecated, prefer using instance_ids instead.", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "instance_ids", + "description": "(Optional) Filter on the provided instance_ids. At least one of app_id, service_id, deployment_id, regional_deployment_id or instance_ids must be set.", + "in": "query", + "required": false, + "type": "array", + "items": { + "type": "string" + }, + "collectionFormat": "multi" + }, + { + "name": "stream", + "description": "Deprecated, prefer using streams instead.", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "streams", + "description": "(Optional) Filter on stream: either \"stdout\", \"stderr\" or \"koyeb\" (for system logs).", + "in": "query", + "required": false, + "type": "array", + "items": { + "type": "string" + }, + "collectionFormat": "multi" + }, + { + "name": "start", + "description": "(Optional) Defaults to 24 hours ago.", + "in": "query", + "required": false, + "type": "string", + "format": "date-time" + }, + { + "name": "limit", + "description": "(Optional) Defaults to 1000. Maximum of 1000.", + "in": "query", + "required": false, + "type": "string", + "format": "int64" + }, + { + "name": "regex", + "description": "(Optional) Apply a regex to filter logs. Can't be used with `text`.", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "text", + "description": "(Optional) Looks for this string in logs. Can't be used with `regex`.", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "regions", + "description": "(Optional) Filter on the provided regions (e.g. [\"fra\", \"was\"]).", + "in": "query", + "required": false, + "type": "array", + "items": { + "type": "string" + }, + "collectionFormat": "multi" } ], "tags": [ - "Credentials" + "Logs" ] } }, - "/v1/credentials/{id}": { + "/v1/streams/metrics": { "get": { - "summary": "Get credential", - "operationId": "GetCredential", + "summary": "Get Metrics", + "operationId": "GetMetrics", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/GetCredentialReply" + "$ref": "#/definitions/GetMetricsReply" } }, "400": { @@ -7719,24 +7054,87 @@ }, "parameters": [ { - "name": "id", - "in": "path", - "required": true, + "name": "service_id", + "description": "ID of the service to query instances metrics for. Ignored if instance_id is set.", + "in": "query", + "required": false, "type": "string" - } - ], - "tags": [ - "Credentials" - ] - }, - "delete": { - "summary": "Delete credential", - "operationId": "DeleteCredential", - "responses": { + }, + { + "name": "instance_id", + "description": "ID of the instance to query metrics for.", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "name", + "description": "Metric to query.", + "in": "query", + "required": false, + "type": "string", + "enum": [ + "UNKNOWN", + "CPU_TOTAL_PERCENT", + "MEM_RSS", + "HTTP_THROUGHPUT", + "HTTP_RESPONSE_TIME_50P", + "HTTP_RESPONSE_TIME_90P", + "HTTP_RESPONSE_TIME_99P", + "HTTP_RESPONSE_TIME_MAX", + "PUBLIC_DATA_TRANSFER_IN", + "PUBLIC_DATA_TRANSFER_OUT" + ], + "default": "UNKNOWN" + }, + { + "name": "start", + "description": "(Optional) Defaults to an hour prior to end.", + "in": "query", + "required": false, + "type": "string", + "format": "date-time" + }, + { + "name": "end", + "description": "(Optional) Defaults to now.", + "in": "query", + "required": false, + "type": "string", + "format": "date-time" + }, + { + "name": "step", + "description": "(Optional) Must be a valid duration in hours (h) or minutes (m). Defaulst to 5m.", + "in": "query", + "required": false, + "type": "string" + } + ], + "tags": [ + "Metrics" + ] + } + }, + "/v1/streams/instances/exec": { + "get": { + "summary": "Exec Command", + "description": "This endpoint opens a websocket. Once open, all frames going through the websocket should be formatted in JSON. Input frames should match the format specified below. Output frames will match the response schema.", + "operationId": "ExecCommand", + "responses": { "200": { - "description": "A successful response.", + "description": "A successful response.(streaming responses)", "schema": { - "$ref": "#/definitions/DeleteCredentialReply" + "type": "object", + "properties": { + "result": { + "$ref": "#/definitions/ExecCommandReply" + }, + "error": { + "$ref": "#/definitions/google.rpc.Status" + } + }, + "title": "Stream result of ExecCommandReply" } }, "400": { @@ -7785,23 +7183,86 @@ "parameters": [ { "name": "id", - "in": "path", - "required": true, + "description": "ID of the resource to exec on.", + "in": "query", + "required": false, "type": "string" + }, + { + "name": "body.command", + "description": "Command to exec. Mandatory in the first frame sent", + "in": "query", + "required": false, + "type": "array", + "items": { + "type": "string" + }, + "collectionFormat": "multi" + }, + { + "name": "body.tty_size.height", + "in": "query", + "required": false, + "type": "integer", + "format": "int32" + }, + { + "name": "body.tty_size.width", + "in": "query", + "required": false, + "type": "integer", + "format": "int32" + }, + { + "name": "body.stdin.data", + "description": "Data is base64 encoded", + "in": "query", + "required": false, + "type": "string", + "format": "byte" + }, + { + "name": "body.stdin.close", + "description": "Indicate last data frame", + "in": "query", + "required": false, + "type": "boolean" + }, + { + "name": "body.disableTty", + "description": "Disable TTY. It's enough to specify it in the first frame", + "in": "query", + "required": false, + "type": "boolean" + }, + { + "name": "id_type", + "description": "When specified, it is used to determine if the kind of resource the id refers to. If missing, defaults to the instance id.", + "in": "query", + "required": false, + "type": "string", + "enum": [ + "INVALID", + "INSTANCE_ID", + "SERVICE_ID" + ], + "default": "INVALID" } ], "tags": [ - "Credentials" + "Instances" ] - }, - "put": { - "summary": "Update credential", - "operationId": "UpdateCredential", + } + }, + "/v1/activities": { + "get": { + "summary": "List Activities", + "operationId": "ListActivities", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/UpdateCredentialReply" + "$ref": "#/definitions/ActivityList" } }, "400": { @@ -7849,38 +7310,43 @@ }, "parameters": [ { - "name": "id", - "in": "path", - "required": true, + "name": "limit", + "in": "query", + "required": false, "type": "string" }, { - "name": "credential", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/Credential" - } + "name": "offset", + "in": "query", + "required": false, + "type": "string" }, { - "name": "update_mask", + "name": "types", + "description": "(Optional) Filter on object type", "in": "query", "required": false, - "type": "string" + "type": "array", + "items": { + "type": "string" + }, + "collectionFormat": "multi" } ], "tags": [ - "Credentials" + "activity" ] - }, - "patch": { - "summary": "Update credential", - "operationId": "UpdateCredential2", + } + }, + "/v1/notifications": { + "get": { + "summary": "List Notifications", + "operationId": "ListNotifications", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/UpdateCredentialReply" + "$ref": "#/definitions/NotificationList" } }, "400": { @@ -7928,40 +7394,56 @@ }, "parameters": [ { - "name": "id", - "in": "path", - "required": true, + "name": "limit", + "in": "query", + "required": false, "type": "string" }, { - "name": "credential", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/Credential" - } + "name": "offset", + "in": "query", + "required": false, + "type": "string" }, { - "name": "update_mask", + "name": "mark_read", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "mark_seen", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "unread", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "unseen", "in": "query", "required": false, "type": "string" } ], "tags": [ - "Credentials" + "activity" ] } }, - "/v1/subscriptions/{id}": { + "/v1/regional_deployment_events": { "get": { - "summary": "Get Subscription", - "operationId": "GetSubscription", + "summary": "List Regional Deployment events", + "operationId": "ListRegionalDeploymentEvents", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/GetSubscriptionReply" + "$ref": "#/definitions/ListRegionalDeploymentEventsReply" } }, "400": { @@ -8009,27 +7491,60 @@ }, "parameters": [ { - "name": "id", - "description": "The id of the instance", - "in": "path", - "required": true, + "name": "regional_deployment_id", + "description": "(Optional) Filter on regional deployment id", + "in": "query", + "required": false, "type": "string" - } - ], - "tags": [ - "Subscriptions" - ] - } - }, - "/v1/organization_invitations": { + }, + { + "name": "types", + "description": "(Optional) Filter on regional deployment event types", + "in": "query", + "required": false, + "type": "array", + "items": { + "type": "string" + }, + "collectionFormat": "multi" + }, + { + "name": "limit", + "description": "(Optional) The number of items to return", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "offset", + "description": "(Optional) The offset in the list of item to return", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "order", + "description": "(Optional) Sorts the list in the ascending or the descending order", + "in": "query", + "required": false, + "type": "string" + } + ], + "tags": [ + "RegionalDeployments" + ] + } + }, + "/v1/regional_deployments": { "get": { - "summary": "List Organization Invitations", - "operationId": "ListOrganizationInvitations", + "summary": "List Regional Deployments", + "description": "Experimental: use at your own risk", + "operationId": "ListRegionalDeployments", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/ListOrganizationInvitationsReply" + "$ref": "#/definitions/ListRegionalDeploymentsReply" } }, "400": { @@ -8077,57 +7592,42 @@ }, "parameters": [ { - "name": "limit", - "description": "(Optional) The number of items to return", + "name": "deployment_id", + "description": "(Optional) Filter on deployment id", "in": "query", "required": false, "type": "string" }, { - "name": "offset", - "description": "(Optional) The offset in the list of item to return", + "name": "limit", + "description": "(Optional) The number of items to return", "in": "query", "required": false, "type": "string" }, { - "name": "statuses", - "description": "(Optional) Filter on organization invitation statuses", - "in": "query", - "required": false, - "type": "array", - "items": { - "type": "string", - "enum": [ - "INVALID", - "PENDING", - "ACCEPTED", - "REFUSED", - "EXPIRED" - ] - }, - "collectionFormat": "multi" - }, - { - "name": "user_id", - "description": "(Optional) Filter on invitee ID. Will match both invitations sent to\nthat user_id and invitations sent to the email of that user_id.\nThe only valid value is the requester's user_id", + "name": "offset", + "description": "(Optional) The offset in the list of item to return", "in": "query", "required": false, "type": "string" } ], "tags": [ - "OrganizationInvitations" + "RegionalDeployments" ] - }, - "post": { - "summary": "Create Organization Invitation", - "operationId": "CreateOrganizationInvitation", + } + }, + "/v1/regional_deployments/{id}": { + "get": { + "summary": "Get Regional Deployment", + "description": "Experimental: use at your own risk", + "operationId": "GetRegionalDeployment", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/CreateOrganizationInvitationReply" + "$ref": "#/definitions/GetRegionalDeploymentReply" } }, "400": { @@ -8175,28 +7675,27 @@ }, "parameters": [ { - "name": "body", - "in": "body", + "name": "id", + "description": "The id of the regional deployment", + "in": "path", "required": true, - "schema": { - "$ref": "#/definitions/CreateOrganizationInvitationRequest" - } + "type": "string" } ], "tags": [ - "OrganizationInvitations" + "RegionalDeployments" ] } }, - "/v1/organization_invitations/{id}": { + "/v1/snapshots": { "get": { - "summary": "Get Organization Invitation", - "operationId": "GetOrganizationInvitation", + "summary": "List all Snapshots", + "operationId": "ListSnapshots", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/GetOrganizationInvitationReply" + "$ref": "#/definitions/ListSnapshotsReply" } }, "400": { @@ -8244,25 +7743,65 @@ }, "parameters": [ { - "name": "id", - "description": "The id of the invitation to get", - "in": "path", - "required": true, + "name": "limit", + "description": "(Optional) The number of items to return", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "offset", + "description": "(Optional) The offset in the list of item to return", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "organization_id", + "description": "(Optional) Filter by organization_id", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "statuses", + "description": "(Optional) Filter by status\n\n - SNAPSHOT_STATUS_INVALID: zero value, invalid\n - SNAPSHOT_STATUS_CREATING: the snapshot is being created\n - SNAPSHOT_STATUS_AVAILABLE: the snapshot is complete and available\n - SNAPSHOT_STATUS_MIGRATING: the snapshot is being migrated\n - SNAPSHOT_STATUS_DELETING: the snapshot is being deleted\n - SNAPSHOT_STATUS_DELETED: the snapshot is deleted", + "in": "query", + "required": false, + "type": "array", + "items": { + "type": "string", + "enum": [ + "SNAPSHOT_STATUS_INVALID", + "SNAPSHOT_STATUS_CREATING", + "SNAPSHOT_STATUS_AVAILABLE", + "SNAPSHOT_STATUS_MIGRATING", + "SNAPSHOT_STATUS_DELETING", + "SNAPSHOT_STATUS_DELETED" + ] + }, + "collectionFormat": "multi" + }, + { + "name": "region", + "description": "(Optional) A filter for the region", + "in": "query", + "required": false, "type": "string" } ], "tags": [ - "OrganizationInvitations" + "Snapshots" ] }, - "delete": { - "summary": "Delete Organization Invitation", - "operationId": "DeleteOrganizationInvitation", + "post": { + "summary": "Create a Snapshot", + "operationId": "CreateSnapshot", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/DeleteOrganizationInvitationReply" + "$ref": "#/definitions/CreateSnapshotReply" } }, "400": { @@ -8310,27 +7849,28 @@ }, "parameters": [ { - "name": "id", - "description": "The id of the organization invitation to delete", - "in": "path", + "name": "body", + "in": "body", "required": true, - "type": "string" + "schema": { + "$ref": "#/definitions/CreateSnapshotRequest" + } } ], "tags": [ - "OrganizationInvitations" + "Snapshots" ] } }, - "/v1/organization_invitations/{id}/resend": { - "post": { - "summary": "Resend Organization Invitation", - "operationId": "ResendOrganizationInvitation", + "/v1/snapshots/{id}": { + "get": { + "summary": "Get a Snapshot", + "operationId": "GetSnapshot", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/ResendOrganizationInvitationReply" + "$ref": "#/definitions/GetSnapshotReply" } }, "400": { @@ -8379,34 +7919,23 @@ "parameters": [ { "name": "id", - "description": "The id of the organization invitation to resend", "in": "path", "required": true, "type": "string" - }, - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object" - } } ], "tags": [ - "OrganizationInvitations" + "Snapshots" ] - } - }, - "/v1/organization_confirmations/{id}": { - "post": { - "summary": "Confirm organization action", - "operationId": "ConfirmOrganizationAction", + }, + "delete": { + "summary": "Delete a Snapshot", + "operationId": "DeleteSnapshot", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/ConfirmOrganizationActionReply" + "$ref": "#/definitions/DeleteSnapshotReply" } }, "400": { @@ -8461,18 +7990,17 @@ } ], "tags": [ - "OrganizationConfirmations" + "Snapshots" ] - } - }, - "/v1/organizations/{organization_id}/quotas": { - "get": { - "operationId": "GetQuotas", + }, + "post": { + "summary": "Update a Snapshot", + "operationId": "UpdateSnapshot", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/GetQuotasReply" + "$ref": "#/definitions/UpdateSnapshotReply" } }, "400": { @@ -8520,26 +8048,41 @@ }, "parameters": [ { - "name": "organization_id", + "name": "id", + "description": "The id of the snapshot", "in": "path", "required": true, "type": "string" + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "title": "Change the name of the snapshot" + } + } + } } ], "tags": [ - "OrganizationQuotas" + "Snapshots" ] } }, - "/v1/organizations/{organization_id}/summary": { + "/v1/service_events": { "get": { - "summary": "Get organization usage summary", - "operationId": "GetOrganizationSummary", + "summary": "List Service events", + "operationId": "ListServiceEvents", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/GetOrganizationSummaryReply" + "$ref": "#/definitions/ListServiceEventsReply" } }, "400": { @@ -8587,27 +8130,59 @@ }, "parameters": [ { - "name": "organization_id", - "description": "Organization ID", - "in": "path", - "required": true, + "name": "service_id", + "description": "(Optional) Filter on service id", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "types", + "description": "(Optional) Filter on service event types", + "in": "query", + "required": false, + "type": "array", + "items": { + "type": "string" + }, + "collectionFormat": "multi" + }, + { + "name": "limit", + "description": "(Optional) The number of items to return", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "offset", + "description": "(Optional) The offset in the list of item to return", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "order", + "description": "(Optional) Sorts the list in the ascending or the descending order", + "in": "query", + "required": false, "type": "string" } ], "tags": [ - "Summary" + "Services" ] } }, - "/v1/organization_members": { + "/v1/services": { "get": { - "summary": "List organization members", - "operationId": "ListOrganizationMembers", + "summary": "List Services", + "operationId": "ListServices", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/ListOrganizationMembersReply" + "$ref": "#/definitions/ListServicesReply" } }, "400": { @@ -8654,6 +8229,13 @@ } }, "parameters": [ + { + "name": "app_id", + "description": "(Optional) The id of the app", + "in": "query", + "required": false, + "type": "string" + }, { "name": "limit", "description": "(Optional) The number of items to return", @@ -8669,54 +8251,83 @@ "type": "string" }, { - "name": "organization_id", - "description": "(Optional) Filter for an organization", + "name": "name", + "description": "(Optional) A filter for name", "in": "query", "required": false, "type": "string" }, { - "name": "user_id", - "description": "(Optional) Filter for an user", + "name": "types", + "description": "(Optional) Filter on service types", "in": "query", "required": false, - "type": "string" + "type": "array", + "items": { + "type": "string", + "enum": [ + "INVALID_TYPE", + "WEB", + "WORKER", + "DATABASE", + "SANDBOX" + ] + }, + "collectionFormat": "multi" }, { - "name": "organization_statuses", - "description": "(Optional) Filter for organization statuses", + "name": "statuses", + "description": "(Optional) Filter on service statuses", "in": "query", "required": false, "type": "array", "items": { "type": "string", "enum": [ - "WARNING", - "LOCKED", - "ACTIVE", - "DEACTIVATING", - "DEACTIVATED", + "STARTING", + "HEALTHY", + "DEGRADED", + "UNHEALTHY", "DELETING", - "DELETED" + "DELETED", + "PAUSING", + "PAUSED", + "RESUMING" ] }, "collectionFormat": "multi" + }, + { + "name": "regions", + "description": "(Optional) Filter on regions", + "in": "query", + "required": false, + "type": "array", + "items": { + "type": "string" + }, + "collectionFormat": "multi" + }, + { + "name": "project_id", + "description": "(Optional) A filter for the project ID", + "in": "query", + "required": false, + "type": "string" } ], "tags": [ - "OrganizationMembers" + "Services" ] - } - }, - "/v1/organization_members/{id}": { - "delete": { - "summary": "Remove an organization member", - "operationId": "RemoveOrganizationMember", + }, + "post": { + "summary": "Create Service", + "operationId": "CreateService", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/RemoveOrganizationMemberReply" + "$ref": "#/definitions/CreateServiceReply" } }, "400": { @@ -8764,25 +8375,36 @@ }, "parameters": [ { - "name": "id", - "in": "path", + "name": "service", + "in": "body", "required": true, - "type": "string" + "schema": { + "$ref": "#/definitions/CreateService" + } + }, + { + "name": "dry_run", + "description": "If set only run validation", + "in": "query", + "required": false, + "type": "boolean" } ], "tags": [ - "OrganizationMembers" + "Services" ] } }, - "/v1/account/activities": { - "get": { - "operationId": "GetAccountActivities", + "/v1/services-autocomplete": { + "post": { + "summary": "Autocomplete definition", + "description": "Generate autocomplete definition for a service", + "operationId": "Autocomplete", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/ActivityList" + "$ref": "#/definitions/AutocompleteReply" } }, "400": { @@ -8830,32 +8452,28 @@ }, "parameters": [ { - "name": "limit", - "in": "query", - "required": false, - "type": "string" - }, - { - "name": "offset", - "in": "query", - "required": false, - "type": "string" + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/AutocompleteRequest" + } } ], "tags": [ - "activity" + "Services" ] } }, - "/v1/account/idenfy": { + "/v1/services/{id}": { "get": { - "summary": "Begin a session with iDenfy, emit an authToken", - "operationId": "GetIdenfyToken", + "summary": "Get Service", + "operationId": "GetService", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/GetIdenfyTokenReply" + "$ref": "#/definitions/GetServiceReply" } }, "400": { @@ -8901,18 +8519,28 @@ } } }, + "parameters": [ + { + "name": "id", + "description": "The id of the Service", + "in": "path", + "required": true, + "type": "string" + } + ], "tags": [ - "Profile" + "Services" ] }, - "post": { - "summary": "ClearIdenfyVerificationResult marks the current result for idenfy as\nsuperseded", - "operationId": "ClearIdenfyVerificationResult", + "delete": { + "summary": "Delete Service", + "description": "Service deletion is allowed for all status.", + "operationId": "DeleteService", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/ClearIdenfyVerificationResultReply" + "$ref": "#/definitions/DeleteServiceReply" } }, "400": { @@ -8960,27 +8588,25 @@ }, "parameters": [ { - "name": "body", - "in": "body", + "name": "id", + "description": "The id of the entity to delete", + "in": "path", "required": true, - "schema": { - "$ref": "#/definitions/ClearIdenfyVerificationResultRequest" - } + "type": "string" } ], "tags": [ - "Profile" + "Services" ] - } - }, - "/v1/account/invite": { - "post": { - "operationId": "CreateInvite", + }, + "put": { + "summary": "Update Service", + "operationId": "UpdateService", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/Empty" + "$ref": "#/definitions/UpdateServiceReply" } }, "400": { @@ -9028,28 +8654,46 @@ }, "parameters": [ { - "name": "body", + "name": "id", + "description": "The id of the entity to update", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "service", "in": "body", "required": true, "schema": { - "$ref": "#/definitions/InviteUserRequest" + "$ref": "#/definitions/UpdateService" } + }, + { + "name": "update_mask", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "dry_run", + "description": "If set, run validation and check that the service exists", + "in": "query", + "required": false, + "type": "boolean" } ], "tags": [ - "invite" + "Services" ] - } - }, - "/v1/account/login_method": { - "get": { - "summary": "Get the login method for an email address", - "operationId": "LoginMethod", + }, + "patch": { + "summary": "Update Service", + "operationId": "UpdateService2", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/LoginMethodReply" + "$ref": "#/definitions/UpdateServiceReply" } }, "400": { @@ -9097,26 +8741,49 @@ }, "parameters": [ { - "name": "email", + "name": "id", + "description": "The id of the entity to update", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "service", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/UpdateService" + } + }, + { + "name": "update_mask", "in": "query", "required": false, "type": "string" + }, + { + "name": "dry_run", + "description": "If set, run validation and check that the service exists", + "in": "query", + "required": false, + "type": "boolean" } ], "tags": [ - "Profile" + "Services" ] } }, - "/v1/account/oauth": { - "get": { - "summary": "Get OAuth Providers", - "operationId": "GetOAuthOptions", + "/v1/services/{id}/pause": { + "post": { + "summary": "Pause Service", + "description": "Service pause action is allowed for the following status:\n - starting\n - healthy\n - degraded\n - unhealthy\n - resuming", + "operationId": "PauseService", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/GetOAuthOptionsReply" + "$ref": "#/definitions/PauseServiceReply" } }, "400": { @@ -9164,38 +8831,27 @@ }, "parameters": [ { - "name": "action", - "description": "Which authentication flow is being initiated", - "in": "query", - "required": false, - "type": "string", - "enum": [ - "signin", - "signup", - "register" - ], - "default": "signin" - }, - { - "name": "metadata", - "description": "A small (limited to 400 characters) string of arbitrary metadata which will\nbe encoded in the state", - "in": "query", - "required": false, + "name": "id", + "description": "The id of the service to pause.", + "in": "path", + "required": true, "type": "string" } ], "tags": [ - "Profile" + "Services" ] - }, + } + }, + "/v1/services/{id}/redeploy": { "post": { - "summary": "Authenticate using OAuth", - "operationId": "OAuthCallback", + "summary": "ReDeploy Service", + "operationId": "ReDeploy", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/OAuthCallbackReply" + "$ref": "#/definitions/RedeployReply" } }, "400": { @@ -9243,35 +8899,35 @@ }, "parameters": [ { - "name": "body", + "name": "id", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "info", "in": "body", "required": true, "schema": { - "$ref": "#/definitions/OAuthCallbackRequest" + "$ref": "#/definitions/RedeployRequest.Info" } - }, - { - "name": "seon-fp", - "description": "Seon Fingerprint", - "in": "header", - "required": false, - "type": "string" } ], "tags": [ - "Profile" + "Services" ] } }, - "/v1/account/organization": { - "get": { - "summary": "Get Current Organization", - "operationId": "GetCurrentOrganization", + "/v1/services/{id}/resume": { + "post": { + "summary": "Resume Service", + "description": "Service resume action is allowed for the following status:\n - paused", + "operationId": "ResumeService", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/GetOrganizationReply" + "$ref": "#/definitions/ResumeServiceReply" } }, "400": { @@ -9317,20 +8973,43 @@ } } }, + "parameters": [ + { + "name": "id", + "description": "The id of the service to pause.", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "skip_build", + "description": "If set to true, the build stage will be skipped and the image coming from the last successful build step will be used instead.\nThe call fails if no previous successful builds happened.", + "in": "query", + "required": false, + "type": "boolean" + }, + { + "name": "use_cache", + "in": "query", + "required": false, + "type": "boolean" + } + ], "tags": [ - "Profile" + "Services" ] } }, - "/v1/account/organization_invitations": { + "/v1/services/{id}/scale": { "get": { - "summary": "List User Organization Invitations", - "operationId": "ListUserOrganizationInvitations", + "summary": "Get Service Scaling", + "description": "Returns the current scaling configuration for a service", + "operationId": "GetServiceScaling", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/ListUserOrganizationInvitationsReply" + "$ref": "#/definitions/GetServiceScalingReply" } }, "400": { @@ -9378,52 +9057,26 @@ }, "parameters": [ { - "name": "limit", - "description": "(Optional) The number of items to return", - "in": "query", - "required": false, - "type": "string" - }, - { - "name": "offset", - "description": "(Optional) The offset in the list of item to return", - "in": "query", - "required": false, + "name": "id", + "description": "The id of the service", + "in": "path", + "required": true, "type": "string" - }, - { - "name": "statuses", - "description": "(Optional) Filter on organization invitation statuses", - "in": "query", - "required": false, - "type": "array", - "items": { - "type": "string", - "enum": [ - "INVALID", - "PENDING", - "ACCEPTED", - "REFUSED", - "EXPIRED" - ] - }, - "collectionFormat": "multi" } ], "tags": [ - "Profile" + "Services" ] - } - }, - "/v1/account/organization_invitations/{id}": { - "get": { - "summary": "Get User Organization Invitation", - "operationId": "GetUserOrganizationInvitation", + }, + "delete": { + "summary": "Delete Service Scaling", + "description": "Deletes the manual scaling configuration for a service, reverting to \nthe scaling defined in the deployment definition.", + "operationId": "DeleteServiceScaling", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/GetUserOrganizationInvitationReply" + "$ref": "#/definitions/DeleteServiceScalingReply" } }, "400": { @@ -9472,26 +9125,25 @@ "parameters": [ { "name": "id", - "description": "The id of the organization invitation to get", + "description": "The id of the service", "in": "path", "required": true, "type": "string" } ], "tags": [ - "Profile" + "Services" ] - } - }, - "/v1/account/organization_invitations/{id}/accept": { - "post": { - "summary": "Accept Organization Invitation", - "operationId": "AcceptOrganizationInvitation", + }, + "put": { + "summary": "Update Service Scaling", + "description": "Stores or updates the scaling configuration for a service to use manual scaling", + "operationId": "UpdateServiceScaling", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/AcceptOrganizationInvitationReply" + "$ref": "#/definitions/UpdateServiceScalingReply" } }, "400": { @@ -9540,7 +9192,7 @@ "parameters": [ { "name": "id", - "description": "The id of the organization invitation to accept", + "description": "The id of the service to scale", "in": "path", "required": true, "type": "string" @@ -9550,24 +9202,33 @@ "in": "body", "required": true, "schema": { - "type": "object" + "type": "object", + "properties": { + "scalings": { + "type": "array", + "items": { + "$ref": "#/definitions/ManualServiceScaling" + }, + "title": "The new scaling configuration" + } + } } } ], "tags": [ - "Profile" + "Services" ] } }, - "/v1/account/organization_invitations/{id}/decline": { - "post": { - "summary": "Decline Organization Invitation", - "operationId": "DeclineOrganizationInvitation", + "/v1/deployment/{id}/scaling": { + "get": { + "summary": "Get Deployment Scaling", + "operationId": "GetDeploymentScaling", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/DeclineOrganizationInvitationReply" + "$ref": "#/definitions/GetDeploymentScalingReply" } }, "400": { @@ -9616,35 +9277,40 @@ "parameters": [ { "name": "id", - "description": "The id of the organization invitation to decline", "in": "path", "required": true, "type": "string" }, { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object" - } + "name": "region", + "description": "(Optional) Filter on region", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "replica_index", + "description": "(Optional) Filter on replica_index", + "in": "query", + "required": false, + "type": "integer", + "format": "int64" } ], "tags": [ - "Profile" + "Deployments" ] } }, - "/v1/account/organizations": { + "/v1/deployment_events": { "get": { - "summary": "List User Organizations", - "description": "List all organizations that the current user is a member of.", - "operationId": "ListUserOrganizations", + "summary": "List Deployment events", + "operationId": "ListDeploymentEvents", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/ListUserOrganizationsReply" + "$ref": "#/definitions/ListDeploymentEventsReply" } }, "400": { @@ -9692,68 +9358,59 @@ }, "parameters": [ { - "name": "limit", - "description": "(Optional) Define pagination limit", + "name": "deployment_id", + "description": "(Optional) Filter on deployment id", "in": "query", "required": false, "type": "string" }, { - "name": "offset", - "description": "(Optional) Define pagination offset", + "name": "types", + "description": "(Optional) Filter on deployment event types", "in": "query", "required": false, - "type": "string" + "type": "array", + "items": { + "type": "string" + }, + "collectionFormat": "multi" }, { - "name": "order", - "description": "(Optional) Sorts the list in the ascending or the descending order", + "name": "limit", + "description": "(Optional) The number of items to return", "in": "query", "required": false, "type": "string" }, { - "name": "search", - "description": "(Optional) Fuzzy case-insensitive search based on organization name or\norganization id", + "name": "offset", + "description": "(Optional) The offset in the list of item to return", "in": "query", "required": false, "type": "string" }, { - "name": "statuses", - "description": "(Optional) Only return organizations which status match one in the list", + "name": "order", + "description": "(Optional) Sorts the list in the ascending or the descending order", "in": "query", "required": false, - "type": "array", - "items": { - "type": "string", - "enum": [ - "WARNING", - "LOCKED", - "ACTIVE", - "DEACTIVATING", - "DEACTIVATED", - "DELETING", - "DELETED" - ] - }, - "collectionFormat": "multi" + "type": "string" } ], "tags": [ - "Profile" + "Deployments" ] } }, - "/v1/account/profile": { + "/v1/deployments": { "get": { - "summary": "Get Current User", - "operationId": "GetCurrentUser", + "summary": "List Deployments", + "operationId": "ListDeployments", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/UserReply" + "$ref": "#/definitions/ListDeploymentsReply" } }, "400": { @@ -9801,25 +9458,77 @@ }, "parameters": [ { - "name": "seon-fp", - "description": "Seon Fingerprint", - "in": "header", + "name": "app_id", + "description": "(Optional) Filter on application id", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "service_id", + "description": "(Optional) Filter on service id", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "limit", + "description": "(Optional) The number of items to return", + "in": "query", "required": false, "type": "string" + }, + { + "name": "offset", + "description": "(Optional) The offset in the list of item to return", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "statuses", + "description": "(Optional) Filter on statuses", + "in": "query", + "required": false, + "type": "array", + "items": { + "type": "string", + "enum": [ + "PENDING", + "PROVISIONING", + "SCHEDULED", + "CANCELING", + "CANCELED", + "ALLOCATING", + "STARTING", + "HEALTHY", + "DEGRADED", + "UNHEALTHY", + "STOPPING", + "STOPPED", + "ERRORING", + "ERROR", + "STASHED", + "SLEEPING" + ] + }, + "collectionFormat": "multi" } ], "tags": [ - "Profile" + "Deployments" ] - }, - "put": { - "summary": "Update User", - "operationId": "UpdateUser", + } + }, + "/v1/deployments/{id}": { + "get": { + "summary": "Get Deployment", + "operationId": "GetDeployment", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/UserReply" + "$ref": "#/definitions/GetDeploymentReply" } }, "400": { @@ -9867,32 +9576,28 @@ }, "parameters": [ { - "name": "user", - "in": "body", + "name": "id", + "description": "The id of the deployment", + "in": "path", "required": true, - "schema": { - "$ref": "#/definitions/UpdateUserRequest.UserUpdateBody" - } - }, - { - "name": "update_mask", - "in": "query", - "required": false, "type": "string" } ], "tags": [ - "Profile" + "Deployments" ] - }, - "patch": { - "summary": "Update User", - "operationId": "UpdateUser2", + } + }, + "/v1/deployments/{id}/cancel": { + "post": { + "summary": "Cancel Deployment", + "description": "Deployment cancellation is allowed for the following status:\n - pending\n - provisioning\n - scheduled", + "operationId": "CancelDeployment", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/UserReply" + "$ref": "#/definitions/CancelDeploymentReply" } }, "400": { @@ -9940,34 +9645,27 @@ }, "parameters": [ { - "name": "user", - "in": "body", + "name": "id", + "description": "The id of the deployment to cancel.", + "in": "path", "required": true, - "schema": { - "$ref": "#/definitions/UpdateUserRequest.UserUpdateBody" - } - }, - { - "name": "update_mask", - "in": "query", - "required": false, "type": "string" } ], "tags": [ - "Profile" + "Deployments" ] } }, - "/v1/account/resend_validation": { + "/v1/provisioning/{deployment_id}/status/{stage}/{attempt}": { "post": { - "summary": "Resend Email Verification", - "operationId": "ResendEmailValidation", + "summary": "Create an attempt for a stage", + "operationId": "CreateStageAttempt", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/ResendEmailValidationReply" + "$ref": "#/definitions/CreateStageAttemptReply" } }, "400": { @@ -10014,29 +9712,69 @@ } }, "parameters": [ + { + "name": "deployment_id", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "stage", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "attempt", + "in": "path", + "required": true, + "type": "string" + }, { "name": "body", "in": "body", "required": true, "schema": { - "$ref": "#/definitions/ResendEmailValidationRequest" + "type": "object", + "properties": { + "secret": { + "type": "string" + }, + "status": { + "$ref": "#/definitions/DeploymentProvisioningInfo.Stage.Status" + }, + "started_at": { + "type": "string", + "format": "date-time" + }, + "messages": { + "type": "array", + "items": { + "type": "string" + } + }, + "steps": { + "type": "array", + "items": { + "type": "string" + } + } + } } } ], "tags": [ - "Profile" + "Provisioning" ] - } - }, - "/v1/account/reset_password": { - "post": { - "summary": "Reset Password", - "operationId": "ResetPassword", + }, + "patch": { + "summary": "Declare stage progress", + "operationId": "DeclareStageProgress", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/ResetPasswordReply" + "$ref": "#/definitions/DeclareStageProgressReply" } }, "400": { @@ -10083,28 +9821,74 @@ } }, "parameters": [ + { + "name": "deployment_id", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "stage", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "attempt", + "in": "path", + "required": true, + "type": "string" + }, { "name": "body", "in": "body", "required": true, "schema": { - "$ref": "#/definitions/ResetPasswordRequest" + "type": "object", + "properties": { + "secret": { + "type": "string" + }, + "status": { + "$ref": "#/definitions/DeploymentProvisioningInfo.Stage.Status" + }, + "finished_at": { + "type": "string", + "format": "date-time" + }, + "messages": { + "type": "array", + "items": { + "type": "string" + } + }, + "image_pushed": { + "type": "boolean" + }, + "internal_failure": { + "type": "boolean" + }, + "retryable_failure": { + "type": "boolean" + } + } } } ], "tags": [ - "Profile" + "Provisioning" ] } }, - "/v1/account/settings": { - "get": { - "operationId": "GetUserSettings", + "/v1/provisioning/{deployment_id}/status/{stage}/{attempt}/{step}": { + "patch": { + "summary": "Declare step progress", + "operationId": "DeclareStepProgress", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/GetUserSettingsReply" + "$ref": "#/definitions/DeclareStepProgressReply" } }, "400": { @@ -10150,17 +9934,77 @@ } } }, + "parameters": [ + { + "name": "deployment_id", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "stage", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "attempt", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "step", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object", + "properties": { + "secret": { + "type": "string" + }, + "status": { + "$ref": "#/definitions/DeploymentProvisioningInfo.Stage.Status" + }, + "started_at": { + "type": "string", + "format": "date-time" + }, + "finished_at": { + "type": "string", + "format": "date-time" + }, + "messages": { + "type": "array", + "items": { + "type": "string" + } + } + } + } + } + ], "tags": [ - "Profile" + "Provisioning" ] - }, - "patch": { - "operationId": "UpdateUserSettings", + } + }, + "/v1/docker-helper/verify": { + "get": { + "summary": "Verify Docker Image", + "description": "Verify if a docker image is reachable", + "operationId": "VerifyDockerImage", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/UpdateUserSettingsReply" + "$ref": "#/definitions/VerifyDockerImageReply" } }, "400": { @@ -10208,28 +10052,34 @@ }, "parameters": [ { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/UpdateUserSettingsRequest" - } + "name": "image", + "description": "The full image uri to be verified", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "secret_id", + "description": "(Optional) the id of the secret to use to authenticate to the registry", + "in": "query", + "required": false, + "type": "string" } ], "tags": [ - "Profile" + "DockerHelper" ] } }, - "/v1/account/signup": { - "post": { - "summary": "Signup", - "operationId": "Signup", + "/v1/secrets": { + "get": { + "summary": "List Secrets", + "operationId": "ListSecrets", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/LoginReply" + "$ref": "#/definitions/ListSecretsReply" } }, "400": { @@ -10277,36 +10127,59 @@ }, "parameters": [ { - "name": "body", - "description": "Create new account", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/CreateAccountRequest" - } + "name": "name", + "in": "query", + "required": false, + "type": "string" }, { - "name": "seon-fp", - "description": "Seon Fingerprint", - "in": "header", + "name": "limit", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "offset", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "types", + "description": "Filter by secret types", + "in": "query", + "required": false, + "type": "array", + "items": { + "type": "string", + "enum": [ + "SIMPLE", + "REGISTRY", + "MANAGED" + ] + }, + "collectionFormat": "multi" + }, + { + "name": "project_id", + "description": "(Optional) A filter for the project ID", + "in": "query", "required": false, "type": "string" } ], "tags": [ - "Profile" + "Secrets" ] - } - }, - "/v1/account/update_password": { + }, "post": { - "summary": "Update Password", - "operationId": "UpdatePassword", + "summary": "Create Secret", + "operationId": "CreateSecret", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/LoginReply" + "$ref": "#/definitions/CreateSecretReply" } }, "400": { @@ -10354,35 +10227,28 @@ }, "parameters": [ { - "name": "body", + "name": "secret", "in": "body", "required": true, "schema": { - "$ref": "#/definitions/UpdatePasswordRequest" + "$ref": "#/definitions/CreateSecret" } - }, - { - "name": "seon-fp", - "description": "Seon Fingerprint", - "in": "header", - "required": false, - "type": "string" } ], "tags": [ - "Profile" + "Secrets" ] } }, - "/v1/account/validate/{id}": { - "post": { - "summary": "Validate", - "operationId": "Validate", + "/v1/secrets/{id}": { + "get": { + "summary": "Get Secret", + "operationId": "GetSecret", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/LoginReply" + "$ref": "#/definitions/GetSecretReply" } }, "400": { @@ -10434,30 +10300,20 @@ "in": "path", "required": true, "type": "string" - }, - { - "name": "seon-fp", - "description": "Seon Fingerprint", - "in": "header", - "required": false, - "type": "string" } ], "tags": [ - "Profile" + "Secrets" ] - } - }, - "/v1/billing/has_unpaid_invoices": { - "get": { - "summary": "Experimental: Has unpaid invoices", - "description": "WARNING: Please don't use the following method.\nKoyeb doesn't guarantee backwards compatible breaking change and reserve\nthe right to completely drop it without notice. USE AT YOUR OWN RISK.", - "operationId": "HasUnpaidInvoices", + }, + "delete": { + "summary": "Delete Secret", + "operationId": "DeleteSecret", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/HasUnpaidInvoicesReply" + "$ref": "#/definitions/DeleteSecretReply" } }, "400": { @@ -10503,19 +10359,26 @@ } } }, + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "type": "string" + } + ], "tags": [ - "billing" + "Secrets" ] - } - }, - "/v1/billing/manage": { - "get": { - "operationId": "Manage", + }, + "put": { + "summary": "Update Secret", + "operationId": "UpdateSecret", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/ManageReply" + "$ref": "#/definitions/UpdateSecretReply" } }, "400": { @@ -10561,21 +10424,40 @@ } } }, - "tags": [ - "billing" - ] - } - }, - "/v1/billing/next_invoice": { - "get": { - "summary": "Experimental: Fetch next invoice", - "description": "WARNING: Please don't use the following method.\nKoyeb doesn't guarantee backwards compatible breaking change and reserve\nthe right to completely drop it without notice. USE AT YOUR OWN RISK.", - "operationId": "NextInvoice", - "responses": { - "200": { - "description": "A successful response.", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "secret", + "in": "body", + "required": true, "schema": { - "$ref": "#/definitions/NextInvoiceReply" + "$ref": "#/definitions/Secret" + } + }, + { + "name": "update_mask", + "in": "query", + "required": false, + "type": "string" + } + ], + "tags": [ + "Secrets" + ] + }, + "patch": { + "summary": "Update Secret", + "operationId": "UpdateSecret2", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/UpdateSecretReply" } }, "400": { @@ -10621,20 +10503,42 @@ } } }, + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "secret", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/Secret" + } + }, + { + "name": "update_mask", + "in": "query", + "required": false, + "type": "string" + } + ], "tags": [ - "billing" + "Secrets" ] } }, - "/v1/github/installation": { - "get": { - "summary": "Fetch Github Installation configuration", - "operationId": "GetGithubInstallation", + "/v1/secrets/{id}/reveal": { + "post": { + "summary": "Reveal Secret", + "operationId": "RevealSecret", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/GetGithubInstallationReply" + "$ref": "#/definitions/RevealSecretReply" } }, "400": { @@ -10680,18 +10584,36 @@ } } }, + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object" + } + } + ], "tags": [ - "organization" + "Secrets" ] - }, - "post": { - "summary": "Start Github Installation", - "operationId": "GithubInstallation", + } + }, + "/v1/domains": { + "get": { + "summary": "List Domains", + "operationId": "ListDomains", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/GithubInstallationReply" + "$ref": "#/definitions/ListDomainsReply" } }, "400": { @@ -10739,28 +10661,90 @@ }, "parameters": [ { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/GithubInstallationRequest" - } + "name": "limit", + "description": "(Optional) The number of items to return", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "offset", + "description": "(Optional) The offset in the list of item to return", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "types", + "description": "(Optional) A filter for types\n\n - AUTOASSIGNED: Domain like -.koyeb.app", + "in": "query", + "required": false, + "type": "array", + "items": { + "type": "string", + "enum": [ + "AUTOASSIGNED", + "CUSTOM" + ] + }, + "collectionFormat": "multi" + }, + { + "name": "statuses", + "description": "(Optional) A filter for statuses", + "in": "query", + "required": false, + "type": "array", + "items": { + "type": "string", + "enum": [ + "PENDING", + "ACTIVE", + "ERROR", + "DELETING", + "DELETED" + ] + }, + "collectionFormat": "multi" + }, + { + "name": "app_ids", + "description": "(Optional) A filter for apps", + "in": "query", + "required": false, + "type": "array", + "items": { + "type": "string" + }, + "collectionFormat": "multi" + }, + { + "name": "name", + "description": "(Optional) A filter for name", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "project_id", + "description": "(Optional) A filter for the project ID", + "in": "query", + "required": false, + "type": "string" } ], "tags": [ - "organization" + "Domains" ] - } - }, - "/v1/organizations": { + }, "post": { - "summary": "Create Organization", - "operationId": "CreateOrganization", + "summary": "Create Domain", + "operationId": "CreateDomain", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/CreateOrganizationReply" + "$ref": "#/definitions/CreateDomainReply" } }, "400": { @@ -10808,28 +10792,28 @@ }, "parameters": [ { - "name": "body", + "name": "domain", "in": "body", "required": true, "schema": { - "$ref": "#/definitions/CreateOrganizationRequest" + "$ref": "#/definitions/CreateDomain" } } ], "tags": [ - "organization" + "Domains" ] } }, - "/v1/organizations/{id}": { + "/v1/domains/{id}": { "get": { - "summary": "Get Organization", - "operationId": "GetOrganization", + "summary": "Get Domain", + "operationId": "GetDomain", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/GetOrganizationReply" + "$ref": "#/definitions/GetDomainReply" } }, "400": { @@ -10884,17 +10868,17 @@ } ], "tags": [ - "organization" + "Domains" ] }, "delete": { - "summary": "Delete an Organization", - "operationId": "DeleteOrganization", + "summary": "Delete Domain", + "operationId": "DeleteDomain", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/DeleteOrganizationReply" + "$ref": "#/definitions/DeleteDomainReply" } }, "400": { @@ -10949,17 +10933,17 @@ } ], "tags": [ - "organization" + "Domains" ] }, - "put": { - "summary": "Update Organization", - "operationId": "UpdateOrganization", + "patch": { + "summary": "Update Domain", + "operationId": "UpdateDomain", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/UpdateOrganizationReply" + "$ref": "#/definitions/UpdateDomainReply" } }, "400": { @@ -11013,11 +10997,11 @@ "type": "string" }, { - "name": "organization", + "name": "domain", "in": "body", "required": true, "schema": { - "$ref": "#/definitions/Organization" + "$ref": "#/definitions/UpdateDomain" } }, { @@ -11025,20 +11009,29 @@ "in": "query", "required": false, "type": "string" + }, + { + "name": "dry_run", + "description": "If set, run validation and check that the domain is available.", + "in": "query", + "required": false, + "type": "boolean" } ], "tags": [ - "organization" + "Domains" ] - }, - "patch": { - "summary": "Update Organization", - "operationId": "UpdateOrganization2", + } + }, + "/v1/domains/{id}/refresh": { + "post": { + "summary": "Refresh Domain Status", + "operationId": "RefreshDomainStatus", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/UpdateOrganizationReply" + "$ref": "#/definitions/RefreshDomainStatusReply" } }, "400": { @@ -11090,37 +11083,22 @@ "in": "path", "required": true, "type": "string" - }, - { - "name": "organization", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/Organization" - } - }, - { - "name": "update_mask", - "in": "query", - "required": false, - "type": "string" } ], "tags": [ - "organization" + "Domains" ] } }, - "/v1/organizations/{id}/access_token": { - "post": { - "summary": "CreateAccessToken", - "description": "CreateAccessToken creates a short-lived access token in the scope of the\nspecified organization, provided the user making the request is part of\nsaid organization.\n\nIt's possible to specify a validity for the token, which defaults to 1h\nand must be no more than 24h. The format is `s`, where ``\nis a floating point in seconds (so `123.456789012s` means 123 seconds and\n456789012 nanoseconds). See:\nhttps://protobuf.dev/reference/php/api-docs/Google/Protobuf/Duration.html.", - "operationId": "CreateAccessToken", + "/v1/app_events": { + "get": { + "summary": "List App events", + "operationId": "ListAppEvents", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/CreateAccessTokenReply" + "$ref": "#/definitions/ListAppEventsReply" } }, "400": { @@ -11168,41 +11146,59 @@ }, "parameters": [ { - "name": "id", - "description": "Organization id for ephemeral credential", - "in": "path", - "required": true, + "name": "app_id", + "description": "(Optional) Filter on app id", + "in": "query", + "required": false, "type": "string" }, { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "validity": { - "type": "string", - "title": "Validity of the credential" - } - } - } + "name": "types", + "description": "(Optional) Filter on app event types", + "in": "query", + "required": false, + "type": "array", + "items": { + "type": "string" + }, + "collectionFormat": "multi" + }, + { + "name": "limit", + "description": "(Optional) The number of items to return", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "offset", + "description": "(Optional) The offset in the list of item to return", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "order", + "description": "(Optional) Sorts the list in the ascending or the descending order", + "in": "query", + "required": false, + "type": "string" } ], "tags": [ - "organization" + "Apps" ] } }, - "/v1/organizations/{id}/deactivate": { - "post": { - "summary": "Deactivate an Organization", - "operationId": "DeactivateOrganization", + "/v1/apps": { + "get": { + "summary": "List App", + "operationId": "ListApps", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/DeactivateOrganizationReply" + "$ref": "#/definitions/ListAppsReply" } }, "400": { @@ -11250,40 +11246,46 @@ }, "parameters": [ { - "name": "id", - "in": "path", - "required": true, + "name": "limit", + "description": "(Optional) The number of items to return", + "in": "query", + "required": false, "type": "string" }, { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "skip_confirmation": { - "type": "boolean", - "description": "if set to true, skip_confirmation will directly start the deactivation\nprocess, without sending a confirmation email beforehand." - } - } - } + "name": "offset", + "description": "(Optional) The offset in the list of item to return", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "name", + "description": "(Optional) A filter for name", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "project_id", + "description": "(Optional) A filter for the project ID", + "in": "query", + "required": false, + "type": "string" } ], "tags": [ - "organization" + "Apps" ] - } - }, - "/v1/organizations/{id}/name": { - "put": { - "summary": "Update Organization", - "operationId": "UpdateOrganizationName", + }, + "post": { + "summary": "Create App", + "operationId": "CreateApp", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/UpdateOrganizationNameReply" + "$ref": "#/definitions/CreateAppReply" } }, "400": { @@ -11331,39 +11333,28 @@ }, "parameters": [ { - "name": "id", - "in": "path", - "required": true, - "type": "string" - }, - { - "name": "body", + "name": "app", "in": "body", "required": true, "schema": { - "type": "object", - "properties": { - "name": { - "type": "string" - } - } + "$ref": "#/definitions/CreateApp" } } ], "tags": [ - "organization" + "Apps" ] } }, - "/v1/organizations/{id}/plan": { - "post": { - "summary": "Update Organization plan", - "operationId": "UpdateOrganizationPlan", + "/v1/apps/{id}": { + "get": { + "summary": "Get App", + "operationId": "GetApp", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/UpdateOrganizationPlanReply" + "$ref": "#/definitions/GetAppReply" } }, "400": { @@ -11412,38 +11403,25 @@ "parameters": [ { "name": "id", + "description": "The id of the App", "in": "path", "required": true, "type": "string" - }, - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "plan": { - "$ref": "#/definitions/Plan" - } - } - } } ], "tags": [ - "organization" + "Apps" ] - } - }, - "/v1/organizations/{id}/reactivate": { - "post": { - "summary": "Reactivate an Organization", - "operationId": "ReactivateOrganization", + }, + "delete": { + "summary": "Delete App", + "description": "App deletion is allowed for all status.", + "operationId": "DeleteApp", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/ReactivateOrganizationReply" + "$ref": "#/definitions/DeleteAppReply" } }, "400": { @@ -11492,33 +11470,24 @@ "parameters": [ { "name": "id", + "description": "The id of the App to delete", "in": "path", "required": true, "type": "string" - }, - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object" - } } ], "tags": [ - "organization" + "Apps" ] - } - }, - "/v1/organizations/{id}/signup_qualification": { - "post": { - "summary": "Upsert Organization's signup qualification", - "operationId": "UpsertSignupQualification", + }, + "put": { + "summary": "Update App", + "operationId": "UpdateApp", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/UpsertSignupQualificationReply" + "$ref": "#/definitions/UpdateAppReply" } }, "400": { @@ -11567,38 +11536,38 @@ "parameters": [ { "name": "id", + "description": "The id of the app to update.", "in": "path", "required": true, "type": "string" }, { - "name": "body", + "name": "app", "in": "body", "required": true, "schema": { - "type": "object", - "properties": { - "signup_qualification": { - "type": "object" - } - } + "$ref": "#/definitions/UpdateApp" } + }, + { + "name": "update_mask", + "in": "query", + "required": false, + "type": "string" } ], "tags": [ - "organization" + "Apps" ] - } - }, - "/v1/organizations/{id}/switch": { - "post": { - "summary": "Switch Organization context", - "operationId": "SwitchOrganization", + }, + "patch": { + "summary": "Update App", + "operationId": "UpdateApp2", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/LoginReply" + "$ref": "#/definitions/UpdateAppReply" } }, "400": { @@ -11647,40 +11616,41 @@ "parameters": [ { "name": "id", + "description": "The id of the app to update.", "in": "path", "required": true, "type": "string" }, { - "name": "body", + "name": "app", "in": "body", "required": true, "schema": { - "type": "object" + "$ref": "#/definitions/UpdateApp" } }, { - "name": "seon-fp", - "description": "Seon Fingerprint", - "in": "header", + "name": "update_mask", + "in": "query", "required": false, "type": "string" } ], "tags": [ - "organization" + "Apps" ] } }, - "/v1/organizations/{organization_id}/budget": { - "get": { - "summary": "Get Budget", - "operationId": "GetBudget", + "/v1/apps/{id}/pause": { + "post": { + "summary": "Pause App", + "description": "App pause action is allowed for the following status:\n - starting\n - healthy\n - degraded\n - unhealthy\n - resuming", + "operationId": "PauseApp", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/GetBudgetReply" + "$ref": "#/definitions/PauseAppReply" } }, "400": { @@ -11728,24 +11698,28 @@ }, "parameters": [ { - "name": "organization_id", + "name": "id", + "description": "The id of the app to pause.", "in": "path", "required": true, "type": "string" } ], "tags": [ - "organization" + "Apps" ] - }, - "delete": { - "summary": "Delete Budget", - "operationId": "DeleteBudget", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/DeleteBudgetReply" + } + }, + "/v1/apps/{id}/resume": { + "post": { + "summary": "Resume App", + "description": "App resume action is allowed for the following status:\n - paused", + "operationId": "ResumeApp", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/ResumeAppReply" } }, "400": { @@ -11793,24 +11767,27 @@ }, "parameters": [ { - "name": "organization_id", + "name": "id", + "description": "The id of the app to resume.", "in": "path", "required": true, "type": "string" } ], "tags": [ - "organization" + "Apps" ] - }, - "post": { - "summary": "Create Budget", - "operationId": "CreateBudget", + } + }, + "/v1/volume_events": { + "get": { + "summary": "List Persistent Volume events", + "operationId": "ListPersistentVolumeEvents", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/CreateBudgetReply" + "$ref": "#/definitions/ListPersistentVolumeEventsReply" } }, "400": { @@ -11858,39 +11835,59 @@ }, "parameters": [ { - "name": "organization_id", - "in": "path", - "required": true, + "name": "persistent_volume_id", + "description": "(Optional) Filter on persistent volume id", + "in": "query", + "required": false, "type": "string" }, { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "amount": { - "type": "string", - "format": "int64", - "description": "In cents." - } - } - } + "name": "types", + "description": "(Optional) Filter on persistent volume event types", + "in": "query", + "required": false, + "type": "array", + "items": { + "type": "string" + }, + "collectionFormat": "multi" + }, + { + "name": "limit", + "description": "(Optional) The number of items to return", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "offset", + "description": "(Optional) The offset in the list of item to return", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "order", + "description": "(Optional) Sorts the list in the ascending or the descending order", + "in": "query", + "required": false, + "type": "string" } ], "tags": [ - "organization" + "PersistentVolumes" ] - }, - "put": { - "summary": "Update Budget", - "operationId": "UpdateBudget", + } + }, + "/v1/volumes": { + "get": { + "summary": "List all PersistentVolumes", + "operationId": "ListPersistentVolumes", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/UpdateBudgetReply" + "$ref": "#/definitions/ListPersistentVolumesReply" } }, "400": { @@ -11938,40 +11935,60 @@ }, "parameters": [ { - "name": "organization_id", - "in": "path", - "required": true, + "name": "limit", + "description": "(Optional) The number of items to return", + "in": "query", + "required": false, "type": "string" }, { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "amount": { - "type": "string", - "format": "int64", - "description": "In cents." - } - } - } + "name": "offset", + "description": "(Optional) The offset in the list of item to return", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "service_id", + "description": "(Optional) A filter for the service id", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "region", + "description": "(Optional) A filter for the region", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "name", + "description": "(Optional) A filter for the name", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "project_id", + "description": "(Optional) A filter for the project ID", + "in": "query", + "required": false, + "type": "string" } ], "tags": [ - "organization" + "PersistentVolumes" ] - } - }, - "/v1/sso/canny": { + }, "post": { - "operationId": "CannyAuth", + "summary": "Create a PersistentVolume", + "operationId": "CreatePersistentVolume", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/CannyAuthReply" + "$ref": "#/definitions/CreatePersistentVolumeReply" } }, "400": { @@ -12023,23 +12040,24 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/CannyAuthRequest" + "$ref": "#/definitions/CreatePersistentVolumeRequest" } } ], "tags": [ - "sso" + "PersistentVolumes" ] } }, - "/v1/sso/discourse": { - "post": { - "operationId": "DiscourseAuth", + "/v1/volumes/{id}": { + "get": { + "summary": "Get a PersistentVolume", + "operationId": "GetPersistentVolume", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/DiscourseAuthReply" + "$ref": "#/definitions/GetPersistentVolumeReply" } }, "400": { @@ -12087,29 +12105,24 @@ }, "parameters": [ { - "name": "body", - "in": "body", + "name": "id", + "in": "path", "required": true, - "schema": { - "$ref": "#/definitions/DiscourseAuthRequest" - } + "type": "string" } ], "tags": [ - "sso" + "PersistentVolumes" ] - } - }, - "/v1/unscope_organization_token": { - "post": { - "summary": "Unscope Organization Token", - "description": "UnscopeOrganizationToken removes the organization scope from a token. This\nendpoint is useful when a user wants to remove an organization: by\nunscoping the token first, the user can then delete the organization\nwithout invalidating his token.", - "operationId": "UnscopeOrganizationToken", + }, + "delete": { + "summary": "Delete a PersistentVolume", + "operationId": "DeletePersistentVolume", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/LoginReply" + "$ref": "#/definitions/DeletePersistentVolumeReply" } }, "400": { @@ -12157,35 +12170,24 @@ }, "parameters": [ { - "name": "body", - "in": "body", + "name": "id", + "in": "path", "required": true, - "schema": { - "$ref": "#/definitions/UnscopeOrganizationTokenRequest" - } - }, - { - "name": "seon-fp", - "description": "Seon Fingerprint", - "in": "header", - "required": false, "type": "string" } ], "tags": [ - "organization" + "PersistentVolumes" ] - } - }, - "/v2/account/profile": { - "put": { - "summary": "Update User V2", - "operationId": "UpdateUserV2", + }, + "post": { + "summary": "Update a PersistentVolume", + "operationId": "UpdatePersistentVolume", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/UserReply" + "$ref": "#/definitions/UpdatePersistentVolumeReply" } }, "400": { @@ -12233,32 +12235,46 @@ }, "parameters": [ { - "name": "user", + "name": "id", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "body", "in": "body", "required": true, "schema": { - "$ref": "#/definitions/UpdateUserRequest.UserUpdateBody" + "type": "object", + "properties": { + "name": { + "type": "string", + "title": "(Optional) change the name of the volume" + }, + "max_size": { + "type": "integer", + "format": "int64", + "title": "(Optional) increase the volume size (in Gigabyte / GB)" + } + } } - }, - { - "name": "update_mask", - "in": "query", - "required": false, - "type": "string" } ], "tags": [ - "Profile" + "PersistentVolumes" ] - }, - "patch": { - "summary": "Update User V2", - "operationId": "UpdateUserV22", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/UserReply" + } + }, + "/v1/archives": { + "post": { + "summary": "Create Archive", + "description": "Create a signed URL to upload an archive.", + "operationId": "CreateArchive", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/CreateArchiveReply" } }, "400": { @@ -12306,991 +12322,1520 @@ }, "parameters": [ { - "name": "user", + "name": "archive", "in": "body", "required": true, "schema": { - "$ref": "#/definitions/UpdateUserRequest.UserUpdateBody" + "$ref": "#/definitions/CreateArchive" + } + } + ], + "tags": [ + "Archives" + ] + } + }, + "/v1/instance_events": { + "get": { + "summary": "List Instance events", + "operationId": "ListInstanceEvents", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/ListInstanceEventsReply" + } + }, + "400": { + "description": "Validation error", + "schema": { + "$ref": "#/definitions/ErrorWithFields" + } + }, + "401": { + "description": "Returned when the token is not valid.", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "403": { + "description": "Returned when the user does not have permission to access the resource.", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "404": { + "description": "Returned when the resource does not exist.", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "500": { + "description": "Returned in case of server error.", + "schema": { + "$ref": "#/definitions/Error" } }, + "503": { + "description": "Service is unavailable.", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/google.rpc.Status" + } + } + }, + "parameters": [ { - "name": "update_mask", + "name": "instance_ids", + "description": "(Optional) Filter on list of instance id", + "in": "query", + "required": false, + "type": "array", + "items": { + "type": "string" + }, + "collectionFormat": "multi" + }, + { + "name": "types", + "description": "(Optional) Filter on instance event types", + "in": "query", + "required": false, + "type": "array", + "items": { + "type": "string" + }, + "collectionFormat": "multi" + }, + { + "name": "limit", + "description": "(Optional) The number of items to return", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "offset", + "description": "(Optional) The offset in the list of item to return", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "order", + "description": "(Optional) Sorts the list in the ascending or the descending order", "in": "query", "required": false, "type": "string" } ], "tags": [ - "Profile" + "Instances" ] } - } - }, - "definitions": { - "google.protobuf.Any": { - "type": "object", - "properties": { - "@type": { - "type": "string" - } - }, - "additionalProperties": {} - }, - "google.rpc.Status": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32" - }, - "message": { - "type": "string" - }, - "details": { - "type": "array", - "items": { - "$ref": "#/definitions/google.protobuf.Any" - } - } - } - }, - "Error": { - "type": "object", - "properties": { - "status": { - "type": "integer", - "format": "int32" - }, - "code": { - "type": "string" - }, - "message": { - "type": "string" - } - } - }, - "ErrorField": { - "type": "object", - "properties": { - "field": { - "type": "string" - }, - "description": { - "type": "string" - } - } }, - "ErrorWithFields": { - "type": "object", - "properties": { - "status": { - "type": "integer", - "format": "int32" - }, - "code": { - "type": "string" - }, - "message": { - "type": "string" - }, - "fields": { - "type": "array", - "items": { - "$ref": "#/definitions/ErrorField" + "/v1/instances": { + "get": { + "summary": "List Instances", + "operationId": "ListInstances", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/ListInstancesReply" + } + }, + "400": { + "description": "Validation error", + "schema": { + "$ref": "#/definitions/ErrorWithFields" + } + }, + "401": { + "description": "Returned when the token is not valid.", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "403": { + "description": "Returned when the user does not have permission to access the resource.", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "404": { + "description": "Returned when the resource does not exist.", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "500": { + "description": "Returned in case of server error.", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "503": { + "description": "Service is unavailable.", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/google.rpc.Status" + } } - } - } - }, - "kgitproxy.Branch": { - "type": "object", - "properties": { - "id": { - "type": "string" - }, - "organization_id": { - "type": "string" }, - "repository_id": { - "type": "string" - }, - "name": { - "type": "string" + "parameters": [ + { + "name": "app_id", + "description": "(Optional) Filter on application id", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "service_id", + "description": "(Optional) Filter on service id", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "deployment_id", + "description": "(Optional) Filter on deployment id", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "regional_deployment_id", + "description": "(Optional) Filter on regional deployment id", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "allocation_id", + "description": "(Optional) Filter on allocation id", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "replica_index", + "description": "(Optional) Filter on replica index", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "statuses", + "description": "(Optional) Filter on instance statuses", + "in": "query", + "required": false, + "type": "array", + "items": { + "type": "string", + "enum": [ + "ALLOCATING", + "STARTING", + "HEALTHY", + "UNHEALTHY", + "STOPPING", + "STOPPED", + "ERROR", + "SLEEPING" + ] + }, + "collectionFormat": "multi" + }, + { + "name": "limit", + "description": "(Optional) The number of items to return", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "offset", + "description": "(Optional) The offset in the list of item to return", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "order", + "description": "(Optional) Sorts the list in the ascending or the descending order", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "starting_time", + "description": "(Optional) The starting time of the period of running instance", + "in": "query", + "required": false, + "type": "string", + "format": "date-time" + }, + { + "name": "ending_time", + "description": "(Optional) The ending time of the period of running instance", + "in": "query", + "required": false, + "type": "string", + "format": "date-time" + } + ], + "tags": [ + "Instances" + ] + } + }, + "/v1/instances/{id}": { + "get": { + "summary": "Get Instance", + "operationId": "GetInstance", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/GetInstanceReply" + } + }, + "400": { + "description": "Validation error", + "schema": { + "$ref": "#/definitions/ErrorWithFields" + } + }, + "401": { + "description": "Returned when the token is not valid.", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "403": { + "description": "Returned when the user does not have permission to access the resource.", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "404": { + "description": "Returned when the resource does not exist.", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "500": { + "description": "Returned in case of server error.", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "503": { + "description": "Service is unavailable.", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/google.rpc.Status" + } + } }, - "is_default": { - "type": "boolean" + "parameters": [ + { + "name": "id", + "description": "The id of the instance", + "in": "path", + "required": true, + "type": "string" + } + ], + "tags": [ + "Instances" + ] + } + }, + "/v1/quotas/capacity": { + "post": { + "summary": "DEPRECATED: Review Organization Capacity", + "operationId": "ReviewOrganizationCapacity", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/ReviewOrganizationCapacityReply" + } + }, + "400": { + "description": "Validation error", + "schema": { + "$ref": "#/definitions/ErrorWithFields" + } + }, + "401": { + "description": "Returned when the token is not valid.", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "403": { + "description": "Returned when the user does not have permission to access the resource.", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "404": { + "description": "Returned when the resource does not exist.", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "500": { + "description": "Returned in case of server error.", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "503": { + "description": "Service is unavailable.", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/google.rpc.Status" + } + } }, - "is_protected": { - "type": "boolean" + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/ReviewOrganizationCapacityRequest" + } + } + ], + "tags": [ + "Quotas" + ] + } + }, + "/v1/compose": { + "post": { + "summary": "Create resources from compose.", + "operationId": "Compose", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/ComposeReply" + } + }, + "400": { + "description": "Validation error", + "schema": { + "$ref": "#/definitions/ErrorWithFields" + } + }, + "401": { + "description": "Returned when the token is not valid.", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "403": { + "description": "Returned when the user does not have permission to access the resource.", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "404": { + "description": "Returned when the resource does not exist.", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "500": { + "description": "Returned in case of server error.", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "503": { + "description": "Service is unavailable.", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/google.rpc.Status" + } + } }, - "provider": { - "$ref": "#/definitions/kgitproxy.RepositoryProvider" - } + "parameters": [ + { + "name": "compose", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/CreateCompose" + } + } + ], + "tags": [ + "Compose" + ] } }, - "kgitproxy.GitHubRepository": { - "type": "object", - "properties": { - "github_id": { - "type": "string" - } + "/v1/usages": { + "get": { + "summary": "Get organization usage", + "operationId": "GetOrganizationUsage", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/GetOrganizationUsageReply" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/google.rpc.Status" + } + } + }, + "parameters": [ + { + "name": "starting_time", + "description": "The starting time of the period to get data from", + "in": "query", + "required": false, + "type": "string", + "format": "date-time" + }, + { + "name": "ending_time", + "description": "The ending time of the period to get data from", + "in": "query", + "required": false, + "type": "string", + "format": "date-time" + } + ], + "tags": [ + "Usages" + ] } }, - "kgitproxy.ListBranchesReply": { - "type": "object", - "properties": { - "branches": { - "type": "array", - "items": { - "$ref": "#/definitions/kgitproxy.Branch" + "/v1/usages/details": { + "get": { + "summary": "Get organization usage details", + "operationId": "GetOrganizationUsageDetails", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/GetOrganizationUsageDetailsReply" + } }, - "description": "The collection of branches." - }, - "limit": { - "type": "integer", - "format": "int64", - "description": "The limit in the request." - }, - "offset": { - "type": "integer", - "format": "int64", - "description": "The offset in the request." + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/google.rpc.Status" + } + } }, - "count": { - "type": "integer", - "format": "int64", - "description": "The total number of items." - } + "parameters": [ + { + "name": "starting_time", + "description": "The starting time of the period to get data from", + "in": "query", + "required": false, + "type": "string", + "format": "date-time" + }, + { + "name": "ending_time", + "description": "The ending time of the period to get data from", + "in": "query", + "required": false, + "type": "string", + "format": "date-time" + }, + { + "name": "limit", + "description": "(Optional) The number of items to return", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "offset", + "description": "(Optional) The offset in the list of item to return", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "order", + "description": "(Optional) Sorts the list in the ascending or the descending order", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "Accept", + "description": "If defined with the value 'text/csv', a csv file is returned", + "in": "header", + "required": false, + "type": "string" + } + ], + "tags": [ + "Usages" + ] } }, - "kgitproxy.ListRepositoriesReply": { - "type": "object", - "properties": { - "repositories": { - "type": "array", - "items": { - "$ref": "#/definitions/kgitproxy.Repository" + "/v1/catalog/regions": { + "get": { + "summary": "List Region", + "operationId": "ListRegions", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/ListRegionsReply" + } }, - "description": "The collection of repositories." - }, - "limit": { - "type": "integer", - "format": "int64", - "description": "The limit in the request." - }, - "offset": { - "type": "integer", - "format": "int64", - "description": "The offset in the request." + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/google.rpc.Status" + } + } }, - "count": { - "type": "integer", - "format": "int64", - "description": "The total number of items." - } + "parameters": [ + { + "name": "limit", + "description": "(Optional) The number of items to return", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "offset", + "description": "(Optional) The offset in the list of item to return", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "id", + "description": "(Optional) A filter for regions", + "in": "query", + "required": false, + "type": "string" + } + ], + "tags": [ + "CatalogRegions" + ] } }, - "kgitproxy.Repository": { - "type": "object", - "properties": { - "id": { - "type": "string" - }, - "organization_id": { - "type": "string" - }, - "name": { - "type": "string" - }, - "url": { - "type": "string" - }, - "description": { - "type": "string" - }, - "is_private": { - "type": "boolean" - }, - "is_disabled": { - "type": "boolean" - }, - "default_branch": { - "type": "string" - }, - "provider": { - "$ref": "#/definitions/kgitproxy.RepositoryProvider" - }, - "last_push_date": { - "type": "string", - "format": "date-time" + "/v1/catalog/regions/{id}": { + "get": { + "summary": "Get Region", + "operationId": "GetRegion", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/GetRegionReply" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/google.rpc.Status" + } + } }, - "github": { - "$ref": "#/definitions/kgitproxy.GitHubRepository" - } + "parameters": [ + { + "name": "id", + "description": "The name of the region", + "in": "path", + "required": true, + "type": "string" + } + ], + "tags": [ + "CatalogRegions" + ] } }, - "kgitproxy.RepositoryProvider": { - "type": "string", - "enum": [ - "INVALID_PROVIDER", - "GITHUB" - ], - "default": "INVALID_PROVIDER" - }, - "kgitproxy.ResyncOrganizationReply": { - "type": "object" - }, - "AppUsage": { - "type": "object", - "properties": { - "app_id": { - "type": "string" - }, - "app_name": { - "type": "string" - }, - "services": { - "type": "array", - "items": { - "$ref": "#/definitions/ServiceUsage" + "/v1/catalog/usage": { + "get": { + "operationId": "ListUsage", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/ListUsageReply" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/google.rpc.Status" + } } }, - "databases": { - "type": "array", - "items": { - "$ref": "#/definitions/DatabaseUsage" + "parameters": [ + { + "name": "region", + "in": "query", + "required": false, + "type": "string" } - } + ], + "tags": [ + "CatalogInstanceUsage" + ] } }, - "DatabaseUsage": { - "type": "object", - "properties": { - "service_id": { - "type": "string" - }, - "service_name": { - "type": "string" - }, - "compute_time_seconds": { - "type": "integer", - "format": "int64" + "/v1/catalog/instances": { + "get": { + "summary": "List Instances", + "operationId": "ListCatalogInstances", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/ListCatalogInstancesReply" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/google.rpc.Status" + } + } }, - "data_storage_megabytes_hours": { - "type": "integer", - "format": "int64" - } + "parameters": [ + { + "name": "limit", + "description": "(Optional) The number of items to return", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "offset", + "description": "(Optional) The offset in the list of item to return", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "id", + "description": "(Optional) A filter for instances", + "in": "query", + "required": false, + "type": "string" + } + ], + "tags": [ + "CatalogInstances" + ] } }, - "DatabaseUsageDetails": { - "type": "object", - "properties": { - "organization_id": { - "type": "string" - }, - "app_id": { - "type": "string" - }, - "app_name": { - "type": "string" - }, - "service_id": { - "type": "string" - }, - "service_name": { - "type": "string" - }, - "compute_time_seconds": { - "type": "integer", - "format": "int64" - }, - "data_storage_megabytes_hour": { - "type": "integer", - "format": "int64" + "/v1/catalog/instances/{id}": { + "get": { + "summary": "Get Instance", + "operationId": "GetCatalogInstance", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/GetCatalogInstanceReply" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/google.rpc.Status" + } + } }, - "started_at": { - "type": "string", - "format": "date-time" + "parameters": [ + { + "name": "id", + "description": "The name of the instance", + "in": "path", + "required": true, + "type": "string" + } + ], + "tags": [ + "CatalogInstances" + ] + } + }, + "/v1/catalog/datacenters": { + "get": { + "summary": "List datacenters", + "operationId": "ListDatacenters", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/ListDatacentersReply" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/google.rpc.Status" + } + } }, - "terminated_at": { - "type": "string", - "format": "date-time" - } + "tags": [ + "CatalogDatacenters" + ] } }, - "GetOrganizationUsageDetailsReply": { - "type": "object", - "properties": { - "usage_details": { - "type": "array", - "items": { - "$ref": "#/definitions/UsageDetails" + "/v1/search": { + "get": { + "summary": "Search", + "operationId": "Search", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/ksearch.SearchReply" + } + }, + "400": { + "description": "Validation error", + "schema": { + "$ref": "#/definitions/ErrorWithFields" + } + }, + "401": { + "description": "Returned when the token is not valid.", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "403": { + "description": "Returned when the user does not have permission to access the resource.", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "404": { + "description": "Returned when the resource does not exist.", + "schema": { + "$ref": "#/definitions/Error" + } }, - "title": "The collection of usage instances" - }, - "database_details": { - "type": "array", - "items": { - "$ref": "#/definitions/DatabaseUsageDetails" + "500": { + "description": "Returned in case of server error.", + "schema": { + "$ref": "#/definitions/Error" + } }, - "title": "The collection of database deployments used during the month" - }, - "limit": { - "type": "integer", - "format": "int64", - "title": "The limit in the request" - }, - "offset": { - "type": "integer", - "format": "int64", - "title": "The offset in the request" - }, - "count": { - "type": "integer", - "format": "int64", - "title": "The total number of items" + "503": { + "description": "Service is unavailable.", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/google.rpc.Status" + } + } }, - "order": { - "type": "string", - "title": "The order in the request" - } + "parameters": [ + { + "name": "query", + "description": "(Optional) Search query", + "in": "query", + "required": false, + "type": "string" + } + ], + "tags": [ + "Search" + ] } - }, - "GetOrganizationUsageReply": { + } + }, + "definitions": { + "google.protobuf.Any": { "type": "object", "properties": { - "usage": { - "$ref": "#/definitions/Usage", - "title": "The computed usage of instances per month" + "@type": { + "type": "string" } - } + }, + "additionalProperties": {} }, - "InstanceUsage": { + "google.rpc.Status": { "type": "object", "properties": { - "duration_seconds": { + "code": { "type": "integer", - "format": "int64" - } - } - }, - "PeriodUsage": { - "type": "object", - "properties": { - "starting_time": { - "type": "string", - "format": "date-time" + "format": "int32" }, - "ending_time": { - "type": "string", - "format": "date-time" + "message": { + "type": "string" }, - "apps": { + "details": { "type": "array", "items": { - "$ref": "#/definitions/AppUsage" + "$ref": "#/definitions/google.protobuf.Any" } } } }, - "RegionUsage": { + "Error": { "type": "object", "properties": { - "instances": { - "type": "object", - "additionalProperties": { - "$ref": "#/definitions/InstanceUsage" - } + "status": { + "type": "integer", + "format": "int32" + }, + "code": { + "type": "string" + }, + "message": { + "type": "string" } } }, - "ServiceUsage": { + "ErrorField": { "type": "object", "properties": { - "service_id": { + "field": { "type": "string" }, - "service_name": { + "description": { "type": "string" - }, - "regions": { - "type": "object", - "additionalProperties": { - "$ref": "#/definitions/RegionUsage" - } } } }, - "Usage": { + "ErrorWithFields": { "type": "object", "properties": { - "organization_id": { + "status": { + "type": "integer", + "format": "int32" + }, + "code": { "type": "string" }, - "periods": { - "type": "object", - "additionalProperties": { - "$ref": "#/definitions/PeriodUsage" + "message": { + "type": "string" + }, + "fields": { + "type": "array", + "items": { + "$ref": "#/definitions/ErrorField" } } } }, - "UsageDetails": { + "kgitproxy.Branch": { "type": "object", "properties": { - "organization_id": { - "type": "string" - }, - "instance_id": { - "type": "string" - }, - "app_id": { - "type": "string" - }, - "app_name": { - "type": "string" - }, - "service_id": { - "type": "string" - }, - "service_name": { - "type": "string" - }, - "regional_deployment_id": { + "id": { "type": "string" }, - "region": { + "organization_id": { "type": "string" }, - "deployment_id": { + "repository_id": { "type": "string" }, - "instance_type": { + "name": { "type": "string" }, - "duration_seconds": { - "type": "integer", - "format": "int64" - }, - "started_at": { - "type": "string", - "format": "date-time" - }, - "terminated_at": { - "type": "string", - "format": "date-time" - } - } - }, - "google.protobuf.NullValue": { - "type": "string", - "enum": [ - "NULL_VALUE" - ], - "default": "NULL_VALUE", - "description": "`NullValue` is a singleton enumeration to represent the null value for the\n`Value` type union.\n\n The JSON representation for `NullValue` is JSON `null`.\n\n - NULL_VALUE: Null value." - }, - "ArchiveSource": { - "type": "object", - "properties": { - "id": { - "type": "string", - "title": "The ID of the archive to deploy" - }, - "buildpack": { - "$ref": "#/definitions/BuildpackBuilder" - }, - "docker": { - "$ref": "#/definitions/DockerBuilder" - } - } - }, - "BuildpackBuilder": { - "type": "object", - "properties": { - "build_command": { - "type": "string", - "title": "A command used to override the build command, run after all build steps" + "is_default": { + "type": "boolean" }, - "run_command": { - "type": "string", - "title": "A command used to override the default run command" + "is_protected": { + "type": "boolean" }, - "privileged": { - "type": "boolean", - "title": "A flag to run the container in privileged mode" + "provider": { + "$ref": "#/definitions/kgitproxy.RepositoryProvider" } } }, - "ConfigFile": { + "kgitproxy.GitHubRepository": { "type": "object", "properties": { - "path": { - "type": "string", - "title": "the path where the file is copied" - }, - "permissions": { - "type": "string", - "title": "the permissions of the file in format 0644" - }, - "content": { - "type": "string", - "title": "the content of the file" + "github_id": { + "type": "string" } } }, - "DeploymentHealthCheck": { + "kgitproxy.ListBranchesReply": { "type": "object", "properties": { - "grace_period": { - "type": "integer", - "format": "int64", - "title": "An optional initial period in seconds to wait for the instance to become healthy, default is 5s" + "branches": { + "type": "array", + "items": { + "$ref": "#/definitions/kgitproxy.Branch" + }, + "description": "The collection of branches." }, - "interval": { + "limit": { "type": "integer", "format": "int64", - "title": "An optional period in seconds between two health checks, default is 60s" + "description": "The limit in the request." }, - "restart_limit": { + "offset": { "type": "integer", "format": "int64", - "title": "An optional number of consecutive failures before attempting to restart the service, default is 3" + "description": "The offset in the request." }, - "timeout": { + "count": { "type": "integer", "format": "int64", - "title": "An optional maximum time to wait in seconds before considering the check as a failure, default is 5s" - }, - "tcp": { - "$ref": "#/definitions/TCPHealthCheck" - }, - "http": { - "$ref": "#/definitions/HTTPHealthCheck" + "description": "The total number of items." } } }, - "DeploymentProvisioningInfo": { + "kgitproxy.ListRepositoriesReply": { "type": "object", "properties": { - "sha": { - "type": "string", - "description": "The git sha for this build (we resolve the reference at the start of the build)." - }, - "image": { - "type": "string", - "description": "The docker image built as a result of this build." - }, - "stages": { + "repositories": { "type": "array", "items": { - "$ref": "#/definitions/DeploymentProvisioningInfo.Stage" + "$ref": "#/definitions/kgitproxy.Repository" }, - "description": "Some info about the build." + "description": "The collection of repositories." + }, + "limit": { + "type": "integer", + "format": "int64", + "description": "The limit in the request." + }, + "offset": { + "type": "integer", + "format": "int64", + "description": "The offset in the request." + }, + "count": { + "type": "integer", + "format": "int64", + "description": "The total number of items." } } }, - "DeploymentProvisioningInfo.Stage": { + "kgitproxy.Repository": { "type": "object", "properties": { + "id": { + "type": "string" + }, + "organization_id": { + "type": "string" + }, "name": { "type": "string" }, - "status": { - "$ref": "#/definitions/DeploymentProvisioningInfo.Stage.Status" + "url": { + "type": "string" }, - "messages": { - "type": "array", - "items": { - "type": "string" - } + "description": { + "type": "string" }, - "started_at": { - "type": "string", - "format": "date-time" + "is_private": { + "type": "boolean" }, - "finished_at": { + "is_disabled": { + "type": "boolean" + }, + "default_branch": { + "type": "string" + }, + "provider": { + "$ref": "#/definitions/kgitproxy.RepositoryProvider" + }, + "last_push_date": { "type": "string", "format": "date-time" }, - "build_attempts": { - "type": "array", - "items": { - "$ref": "#/definitions/DeploymentProvisioningInfo.Stage.BuildAttempt" - } + "github": { + "$ref": "#/definitions/kgitproxy.GitHubRepository" } } }, - "DeploymentProvisioningInfo.Stage.BuildAttempt": { + "kgitproxy.RepositoryProvider": { + "type": "string", + "enum": [ + "INVALID_PROVIDER", + "GITHUB" + ], + "default": "INVALID_PROVIDER" + }, + "kgitproxy.ResyncOrganizationReply": { + "type": "object" + }, + "DeleteUserReply": { + "type": "object", + "properties": { + "user": { + "$ref": "#/definitions/User" + } + } + }, + "User": { "type": "object", + "example": { + "id": "78352123-a06f-4ec2-81ed-27a056725385", + "email": "john@snow.com", + "name": "John Snow", + "avatar_url": "https://www.gravatar.com/avatar/00000000000000000000000000000000", + "is_admin": false, + "is_test": true, + "two_factor_authentication": false, + "last_login": "0001-01-01T00:00:00Z", + "last_login_id": "10.1.1.1", + "updated_at": "0001-01-01T00:00:00Z", + "created_at": "0001-01-01T00:00:00Z", + "newsletter_subscribed": true, + "email_validated": true + }, "properties": { "id": { - "type": "integer", - "format": "int64" + "type": "string" }, - "status": { - "$ref": "#/definitions/DeploymentProvisioningInfo.Stage.Status" + "email": { + "type": "string" }, - "messages": { - "type": "array", - "items": { - "type": "string" - } + "avatar_url": { + "type": "string" }, - "started_at": { + "two_factor_authentication": { + "type": "boolean" + }, + "last_login": { "type": "string", "format": "date-time" }, - "finished_at": { + "last_login_ip": { + "type": "string" + }, + "updated_at": { "type": "string", "format": "date-time" }, - "steps": { + "created_at": { + "type": "string", + "format": "date-time" + }, + "newsletter_subscribed": { + "type": "boolean" + }, + "github_id": { + "type": "string" + }, + "github_user": { + "type": "string" + }, + "flags": { "type": "array", "items": { - "$ref": "#/definitions/DeploymentProvisioningInfo.Stage.BuildAttempt.BuildStep" + "$ref": "#/definitions/UserFlags" } }, - "image_pushed": { - "type": "boolean" + "name": { + "type": "string" }, - "internal_failure": { + "email_validated": { "type": "boolean" }, - "retryable_failure": { + "trialed": { "type": "boolean" + } + }, + "title": "Represent a User" + }, + "UserFlags": { + "type": "string", + "enum": [ + "ADMIN", + "TEST", + "RESTRICTED", + "ACTIVE", + "BETA", + "MAX_ORGANIZATIONS_25", + "MAX_ORGANIZATIONS_100", + "MAX_ORGANIZATIONS_1000", + "MAX_ORGANIZATIONS_10000", + "MAX_ORGANIZATIONS_100000", + "MAX_ORGANIZATIONS_1000000", + "PARTNER_CSP", + "IGNORE_ORGANIZATION_NAME_RESERVATION_RULE_NEON_PREFIX" + ], + "default": "ADMIN", + "title": "- ADMIN: A user is an admin user\n - TEST: A user is a test user\n - RESTRICTED: Whether this account as restricted access\n - ACTIVE: Whether this account is active\n - BETA: Account in beta program\n - MAX_ORGANIZATIONS_25: User can create this much organizations, overriding the default amount\n - PARTNER_CSP: User can create sub-organizations\n - IGNORE_ORGANIZATION_NAME_RESERVATION_RULE_NEON_PREFIX: User can bypass organization name reservations rules" + }, + "google.protobuf.NullValue": { + "type": "string", + "enum": [ + "NULL_VALUE" + ], + "default": "NULL_VALUE", + "description": "`NullValue` is a singleton enumeration to represent the null value for the\n`Value` type union.\n\n The JSON representation for `NullValue` is JSON `null`.\n\n - NULL_VALUE: Null value." + }, + "AcceptOrganizationInvitationReply": { + "type": "object", + "properties": { + "invitation": { + "$ref": "#/definitions/OrganizationInvitation", + "title": "The organization invitation accepted" + } + } + }, + "Action": { + "type": "string", + "enum": [ + "signin", + "signup", + "register" + ], + "default": "signin" + }, + "Budget": { + "type": "object", + "properties": { + "amount": { + "type": "string", + "format": "int64" }, - "wait_completion": { - "type": "boolean", - "description": "This flag is used to finalize the build, and continue the deployment in case of success, or cancel and potentially retry the build in case of failure." + "thresholds": { + "type": "array", + "items": { + "type": "string", + "format": "int64" + } + } + } + }, + "CannyAuthReply": { + "type": "object", + "properties": { + "token": { + "type": "string" + } + } + }, + "CannyAuthRequest": { + "type": "object" + }, + "ClearIdenfyVerificationResultReply": { + "type": "object" + }, + "ClearIdenfyVerificationResultRequest": { + "type": "object", + "properties": { + "user_id": { + "type": "string" + }, + "organization_id": { + "type": "string" } } }, - "DeploymentProvisioningInfo.Stage.BuildAttempt.BuildStep": { + "CreateAccessTokenReply": { "type": "object", "properties": { - "name": { + "token": { "type": "string" - }, - "status": { - "$ref": "#/definitions/DeploymentProvisioningInfo.Stage.Status" - }, - "messages": { - "type": "array", - "items": { - "type": "string" - } - }, - "started_at": { - "type": "string", - "format": "date-time" - }, - "finished_at": { - "type": "string", - "format": "date-time" } } }, - "DeploymentProvisioningInfo.Stage.Status": { - "type": "string", - "enum": [ - "UNKNOWN", - "PENDING", - "RUNNING", - "FAILED", - "COMPLETED", - "ABORTED" - ], - "default": "UNKNOWN" - }, - "DeploymentScalingTarget": { + "CreateAccountRequest": { "type": "object", + "example": { + "email": "john@snow.com", + "password": "..." + }, "properties": { - "average_cpu": { - "$ref": "#/definitions/DeploymentScalingTargetAverageCPU" - }, - "average_mem": { - "$ref": "#/definitions/DeploymentScalingTargetAverageMem" - }, - "requests_per_second": { - "$ref": "#/definitions/DeploymentScalingTargetRequestsPerSecond" + "email": { + "type": "string" }, - "concurrent_requests": { - "$ref": "#/definitions/DeploymentScalingTargetConcurrentRequests" + "password": { + "type": "string" }, - "requests_response_time": { - "$ref": "#/definitions/DeploymentScalingTargetRequestsResponseTime" + "name": { + "type": "string" }, - "sleep_idle_delay": { - "$ref": "#/definitions/DeploymentScalingTargetSleepIdleDelay" + "captcha": { + "type": "string" + } + }, + "description": "Create new account", + "title": "Create new account", + "required": [ + "email", + "password" + ] + }, + "CreateBudgetReply": { + "type": "object", + "properties": { + "budget": { + "$ref": "#/definitions/Budget" } } }, - "DeploymentScalingTargetAverageCPU": { + "CreateOrganizationReply": { "type": "object", "properties": { - "value": { - "type": "integer", - "format": "int64" + "organization": { + "$ref": "#/definitions/Organization" } } }, - "DeploymentScalingTargetAverageMem": { + "CreateOrganizationRequest": { "type": "object", "properties": { - "value": { - "type": "integer", - "format": "int64" + "name": { + "type": "string" } } }, - "DeploymentScalingTargetConcurrentRequests": { + "DeactivateOrganizationReply": { "type": "object", "properties": { - "value": { - "type": "integer", - "format": "int64" + "organization": { + "$ref": "#/definitions/Organization" } } }, - "DeploymentScalingTargetRequestsPerSecond": { + "DeclineOrganizationInvitationReply": { "type": "object", "properties": { - "value": { - "type": "integer", - "format": "int64" + "invitation": { + "$ref": "#/definitions/OrganizationInvitation", + "title": "The organization invitation declined" } } }, - "DeploymentScalingTargetRequestsResponseTime": { + "DeleteBudgetReply": { + "type": "object" + }, + "DeleteOrganizationReply": { "type": "object", "properties": { - "value": { - "type": "integer", - "format": "int64" - }, - "quantile": { - "type": "integer", - "format": "int64", - "description": "The quantile to use for autoscaling. For example, set to 95 to use the 95th\npercentile (p95) for autoscaling. Valid values are between 0 and 100." + "organization": { + "$ref": "#/definitions/Organization" } } }, - "DeploymentScalingTargetSleepIdleDelay": { + "DiscourseAuthReply": { "type": "object", "properties": { - "value": { - "type": "integer", - "format": "int64", - "description": "DEPRECATED: use deep_sleep_value instead.\nDelay in seconds after which a service which received 0 request is put to deep sleep." - }, - "deep_sleep_value": { - "type": "integer", - "format": "int64", - "description": "Delay in seconds after which a service which received 0 request is put to deep sleep." + "sso": { + "type": "string" }, - "light_sleep_value": { - "type": "integer", - "format": "int64", - "description": "Delay in seconds after which a service which received 0 request is put to light sleep." + "sig": { + "type": "string" } } }, - "DeploymentStrategy": { + "DiscourseAuthRequest": { "type": "object", "properties": { - "type": { - "$ref": "#/definitions/DeploymentStrategyType", - "title": "Strategy type" + "payload": { + "type": "string" + }, + "sig": { + "type": "string" } } }, - "DeploymentStrategyType": { - "type": "string", - "enum": [ - "DEPLOYMENT_STRATEGY_TYPE_INVALID", - "DEPLOYMENT_STRATEGY_TYPE_CANARY", - "DEPLOYMENT_STRATEGY_TYPE_ROLLING", - "DEPLOYMENT_STRATEGY_TYPE_BLUE_GREEN", - "DEPLOYMENT_STRATEGY_TYPE_IMMEDIATE" - ], - "default": "DEPLOYMENT_STRATEGY_TYPE_INVALID", - "description": " - DEPLOYMENT_STRATEGY_TYPE_INVALID: Invalid / Zero value.\n - DEPLOYMENT_STRATEGY_TYPE_CANARY: Use canary strategy.\n - DEPLOYMENT_STRATEGY_TYPE_ROLLING: Use rolling strategy.\n - DEPLOYMENT_STRATEGY_TYPE_BLUE_GREEN: Use blue green strategy.\n - DEPLOYMENT_STRATEGY_TYPE_IMMEDIATE: Use immediate strategy." + "GetBudgetReply": { + "type": "object", + "properties": { + "budget": { + "$ref": "#/definitions/Budget" + } + } }, - "DockerBuilder": { + "GetGithubInstallationReply": { "type": "object", "properties": { - "dockerfile": { - "type": "string", - "title": "A path to the Dockerfile" + "installation_id": { + "type": "string" }, - "entrypoint": { - "type": "array", - "items": { - "type": "string" - }, - "title": "The docker ENTRYPOINT" + "installation_url": { + "type": "string" }, - "command": { - "type": "string", - "title": "The docker CMD" + "name": { + "type": "string" }, - "args": { - "type": "array", - "items": { - "type": "string" - }, - "title": "The docker CMD args" + "avatar_url": { + "type": "string" }, - "target": { + "status": { + "$ref": "#/definitions/kgitproxy.GithubInstallation.Status" + }, + "installed_at": { "type": "string", - "title": "The target for multi-stage builds" + "format": "date-time" }, - "privileged": { - "type": "boolean", - "title": "A flag to run the container in privileged mode" + "suspended_at": { + "type": "string", + "format": "date-time" + }, + "indexing_status": { + "$ref": "#/definitions/kgitproxy.IndexingStatus" + }, + "indexed_repositories": { + "type": "integer", + "format": "int64" + }, + "total_repositories": { + "type": "integer", + "format": "int64" } } }, - "DockerSource": { + "GetIdenfyTokenReply": { "type": "object", "properties": { - "image": { - "type": "string" - }, - "command": { - "type": "string" - }, - "args": { - "type": "array", - "items": { - "type": "string" - } - }, - "image_registry_secret": { + "auth_token": { "type": "string" - }, - "entrypoint": { + } + } + }, + "GetOAuthOptionsReply": { + "type": "object", + "properties": { + "oauth_providers": { "type": "array", "items": { - "type": "string" + "$ref": "#/definitions/OAuthProvider" } - }, - "privileged": { - "type": "boolean", - "title": "A flag to run the container in privileged mode" + } + }, + "description": "A list of providers which you can use for single sign-on." + }, + "GetOrganizationReply": { + "type": "object", + "properties": { + "organization": { + "$ref": "#/definitions/Organization" } } }, - "Env": { + "GetUserOrganizationInvitationReply": { "type": "object", "properties": { - "key": { - "type": "string" - }, - "value": { - "type": "string" - }, - "secret": { - "type": "string" + "invitation": { + "$ref": "#/definitions/OrganizationInvitation" } } }, - "GetRegionalDeploymentReply": { + "GetUserSettingsReply": { "type": "object", "properties": { - "regional_deployment": { - "$ref": "#/definitions/RegionalDeployment" + "settings": { + "$ref": "#/definitions/UserSettings" } } }, - "GitSource": { + "GithubInstallationReply": { "type": "object", "properties": { - "repository": { - "type": "string", - "description": "A url to a git repository (contains the provider as well) .e.g: github.com/koyeb/test." - }, - "branch": { - "type": "string", - "title": "A git branch that will be tracked for new commits and deployments will be created" - }, - "tag": { + "app_name": { "type": "string", - "title": "A git tag that should be built" + "title": "The github app name" }, - "sha": { + "app_id": { "type": "string", - "title": "A git commit that should be built (useful for pinning to a commit, this will always be set when a deployment is created by a code push)" + "format": "int64", + "title": "The github app id" }, - "build_command": { + "url": { "type": "string", - "title": "A command used to override the build command, run after all build steps \u2014 deprecated, use buildpack.build_command instead" + "title": "The url to start the installation flow" }, - "run_command": { + "state": { "type": "string", - "title": "A command used to override the default run command - deprecated, use buildpack.run_command instead" - }, - "no_deploy_on_push": { - "type": "boolean", - "title": "A flag to disable a new deployment when a push event is detected" - }, - "workdir": { + "title": "The state required by the protocol, it is only valid 10 minutes and encodes\ninformation about the type of flow" + } + } + }, + "GithubInstallationRequest": { + "type": "object", + "properties": { + "metadata": { "type": "string", - "title": "A subdirectory to use as the build directory" - }, - "buildpack": { - "$ref": "#/definitions/BuildpackBuilder" - }, - "docker": { - "$ref": "#/definitions/DockerBuilder" + "title": "A small (limited to 400 characters) string of arbitrary metadata which will\nbe encoded in the state" } } }, - "HTTPHeader": { + "HasUnpaidInvoicesReply": { "type": "object", "properties": { - "key": { - "type": "string" - }, - "value": { - "type": "string" + "has_unpaid_invoices": { + "type": "boolean" } } }, - "HTTPHealthCheck": { + "InviteUserRequest": { "type": "object", "properties": { - "port": { - "type": "integer", - "format": "int64", - "title": "The port to use to perform the health check, must be declared in the ports section" - }, - "path": { - "type": "string", - "title": "The path to use to perform the HTTP health check" + "email": { + "type": "string" }, - "method": { - "type": "string", - "title": "An optional HTTP method to use to perform the health check, default is GET" + "name": { + "type": "string" }, - "headers": { - "type": "array", - "items": { - "$ref": "#/definitions/HTTPHeader" - }, - "title": "An optional list of HTTP headers to provide when performing the request, default is empty" + "message": { + "type": "string" } } }, - "ListRegionalDeploymentEventsReply": { + "ListUserOrganizationInvitationsReply": { "type": "object", "properties": { - "events": { + "invitations": { "type": "array", "items": { - "$ref": "#/definitions/RegionalDeploymentEvent" + "$ref": "#/definitions/OrganizationInvitation" }, - "title": "The collection of events" + "title": "The collection of organization invitations" }, "limit": { "type": "integer", @@ -13302,25 +13847,22 @@ "format": "int64", "title": "The offset in the request" }, - "order": { - "type": "string", - "title": "The order in the request" - }, - "has_next": { - "type": "boolean", - "title": "If there is more items after in the collection" + "count": { + "type": "integer", + "format": "int64", + "title": "The total number of items" } } }, - "ListRegionalDeploymentsReply": { + "ListUserOrganizationsReply": { "type": "object", "properties": { - "regional_deployments": { + "organizations": { "type": "array", "items": { - "$ref": "#/definitions/RegionalDeploymentListItem" + "$ref": "#/definitions/Organization" }, - "title": "The collection of regional deployments" + "title": "The collection of organizations" }, "limit": { "type": "integer", @@ -13332,1262 +13874,1291 @@ "format": "int64", "title": "The offset in the request" }, - "count": { - "type": "integer", - "format": "int64", - "title": "The total number of items" - }, "has_next": { "type": "boolean", "title": "If there is more items after in the collection" } } }, - "Port": { + "LoginMethodReply": { + "type": "object", + "properties": { + "method": { + "$ref": "#/definitions/LoginMethodReply.Method" + } + } + }, + "LoginMethodReply.Method": { + "type": "string", + "enum": [ + "KOYEB", + "WORKOS" + ], + "default": "KOYEB" + }, + "LoginReply": { + "type": "object", + "properties": { + "token": { + "$ref": "#/definitions/Token" + } + } + }, + "ManageReply": { + "type": "object", + "properties": { + "url": { + "type": "string" + } + } + }, + "NextInvoiceReply": { + "type": "object", + "properties": { + "stripe_invoice": { + "type": "object" + }, + "lines": { + "type": "array", + "items": { + "$ref": "#/definitions/NextInvoiceReply.Line" + } + }, + "discounts": { + "type": "array", + "items": { + "$ref": "#/definitions/NextInvoiceReply.Discount" + } + } + } + }, + "NextInvoiceReply.Discount": { + "type": "object", + "properties": { + "type": { + "$ref": "#/definitions/NextInvoiceReply.Discount.Type" + }, + "name": { + "type": "string" + }, + "amount": { + "type": "string", + "format": "int64" + } + } + }, + "NextInvoiceReply.Discount.Type": { + "type": "string", + "enum": [ + "PERCENT_OFF", + "AMOUNT_OFF" + ], + "default": "PERCENT_OFF" + }, + "NextInvoiceReply.Line": { + "type": "object", + "properties": { + "amount_excluding_tax": { + "type": "integer", + "format": "int32" + }, + "period": { + "$ref": "#/definitions/NextInvoiceReply.Line.Period" + }, + "plan_nickname": { + "type": "string" + }, + "price": { + "$ref": "#/definitions/NextInvoiceReply.Line.Price" + }, + "quantity": { + "type": "integer", + "format": "int32" + } + } + }, + "NextInvoiceReply.Line.Period": { + "type": "object", + "properties": { + "start": { + "type": "string", + "format": "date-time" + }, + "end": { + "type": "string", + "format": "date-time" + } + } + }, + "NextInvoiceReply.Line.Price": { + "type": "object", + "properties": { + "unit_amount_decimal": { + "type": "number", + "format": "double" + } + } + }, + "OAuthCallbackReply": { "type": "object", "properties": { - "port": { - "type": "integer", - "format": "int64" - }, - "protocol": { - "type": "string" + "token": { + "$ref": "#/definitions/Token", + "title": "A jwt token to be used for session" } } }, - "RegionalDeployment": { + "OAuthCallbackRequest": { "type": "object", "properties": { - "id": { - "type": "string" - }, - "created_at": { + "state": { "type": "string", - "format": "date-time" + "title": "The state created at the origin of the OAuth flow" }, - "updated_at": { + "code": { "type": "string", - "format": "date-time" + "title": "The code returned by the OAuth provider" }, - "scheduled_at": { + "setup_action": { "type": "string", - "format": "date-time" + "description": "setup_action is populated in the context of a GitHub app installation\nrequest. For logins and signups, it is not set." }, - "allocated_at": { + "installation_id": { "type": "string", - "format": "date-time" - }, - "started_at": { + "description": "installation_id is populated in the context of a GitHub app installation\nrequest. For logins and signups, it is not set." + } + } + }, + "OAuthProvider": { + "type": "object", + "properties": { + "id": { "type": "string", - "format": "date-time" + "title": "The name of the provider (.e.g github, google)" }, - "succeeded_at": { + "url": { "type": "string", - "format": "date-time" + "title": "The URL to call to initiate the OAuth flow" }, - "terminated_at": { + "state": { "type": "string", - "format": "date-time" + "title": "The OAuth state required by the protocol, it is only valid 10 minutes and\nencodes information about the type of flow" + } + } + }, + "Organization": { + "type": "object", + "properties": { + "id": { + "type": "string" }, - "organization_id": { + "external_id": { "type": "string" }, - "app_id": { + "provisioning": { + "type": "boolean" + }, + "address1": { "type": "string" }, - "service_id": { + "address2": { "type": "string" }, - "region": { + "city": { "type": "string" }, - "parent_id": { + "postal_code": { "type": "string" }, - "child_id": { + "state": { "type": "string" }, - "status": { - "$ref": "#/definitions/RegionalDeployment.Status" + "country": { + "type": "string" }, - "messages": { - "type": "array", - "items": { - "type": "string" - } + "company": { + "type": "boolean" }, - "definition": { - "$ref": "#/definitions/RegionalDeploymentDefinition" + "vat_number": { + "type": "string" }, - "datacenters": { - "type": "array", - "items": { - "type": "string" - } + "billing_name": { + "type": "string" }, - "metadata": { - "$ref": "#/definitions/RegionalDeploymentMetadata" + "billing_email": { + "type": "string" }, - "provisioning_info": { - "$ref": "#/definitions/DeploymentProvisioningInfo" + "name": { + "type": "string" }, - "role": { - "$ref": "#/definitions/RegionalDeployment.Role" + "plan": { + "$ref": "#/definitions/Plan" }, - "version": { + "plan_updated_at": { "type": "string", - "format": "uint64" + "format": "date-time" }, - "deployment_group": { - "type": "string", - "title": "Legacy stuff" + "has_payment_method": { + "type": "boolean" }, - "deployment_id": { + "subscription_id": { "type": "string" - } - } - }, - "RegionalDeployment.Role": { - "type": "string", - "enum": [ - "INVALID", - "ACTIVE", - "UPCOMING", - "CURRENT" - ], - "default": "INVALID" - }, - "RegionalDeployment.Status": { - "type": "string", - "enum": [ - "PENDING", - "PROVISIONING", - "SCHEDULED", - "CANCELING", - "CANCELED", - "ALLOCATING", - "STARTING", - "HEALTHY", - "DEGRADED", - "UNHEALTHY", - "STOPPING", - "STOPPED", - "ERRORING", - "ERROR", - "SLEEPING" - ], - "default": "PENDING" - }, - "RegionalDeploymentDefinition": { - "type": "object", - "properties": { - "name": { + }, + "current_subscription_id": { "type": "string" }, - "type": { - "$ref": "#/definitions/RegionalDeploymentDefinition.Type" + "latest_subscription_id": { + "type": "string" }, - "strategy": { - "$ref": "#/definitions/DeploymentStrategy" + "signup_qualification": { + "type": "object" }, - "routes": { - "type": "array", - "items": { - "$ref": "#/definitions/Route" - } + "status": { + "$ref": "#/definitions/Organization.Status" }, - "ports": { - "type": "array", - "items": { - "$ref": "#/definitions/Port" - } + "status_message": { + "$ref": "#/definitions/OrganizationDetailedStatus" }, - "env": { - "type": "array", - "items": { - "$ref": "#/definitions/Env" - } + "deactivation_reason": { + "$ref": "#/definitions/Organization.DeactivationReason" }, - "region": { - "type": "string" + "verified": { + "type": "boolean" }, - "scaling": { - "$ref": "#/definitions/Scaling" + "qualifies_for_hobby23": { + "type": "boolean" }, - "instance_type": { - "type": "string" + "reprocess_after": { + "type": "string", + "format": "date-time" }, - "deployment_group": { - "type": "string" + "trialing": { + "type": "boolean" }, - "health_checks": { - "type": "array", - "items": { - "$ref": "#/definitions/DeploymentHealthCheck" - } + "trial_starts_at": { + "type": "string", + "format": "date-time" }, - "volumes": { - "type": "array", - "items": { - "$ref": "#/definitions/RegionalDeploymentVolume" - } + "trial_ends_at": { + "type": "string", + "format": "date-time" }, - "config_files": { + "email_domain_allowlist": { "type": "array", "items": { - "$ref": "#/definitions/ConfigFile" + "type": "string" } }, - "skip_cache": { - "type": "boolean" - }, - "docker": { - "$ref": "#/definitions/DockerSource" - }, - "git": { - "$ref": "#/definitions/GitSource" - }, - "archive": { - "$ref": "#/definitions/ArchiveSource" + "default_project_id": { + "type": "string" } - } + }, + "title": "Represent an Organization" + }, + "Organization.DeactivationReason": { + "type": "string", + "enum": [ + "INVALID", + "REQUESTED_BY_OWNER", + "SUBSCRIPTION_TERMINATION", + "LOCKED_BY_ADMIN", + "VERIFICATION_FAILED", + "TRIAL_DID_NOT_CONVERT" + ], + "default": "INVALID" + }, + "Organization.Status": { + "type": "string", + "enum": [ + "WARNING", + "LOCKED", + "ACTIVE", + "DEACTIVATING", + "DEACTIVATED", + "DELETING", + "DELETED" + ], + "default": "WARNING" }, - "RegionalDeploymentDefinition.Type": { + "OrganizationDetailedStatus": { "type": "string", "enum": [ - "INVALID", - "WEB", - "WORKER", - "_", - "SANDBOX" + "NEW", + "EMAIL_NOT_VALIDATED", + "BILLING_INFO_MISSING", + "LOCKED", + "PAYMENT_FAILURE", + "VALID", + "PENDING_VERIFICATION", + "VERIFICATION_FAILED", + "REVIEWING_ACCOUNT", + "PLAN_UPGRADE_REQUIRED" ], - "default": "INVALID", - "title": "- _: We match with DeploymentDefinition.Type, so we skip 3 which is DATABASE" + "default": "NEW" }, - "RegionalDeploymentEvent": { + "OrganizationInvitation": { "type": "object", "properties": { "id": { "type": "string" }, - "when": { + "email": { + "type": "string" + }, + "role": { + "$ref": "#/definitions/UserRole.Role" + }, + "status": { + "$ref": "#/definitions/OrganizationInvitation.Status" + }, + "expires_at": { "type": "string", "format": "date-time" }, "organization_id": { "type": "string" }, - "regional_deployment_id": { - "type": "string" + "organization": { + "$ref": "#/definitions/PublicOrganization" }, - "type": { + "invitee_id": { "type": "string" }, - "message": { + "invitee": { + "$ref": "#/definitions/PublicUser" + }, + "inviter_id": { "type": "string" }, - "metadata": { - "type": "object" + "inviter": { + "$ref": "#/definitions/PublicUser" } } }, - "RegionalDeploymentListItem": { + "OrganizationInvitation.Status": { + "type": "string", + "enum": [ + "INVALID", + "PENDING", + "ACCEPTED", + "REFUSED", + "EXPIRED" + ], + "default": "INVALID" + }, + "Plan": { + "type": "string", + "enum": [ + "hobby", + "starter", + "startup", + "business", + "enterprise", + "internal", + "hobby23", + "no_plan", + "pro", + "scale", + "partner_csp", + "partner_csp_unit" + ], + "default": "hobby" + }, + "PublicOrganization": { "type": "object", "properties": { "id": { "type": "string" }, - "created_at": { - "type": "string", - "format": "date-time" - }, - "updated_at": { - "type": "string", - "format": "date-time" - }, - "region": { + "name": { "type": "string" }, - "status": { - "$ref": "#/definitions/RegionalDeployment.Status" + "plan": { + "$ref": "#/definitions/Plan" }, - "messages": { - "type": "array", - "items": { - "type": "string" - } + "status": { + "$ref": "#/definitions/Organization.Status" }, - "definition": { - "$ref": "#/definitions/RegionalDeploymentDefinition" + "external_id": { + "type": "string" } } }, - "RegionalDeploymentMetadata": { - "type": "object" - }, - "RegionalDeploymentVolume": { + "PublicUser": { "type": "object", "properties": { "id": { - "type": "string", - "title": "the id of the volume" + "type": "string" }, - "path": { - "type": "string", - "title": "the path where the volume is mounted to" + "email": { + "type": "string" }, - "replica_index": { - "type": "integer", - "format": "int64", - "title": "the replica index to mount the volume to" - } - } - }, - "Route": { - "type": "object", - "properties": { - "port": { - "type": "integer", - "format": "int64" + "name": { + "type": "string" }, - "path": { + "avatar_url": { + "type": "string" + }, + "github_id": { + "type": "string" + }, + "github_user": { "type": "string" } } }, - "Scaling": { + "ReactivateOrganizationReply": { "type": "object", "properties": { - "min": { - "type": "integer", - "format": "int64" - }, - "max": { - "type": "integer", - "format": "int64" - }, - "targets": { - "type": "array", - "items": { - "$ref": "#/definitions/DeploymentScalingTarget" - } + "organization": { + "$ref": "#/definitions/Organization" } } }, - "TCPHealthCheck": { + "ResendEmailValidationReply": { + "type": "object" + }, + "ResendEmailValidationRequest": { + "type": "object" + }, + "ResetPasswordReply": { + "type": "object" + }, + "ResetPasswordRequest": { "type": "object", + "example": { + "email": "john@snow.com" + }, "properties": { - "port": { - "type": "integer", - "format": "int64", - "title": "The port to use to perform the health check, must be declared in the ports section" + "email": { + "type": "string" } } }, - "App": { + "Token": { "type": "object", + "example": { + "id": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...", + "expires": "2022-09-08T14:00:00Z", + "user_id": "996d7822-6b58-11e9-956f-32001b70f000", + "organization_id": "9f33b2c6-6b58-11e9-883c-32001b70f000" + }, "properties": { "id": { "type": "string" }, - "name": { + "user_id": { "type": "string" }, "organization_id": { "type": "string" }, - "created_at": { - "type": "string", - "format": "date-time" - }, - "updated_at": { - "type": "string", - "format": "date-time" - }, - "started_at": { - "type": "string", - "format": "date-time" - }, - "succeeded_at": { - "type": "string", - "format": "date-time" - }, - "paused_at": { - "type": "string", - "format": "date-time" - }, - "resumed_at": { - "type": "string", - "format": "date-time" - }, - "terminated_at": { + "expires_at": { "type": "string", "format": "date-time" - }, - "status": { - "$ref": "#/definitions/App.Status" - }, - "messages": { - "type": "array", - "items": { - "type": "string" - } - }, - "version": { - "type": "string", - "format": "uint64" - }, - "domains": { - "type": "array", - "items": { - "$ref": "#/definitions/Domain" - } - }, - "life_cycle": { - "$ref": "#/definitions/AppLifeCycle" } } }, - "App.Status": { - "type": "string", - "enum": [ - "STARTING", - "HEALTHY", - "DEGRADED", - "UNHEALTHY", - "DELETING", - "DELETED", - "PAUSING", - "PAUSED", - "RESUMING" - ], - "default": "STARTING" + "UnscopeOrganizationTokenRequest": { + "type": "object" + }, + "UpdateBudgetReply": { + "type": "object", + "properties": { + "budget": { + "$ref": "#/definitions/Budget" + } + } + }, + "UpdateOrganizationDefaultProjectReply": { + "type": "object", + "properties": { + "organization": { + "$ref": "#/definitions/Organization" + } + } + }, + "UpdateOrganizationNameReply": { + "type": "object", + "properties": { + "organization": { + "$ref": "#/definitions/Organization" + } + } }, - "AppLifeCycle": { + "UpdateOrganizationPlanReply": { "type": "object", "properties": { - "delete_when_empty": { - "type": "boolean" + "organization": { + "$ref": "#/definitions/Organization" } } }, - "AutoRelease": { + "UpdateOrganizationReply": { "type": "object", "properties": { - "groups": { - "type": "array", - "items": { - "$ref": "#/definitions/AutoRelease.Group" - } + "organization": { + "$ref": "#/definitions/Organization" } } }, - "AutoRelease.Group": { + "UpdatePasswordRequest": { "type": "object", + "example": { + "id": "...", + "password": "..." + }, "properties": { - "name": { + "id": { "type": "string" }, - "repository": { + "password": { "type": "string" - }, - "git_ref": { - "type": "string", - "title": "A git ref to track (.e.g: refs/tags/ or refs/heads/" - }, - "latest_sha": { - "type": "string", - "title": "The last hash that was resolved (used to avoid triggering releases when things haven't changed)" } - }, - "title": "Configuration extracted from the latest deployment in this deployment_group" + } }, - "ComposeReply": { + "UpdateUserRequest.UserUpdateBody": { "type": "object", "properties": { - "app": { - "$ref": "#/definitions/App" + "id": { + "type": "string" }, - "services": { - "type": "array", - "items": { - "$ref": "#/definitions/Service" - } + "email": { + "type": "string" + }, + "current_password": { + "type": "string" + }, + "password": { + "type": "string" + }, + "newsletter_subscribed": { + "type": "boolean" + }, + "name": { + "type": "string" } } }, - "CreateApp": { + "UpdateUserSettingsReply": { "type": "object", "properties": { - "name": { - "type": "string" - }, - "life_cycle": { - "$ref": "#/definitions/AppLifeCycle" + "settings": { + "$ref": "#/definitions/UserSettings" } } }, - "CreateCompose": { + "UpdateUserSettingsRequest": { "type": "object", "properties": { - "app": { - "$ref": "#/definitions/CreateApp" - }, - "services": { - "type": "array", - "items": { - "$ref": "#/definitions/CreateService" - } + "failed_deployment_email_notification": { + "type": "boolean", + "description": "(Optional) Toggle failed deployment email notification." } } }, - "CreateService": { + "UpsertSignupQualificationReply": { "type": "object", "properties": { - "app_id": { - "type": "string" - }, - "definition": { - "$ref": "#/definitions/DeploymentDefinition" - }, - "life_cycle": { - "$ref": "#/definitions/ServiceLifeCycle" + "organization": { + "$ref": "#/definitions/Organization" } } }, - "DatabaseSource": { + "UserReply": { "type": "object", "properties": { - "neon_postgres": { - "$ref": "#/definitions/NeonPostgresDatabase" + "user": { + "$ref": "#/definitions/User" } } }, - "DeploymentDefinition": { + "UserRole.Role": { + "type": "string", + "enum": [ + "INVALID", + "OWNER" + ], + "default": "INVALID" + }, + "UserSettings": { "type": "object", "properties": { - "name": { + "id": { "type": "string" }, - "type": { - "$ref": "#/definitions/DeploymentDefinition.Type" - }, - "strategy": { - "$ref": "#/definitions/DeploymentStrategy" - }, - "routes": { - "type": "array", - "items": { - "$ref": "#/definitions/DeploymentRoute" - } - }, - "ports": { - "type": "array", - "items": { - "$ref": "#/definitions/DeploymentPort" - } + "user_id": { + "type": "string" }, - "proxy_ports": { - "type": "array", - "items": { - "$ref": "#/definitions/DeploymentProxyPort" - } + "failed_deployment_email_notification": { + "type": "boolean" + } + } + }, + "Activity": { + "type": "object", + "properties": { + "id": { + "type": "string" }, - "env": { - "type": "array", - "items": { - "$ref": "#/definitions/DeploymentEnv" - } + "actor": { + "$ref": "#/definitions/Object" }, - "regions": { - "type": "array", - "items": { - "type": "string" - } + "object": { + "$ref": "#/definitions/Object" }, - "scalings": { - "type": "array", - "items": { - "$ref": "#/definitions/DeploymentScaling" - } + "verb": { + "type": "string" }, - "instance_types": { - "type": "array", - "items": { - "$ref": "#/definitions/DeploymentInstanceType" - } + "metadata": { + "type": "object" }, - "health_checks": { + "created_at": { + "type": "string", + "format": "date-time" + } + } + }, + "ActivityList": { + "type": "object", + "properties": { + "activities": { "type": "array", "items": { - "$ref": "#/definitions/DeploymentHealthCheck" + "$ref": "#/definitions/Activity" } }, - "volumes": { - "type": "array", - "items": { - "$ref": "#/definitions/DeploymentVolume" - } + "limit": { + "type": "integer", + "format": "int64" }, - "config_files": { - "type": "array", - "items": { - "$ref": "#/definitions/ConfigFile" - } + "offset": { + "type": "integer", + "format": "int64" }, - "skip_cache": { + "has_next": { "type": "boolean" + } + } + }, + "Object": { + "type": "object", + "properties": { + "id": { + "type": "string" }, - "docker": { - "$ref": "#/definitions/DockerSource" + "name": { + "type": "string" }, - "git": { - "$ref": "#/definitions/GitSource" + "type": { + "type": "string" }, - "database": { - "$ref": "#/definitions/DatabaseSource" + "metadata": { + "type": "object" }, - "archive": { - "$ref": "#/definitions/ArchiveSource" + "deleted": { + "type": "boolean" } } }, - "DeploymentDefinition.Type": { + "Empty": { + "type": "object" + }, + "kgitproxy.GithubInstallation.Status": { "type": "string", "enum": [ "INVALID", - "WEB", - "WORKER", - "DATABASE", - "SANDBOX" + "INSTALLED", + "SUSPENDED", + "DELETED" ], "default": "INVALID" }, - "DeploymentEnv": { + "kgitproxy.IndexingStatus": { + "type": "string", + "enum": [ + "INVALID_INDEXING_STATUS", + "NOT_STARTED", + "IN_PROGRESS", + "COMPLETED" + ], + "default": "INVALID_INDEXING_STATUS" + }, + "AppsSummary": { "type": "object", "properties": { - "scopes": { - "type": "array", - "items": { - "type": "string" - } - }, - "key": { - "type": "string" - }, - "value": { - "type": "string" + "total": { + "type": "string", + "format": "int64", + "title": "Total number of apps" }, - "secret": { - "type": "string" + "by_status": { + "type": "object", + "additionalProperties": { + "type": "string", + "format": "int64" + }, + "title": "Number of apps grouped by status" } } }, - "DeploymentInstanceType": { + "DomainsSummary": { "type": "object", "properties": { - "scopes": { - "type": "array", - "items": { - "type": "string" - } + "total": { + "type": "string", + "format": "int64", + "title": "Total number of domains" }, - "type": { - "type": "string" + "by_status": { + "type": "object", + "additionalProperties": { + "type": "string", + "format": "int64" + }, + "title": "Number of domains grouped by status" } } }, - "DeploymentPort": { + "GetOrganizationSummaryReply": { "type": "object", "properties": { - "port": { - "type": "integer", - "format": "int64" - }, - "protocol": { + "summary": { + "$ref": "#/definitions/OrganizationSummary", + "title": "Organization usage summary" + } + } + }, + "InstancesSummary": { + "type": "object", + "properties": { + "total": { "type": "string", - "title": "One of http, http2, tcp" + "format": "int64", + "title": "Total number of instances" + }, + "by_type": { + "type": "object", + "additionalProperties": { + "type": "string", + "format": "int64" + }, + "title": "Number of instances grouped by type" } } }, - "DeploymentProxyPort": { + "MembersSummary": { "type": "object", "properties": { - "port": { - "type": "integer", - "format": "int64" + "total": { + "type": "string", + "format": "int64", + "title": "Number of members" }, - "protocol": { - "$ref": "#/definitions/ProxyPortProtocol" + "invitations_by_status": { + "type": "object", + "additionalProperties": { + "type": "string", + "format": "int64" + }, + "title": "Number of invitations grouped by status" } } }, - "DeploymentRoute": { + "NeonPostgresSummary": { "type": "object", "properties": { - "port": { - "type": "integer", - "format": "int64" + "total": { + "type": "string", + "format": "int64", + "title": "Total number of databases" }, - "path": { - "type": "string" + "by_instance_type": { + "type": "object", + "additionalProperties": { + "type": "string", + "format": "int64" + }, + "title": "Number of databases grouped by instance type" } } }, - "DeploymentScaling": { + "OrganizationSummary": { "type": "object", "properties": { - "scopes": { - "type": "array", - "items": { - "type": "string" - } + "organization_id": { + "type": "string" }, - "min": { - "type": "integer", - "format": "int64" + "instances": { + "$ref": "#/definitions/InstancesSummary" }, - "max": { - "type": "integer", - "format": "int64" + "apps": { + "$ref": "#/definitions/AppsSummary" }, - "targets": { - "type": "array", - "items": { - "$ref": "#/definitions/DeploymentScalingTarget" - } + "services": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/ServiceSummary" + }, + "title": "Number of services grouped by type" + }, + "domains": { + "$ref": "#/definitions/DomainsSummary" + }, + "secrets": { + "$ref": "#/definitions/SecretsSummary" + }, + "neon_postgres": { + "$ref": "#/definitions/NeonPostgresSummary" + }, + "members": { + "$ref": "#/definitions/MembersSummary" } } }, - "DeploymentVolume": { + "SecretsSummary": { "type": "object", "properties": { - "id": { - "type": "string", - "title": "the id of the volume" - }, - "path": { + "total": { "type": "string", - "title": "the path where the volume is mounted to" - }, - "replica_index": { - "type": "integer", "format": "int64", - "title": "optionally, explicitly choose the replica index to mount the volume to" + "title": "Total number of secrets" }, - "scopes": { - "type": "array", - "items": { - "type": "string" + "by_type": { + "type": "object", + "additionalProperties": { + "type": "string", + "format": "int64" }, - "title": "scope of the associated" + "title": "Number of secrets grouped by type" } } }, - "DesiredDeployment": { + "ServiceSummary": { "type": "object", "properties": { - "groups": { - "type": "array", - "items": { - "$ref": "#/definitions/DesiredDeployment.Group" - } + "total": { + "type": "string", + "format": "int64", + "title": "Total number of services" + }, + "by_status": { + "type": "object", + "additionalProperties": { + "type": "string", + "format": "int64" + }, + "title": "Number of services grouped by status" } } }, - "DesiredDeployment.Group": { + "CreateCredential": { "type": "object", "properties": { "name": { - "type": "string" + "type": "string", + "title": "Credential name" }, - "deployment_ids": { - "type": "array", - "items": { - "type": "string" - } + "description": { + "type": "string", + "title": "Credential description" + }, + "type": { + "$ref": "#/definitions/Credential.Type", + "title": "Credential type" + }, + "organization_id": { + "type": "string", + "title": "Organization id for user credential" } } }, - "Domain": { + "CreateCredentialReply": { + "type": "object", + "properties": { + "credential": { + "$ref": "#/definitions/Credential" + } + } + }, + "Credential": { "type": "object", "properties": { "id": { "type": "string" }, - "organization_id": { - "type": "string" - }, - "name": { - "type": "string" - }, - "created_at": { - "type": "string", - "format": "date-time" - }, - "updated_at": { - "type": "string", - "format": "date-time" - }, - "status": { - "$ref": "#/definitions/Domain.Status" - }, "type": { - "$ref": "#/definitions/Domain.Type" + "$ref": "#/definitions/Credential.Type" }, - "app_id": { + "name": { "type": "string" }, - "deployment_group": { + "token": { "type": "string" }, - "verified_at": { - "type": "string", - "format": "date-time" + "description": { + "type": "string" }, - "intended_cname": { + "user_id": { "type": "string" }, - "messages": { - "type": "array", - "items": { - "type": "string" - } + "organization_id": { + "type": "string" }, - "version": { + "updated_at": { "type": "string", - "format": "uint64" + "format": "date-time" }, - "cloudflare": { - "$ref": "#/definitions/Domain.LoadBalancerCloudflare" + "created_at": { + "type": "string", + "format": "date-time" }, - "koyeb": { - "$ref": "#/definitions/Domain.LoadBalancerKoyeb" + "expires_at": { + "type": "string", + "format": "date-time" } } }, - "Domain.LoadBalancerCloudflare": { + "Credential.Type": { + "type": "string", + "enum": [ + "INVALID", + "USER", + "ORGANIZATION" + ], + "default": "INVALID" + }, + "DeleteCredentialReply": { "type": "object" }, - "Domain.LoadBalancerKoyeb": { + "GetCredentialReply": { "type": "object", "properties": { - "request_timeout_seconds": { - "type": "integer", - "format": "int64", - "title": "Between 100 and 900" + "credential": { + "$ref": "#/definitions/Credential" } } }, - "Domain.Status": { - "type": "string", - "enum": [ - "PENDING", - "ACTIVE", - "ERROR", - "DELETING", - "DELETED" - ], - "default": "PENDING" - }, - "Domain.Type": { - "type": "string", - "enum": [ - "AUTOASSIGNED", - "CUSTOM" - ], - "default": "AUTOASSIGNED", - "title": "- AUTOASSIGNED: Domain like -.koyeb.app" - }, - "NeonPostgresDatabase": { + "ListCredentialsReply": { "type": "object", "properties": { - "pg_version": { - "type": "integer", - "format": "int64" - }, - "region": { - "type": "string" - }, - "instance_type": { - "type": "string" - }, - "roles": { + "credentials": { "type": "array", "items": { - "$ref": "#/definitions/NeonPostgresDatabase.NeonRole" + "$ref": "#/definitions/Credential" } }, - "databases": { - "type": "array", - "items": { - "$ref": "#/definitions/NeonPostgresDatabase.NeonDatabase" - } - } - } - }, - "NeonPostgresDatabase.NeonDatabase": { - "type": "object", - "properties": { - "name": { - "type": "string" + "limit": { + "type": "integer", + "format": "int64" }, - "owner": { - "type": "string" + "offset": { + "type": "integer", + "format": "int64" + }, + "count": { + "type": "integer", + "format": "int64" } } }, - "NeonPostgresDatabase.NeonRole": { + "UpdateCredentialReply": { "type": "object", "properties": { - "name": { - "type": "string" - }, - "secret": { - "type": "string" + "credential": { + "$ref": "#/definitions/Credential" } } }, - "ProxyPortProtocol": { - "type": "string", - "enum": [ - "tcp" - ], - "default": "tcp" - }, - "Service": { + "LoginRequest": { "type": "object", + "example": { + "email": "john@snow.com", + "password": "..." + }, "properties": { - "id": { - "type": "string" - }, - "created_at": { - "type": "string", - "format": "date-time" - }, - "updated_at": { - "type": "string", - "format": "date-time" - }, - "started_at": { - "type": "string", - "format": "date-time" - }, - "succeeded_at": { - "type": "string", - "format": "date-time" - }, - "paused_at": { - "type": "string", - "format": "date-time" - }, - "resumed_at": { + "email": { "type": "string", - "format": "date-time" + "title": "User email" }, - "terminated_at": { + "password": { "type": "string", - "format": "date-time" - }, - "name": { - "type": "string" - }, - "type": { - "$ref": "#/definitions/Service.Type" + "title": "User password" }, "organization_id": { - "type": "string" - }, - "app_id": { - "type": "string" - }, - "status": { - "$ref": "#/definitions/Service.Status" - }, - "messages": { - "type": "array", - "items": { - "type": "string" - } - }, - "version": { "type": "string", - "format": "uint64" - }, - "active_deployment_id": { - "type": "string" - }, - "latest_deployment_id": { - "type": "string" - }, - "last_provisioned_deployment_id": { - "type": "string" - }, - "state": { - "$ref": "#/definitions/ServiceState", - "title": "Legacy stuff" - }, - "life_cycle": { - "$ref": "#/definitions/ServiceLifeCycle" + "title": "(Optional) Login into this organization" } } }, - "Service.Status": { - "type": "string", - "enum": [ - "STARTING", - "HEALTHY", - "DEGRADED", - "UNHEALTHY", - "DELETING", - "DELETED", - "PAUSING", - "PAUSED", - "RESUMING" - ], - "default": "STARTING" + "LogoutReply": { + "type": "object" }, - "Service.Type": { - "type": "string", - "enum": [ - "INVALID_TYPE", - "WEB", - "WORKER", - "DATABASE", - "SANDBOX" - ], - "default": "INVALID_TYPE" + "ConfirmOrganizationActionReply": { + "type": "object" }, - "ServiceLifeCycle": { + "GetIntercomProfileReply": { "type": "object", "properties": { - "delete_after_sleep": { - "type": "integer", - "format": "int64" + "hash": { + "type": "string" + } + } + }, + "CheckCouponReply": { + "type": "object", + "properties": { + "name": { + "type": "string" }, - "delete_after_create": { - "type": "integer", + "percent_off": { + "type": "number", + "format": "float" + }, + "amount_off": { + "type": "string", "format": "int64" + }, + "currency": { + "type": "string" } } }, - "ServiceState": { + "RedeemCouponReply": { + "type": "object" + }, + "RedeemCouponRequest": { "type": "object", "properties": { - "desired_deployment": { - "$ref": "#/definitions/DesiredDeployment" - }, - "auto_release": { - "$ref": "#/definitions/AutoRelease" + "code": { + "type": "string" } } }, - "VerifyDockerImageReply": { + "CreateProject": { "type": "object", "properties": { - "success": { - "type": "boolean", - "title": "Whether the image is accessible or not" - }, - "reason": { + "name": { "type": "string", - "title": "(Optional) If the image is not accessible, the reason" + "title": "Project name" }, - "code": { - "$ref": "#/definitions/VerifyDockerImageReply.ErrCode", - "title": "(Optional) If the image is not accessible, return an error code" + "description": { + "type": "string", + "title": "Project description" } } }, - "VerifyDockerImageReply.ErrCode": { - "type": "string", - "enum": [ - "UNKNOWN", - "AUTH_ACCESS_DENIED", - "ANON_ACCESS_DENIED", - "AUTH_NOT_FOUND", - "ANON_NOT_FOUND", - "REGISTRY_ERROR", - "TIMEOUT", - "DNS", - "MALFORMED", - "INVALID_OS", - "INVALID_ARCH", - "INVALID_SCHEME", - "GENERIC" - ], - "default": "UNKNOWN", - "description": "- UNKNOWN: Default value\n - AUTH_ACCESS_DENIED: The registry denied access to an authenticated request\n - ANON_ACCESS_DENIED: The registry denied access to an anonymous request\n - AUTH_NOT_FOUND: The image has not been found after an authenticated request\n - ANON_NOT_FOUND: The image has not been found after an anonymous request\n - REGISTRY_ERROR: The registry returned an error\n - TIMEOUT: The request to the registry timed out\n - DNS: There was an error trying to resolve the name of the registry\n - MALFORMED: The provided image name is malformed\n - INVALID_OS: The operating system is not supported\n - INVALID_ARCH: The architecture is not supported\n - INVALID_SCHEME: The scheme is not https\n - GENERIC: Generic catch-all error code", - "title": "The error code associated to each specific failure mode" - }, - "ArchiveDeploymentMetadata": { + "CreateProjectReply": { "type": "object", "properties": { - "last_provisioned_deployment_id": { - "type": "string" + "project": { + "$ref": "#/definitions/Project" } } }, - "CancelDeploymentReply": { + "DeleteProjectReply": { "type": "object" }, - "DatabaseDeploymentMetadata": { + "GetProjectReply": { "type": "object", "properties": { - "neon_postgres": { - "$ref": "#/definitions/NeonPostgresDatabaseDeploymentMetadata" + "project": { + "$ref": "#/definitions/Project" } } }, - "Deployment": { + "ListProjectsReply": { + "type": "object", + "properties": { + "projects": { + "type": "array", + "items": { + "$ref": "#/definitions/Project" + } + }, + "limit": { + "type": "integer", + "format": "int64" + }, + "offset": { + "type": "integer", + "format": "int64" + } + } + }, + "Project": { "type": "object", "properties": { "id": { "type": "string" }, - "created_at": { - "type": "string", - "format": "date-time" + "name": { + "type": "string" }, - "updated_at": { - "type": "string", - "format": "date-time" + "description": { + "type": "string" }, - "allocated_at": { - "type": "string", - "format": "date-time" + "organization_id": { + "type": "string" }, - "started_at": { + "updated_at": { "type": "string", "format": "date-time" }, - "succeeded_at": { + "created_at": { "type": "string", "format": "date-time" }, - "terminated_at": { + "service_count": { "type": "string", - "format": "date-time" + "format": "int64", + "title": "Number of services in this project" + } + } + }, + "UpdateProjectReply": { + "type": "object", + "properties": { + "project": { + "$ref": "#/definitions/Project" + } + } + }, + "ListOrganizationMembersReply": { + "type": "object", + "properties": { + "members": { + "type": "array", + "items": { + "$ref": "#/definitions/OrganizationMember" + }, + "title": "The collection of organization members" }, - "organization_id": { - "type": "string" + "limit": { + "type": "integer", + "format": "int64", + "title": "The limit in the request" }, - "app_id": { - "type": "string" + "offset": { + "type": "integer", + "format": "int64", + "title": "The offset in the request" }, - "service_id": { + "count": { + "type": "integer", + "format": "int64", + "title": "The total number of items" + } + } + }, + "OrganizationMember": { + "type": "object", + "properties": { + "id": { "type": "string" }, - "parent_id": { + "organization_id": { "type": "string" }, - "child_id": { + "user_id": { "type": "string" }, - "status": { - "$ref": "#/definitions/Deployment.Status" - }, - "metadata": { - "$ref": "#/definitions/DeploymentMetadata" - }, - "definition": { - "$ref": "#/definitions/DeploymentDefinition" - }, - "messages": { - "type": "array", - "items": { - "type": "string" - } - }, - "provisioning_info": { - "$ref": "#/definitions/DeploymentProvisioningInfo" - }, - "database_info": { - "$ref": "#/definitions/DeploymentDatabaseInfo" + "external_id": { + "type": "string" }, - "skip_build": { - "type": "boolean" + "joined_at": { + "type": "string", + "format": "date-time" }, "role": { - "$ref": "#/definitions/Deployment.Role" + "$ref": "#/definitions/UserRole.Role" }, - "version": { - "type": "string", - "format": "uint64" + "status": { + "$ref": "#/definitions/OrganizationMember.Status" }, - "deployment_group": { - "type": "string" + "user": { + "$ref": "#/definitions/PublicUser" + }, + "organization": { + "$ref": "#/definitions/PublicOrganization" } } }, - "Deployment.Role": { + "OrganizationMember.Status": { "type": "string", "enum": [ "INVALID", "ACTIVE", - "UPCOMING", - "CURRENT" + "DELETED" ], "default": "INVALID" }, - "Deployment.Status": { - "type": "string", - "enum": [ - "PENDING", - "PROVISIONING", - "SCHEDULED", - "CANCELING", - "CANCELED", - "ALLOCATING", - "STARTING", - "HEALTHY", - "DEGRADED", - "UNHEALTHY", - "STOPPING", - "STOPPED", - "ERRORING", - "ERROR", - "STASHED", - "SLEEPING" - ], - "default": "PENDING" + "RemoveOrganizationMemberReply": { + "type": "object", + "properties": { + "member": { + "$ref": "#/definitions/OrganizationMember" + } + } }, - "DeploymentDatabaseInfo": { + "ConfirmPaymentAuthorizationReply": { "type": "object", "properties": { - "neon_postgres": { - "$ref": "#/definitions/DeploymentNeonPostgresDatabaseInfo" + "payment_method": { + "$ref": "#/definitions/PaymentMethod" } } }, - "DeploymentEvent": { + "CreatePaymentAuthorizationReply": { "type": "object", "properties": { - "id": { - "type": "string" - }, - "when": { - "type": "string", - "format": "date-time" - }, - "organization_id": { - "type": "string" - }, - "deployment_id": { - "type": "string" + "payment_method": { + "$ref": "#/definitions/PaymentMethod" + } + } + }, + "CreatePaymentAuthorizationRequest": { + "type": "object" + }, + "DeletePaymentMethodReply": { + "type": "object" + }, + "GetPaymentMethodReply": { + "type": "object", + "properties": { + "payment_method": { + "$ref": "#/definitions/PaymentMethod" + } + } + }, + "ListPaymentMethodsReply": { + "type": "object", + "properties": { + "payment_methods": { + "type": "array", + "items": { + "$ref": "#/definitions/PaymentMethod" + }, + "title": "The collection of payment methods" }, - "type": { - "type": "string" + "limit": { + "type": "integer", + "format": "int64", + "title": "The limit in the request" }, - "message": { - "type": "string" + "offset": { + "type": "integer", + "format": "int64", + "title": "The offset in the request" }, - "metadata": { - "type": "object" + "count": { + "type": "integer", + "format": "int64", + "title": "The total number of items" } } }, - "DeploymentListItem": { + "PaymentMethod": { "type": "object", "properties": { "id": { @@ -14601,244 +15172,351 @@ "type": "string", "format": "date-time" }, - "allocated_at": { + "version": { "type": "string", - "format": "date-time" + "format": "uint64" }, - "started_at": { - "type": "string", - "format": "date-time" + "organization_id": { + "type": "string" }, - "succeeded_at": { + "type": { + "type": "string" + }, + "provider": { + "type": "string" + }, + "status": { + "$ref": "#/definitions/PaymentMethod.Status" + }, + "messages": { + "type": "array", + "items": { + "type": "string" + } + }, + "stripe_payment_method_id": { + "type": "string" + }, + "authorization_verified_at": { "type": "string", "format": "date-time" }, - "terminated_at": { + "authorization_canceled_at": { "type": "string", "format": "date-time" }, - "organization_id": { + "authorization_stripe_payment_intent_id": { "type": "string" }, - "app_id": { + "authorization_stripe_payment_intent_client_secret": { "type": "string" }, - "service_id": { + "card_brand": { "type": "string" }, - "parent_id": { + "card_country": { "type": "string" }, - "child_id": { + "card_funding": { "type": "string" }, - "status": { - "$ref": "#/definitions/Deployment.Status" - }, - "metadata": { - "$ref": "#/definitions/DeploymentMetadata" + "card_fingerprint": { + "type": "string" }, - "definition": { - "$ref": "#/definitions/DeploymentDefinition" + "card_last_digits": { + "type": "string" }, - "messages": { - "type": "array", - "items": { - "type": "string" - } + "card_expiration_month": { + "type": "integer", + "format": "int64" }, - "provisioning_info": { - "$ref": "#/definitions/DeploymentProvisioningInfo" + "card_expiration_year": { + "type": "integer", + "format": "int64" + } + } + }, + "PaymentMethod.Status": { + "type": "string", + "enum": [ + "INVALID", + "CREATED", + "AUTHORIZED", + "DECLINED", + "CANCELED", + "EXPIRED", + "UNCHECKED" + ], + "default": "INVALID" + }, + "DomainLoadBalancerQuotas": { + "type": "object", + "properties": { + "max_koyeb": { + "type": "integer", + "format": "int64" + } + } + }, + "GetQuotasReply": { + "type": "object", + "properties": { + "quotas": { + "$ref": "#/definitions/Quotas" + } + } + }, + "LifecycleQuotas": { + "type": "object", + "properties": { + "delete_after_sleep_min": { + "type": "integer", + "format": "int64", + "title": "delete after sleep limits" }, - "database_info": { - "$ref": "#/definitions/DeploymentDatabaseInfo" + "delete_after_sleep_max": { + "type": "integer", + "format": "int64" }, - "version": { - "type": "string", - "format": "uint64" + "delete_after_create_min": { + "type": "integer", + "format": "int64", + "title": "delete after create limits" }, - "deployment_group": { - "type": "string" + "delete_after_create_max": { + "type": "integer", + "format": "int64" } } }, - "DeploymentMetadata": { + "PersistentVolumeQuotas": { "type": "object", "properties": { - "trigger": { - "$ref": "#/definitions/TriggerDeploymentMetadata" - }, - "database": { - "$ref": "#/definitions/DatabaseDeploymentMetadata" - }, - "git": { - "$ref": "#/definitions/GitDeploymentMetadata" + "max_total_size": { + "type": "integer", + "format": "int64", + "description": "MaxTotalSize for all volumes on a region (in Gigabyte / GB)." }, - "archive": { - "$ref": "#/definitions/ArchiveDeploymentMetadata" + "max_volume_size": { + "type": "integer", + "format": "int64", + "description": "MaxVolumeSize for one volume (in Gigabyte / GB)." }, - "proxy_ports": { - "type": "array", - "items": { - "$ref": "#/definitions/DeploymentProxyPortMetadata" - } + "max_per_instance_size": { + "type": "integer", + "format": "int64", + "description": "MaxPerInstanceSize for all volumes on an instance (in Gigabyte / GB)." } } }, - "DeploymentNeonPostgresDatabaseInfo": { + "Quotas": { "type": "object", "properties": { - "active_time_seconds": { + "apps": { "type": "string", "format": "int64" }, - "compute_time_seconds": { + "services": { "type": "string", "format": "int64" }, - "written_data_bytes": { + "domains": { + "type": "string", + "format": "int64", + "title": "Deprecated, use custom_domains instead" + }, + "services_by_app": { "type": "string", "format": "int64" }, - "data_transfer_bytes": { + "service_provisioning_concurrency": { "type": "string", "format": "int64" }, - "data_storage_bytes_hour": { + "memory_mb": { "type": "string", "format": "int64" }, - "server_host": { - "type": "string" + "instance_types": { + "type": "array", + "items": { + "type": "string" + } }, - "server_port": { - "type": "integer", + "regions": { + "type": "array", + "items": { + "type": "string" + } + }, + "max_organization_members": { + "type": "string", "format": "int64" }, - "endpoint_state": { - "type": "string" + "max_instances_by_type": { + "type": "object", + "additionalProperties": { + "type": "string", + "format": "int64" + } }, - "endpoint_last_active": { + "persistent_volumes_by_region": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/PersistentVolumeQuotas" + } + }, + "custom_domains": { "type": "string", - "format": "date-time" + "format": "int64" }, - "default_branch_id": { - "type": "string" + "domains_load_balancer": { + "$ref": "#/definitions/DomainLoadBalancerQuotas" }, - "default_branch_name": { - "type": "string" + "metrics_retention": { + "type": "integer", + "format": "int32", + "title": "Time in days" + }, + "logs_retention": { + "type": "integer", + "format": "int32", + "title": "Time in days" + }, + "access_reserved_subdomains": { + "type": "array", + "items": { + "type": "string" + }, + "title": "The mapping between reserved_subdomain names and their value is in the code" + }, + "proxy_ports": { + "type": "integer", + "format": "int64" }, - "default_branch_state": { - "type": "string" + "scale_to_zero": { + "$ref": "#/definitions/ScaleToZeroQuotas" }, - "default_branch_logical_size": { + "archives": { "type": "string", "format": "int64" }, - "roles": { - "type": "array", - "items": { - "$ref": "#/definitions/DeploymentNeonPostgresDatabaseInfoRole" - } - } - } - }, - "DeploymentNeonPostgresDatabaseInfoRole": { - "type": "object", - "properties": { - "name": { - "type": "string" + "archive_max_size_mb": { + "type": "string", + "format": "int64" }, - "secret_id": { - "type": "string" + "lifecycle": { + "$ref": "#/definitions/LifecycleQuotas" + }, + "max_projects": { + "type": "string", + "format": "int64" } } }, - "DeploymentProxyPortMetadata": { + "ScaleToZeroQuotas": { "type": "object", "properties": { - "host": { - "type": "string" + "is_deep_sleep_enabled": { + "type": "boolean", + "title": "deep sleep limits" }, - "public_port": { + "deep_sleep_idle_delay_min": { "type": "integer", "format": "int64" }, - "port": { + "deep_sleep_idle_delay_max": { "type": "integer", "format": "int64" }, - "protocol": { - "$ref": "#/definitions/ProxyPortProtocol" + "is_light_sleep_enabled": { + "type": "boolean", + "title": "light sleep limits" + }, + "light_sleep_idle_delay_min": { + "type": "integer", + "format": "int64" + }, + "light_sleep_idle_delay_max": { + "type": "integer", + "format": "int64" } } }, - "GetDeploymentReply": { + "CreateOrganizationInvitationReply": { "type": "object", "properties": { - "deployment": { - "$ref": "#/definitions/Deployment" + "invitation": { + "$ref": "#/definitions/OrganizationInvitation", + "title": "The organization invitation sent" } } }, - "GetDeploymentScalingReply": { + "CreateOrganizationInvitationRequest": { "type": "object", "properties": { - "replicas": { - "type": "array", - "items": { - "$ref": "#/definitions/GetDeploymentScalingReplyItem" - }, - "title": "The replicas" + "email": { + "type": "string", + "title": "The email of the person to invite" } } }, - "GetDeploymentScalingReplyItem": { + "DeleteOrganizationInvitationReply": { + "type": "object" + }, + "GetOrganizationInvitationReply": { "type": "object", "properties": { - "region": { - "type": "string", - "title": "The replica region" - }, - "replica_index": { - "type": "integer", - "format": "int64" - }, - "instances": { + "invitation": { + "$ref": "#/definitions/OrganizationInvitation" + } + } + }, + "ListOrganizationInvitationsReply": { + "type": "object", + "properties": { + "invitations": { "type": "array", "items": { - "$ref": "#/definitions/Instance" + "$ref": "#/definitions/OrganizationInvitation" }, - "description": "An array of `active` and `starting` instances.\n\nStatus of the active instance (and if none the most recent instance)\n string status = 4;\n Status message of the active instance (and if none the most recent instance)\n string message = 5;" + "title": "The collection of organization invitations" + }, + "limit": { + "type": "integer", + "format": "int64", + "title": "The limit in the request" + }, + "offset": { + "type": "integer", + "format": "int64", + "title": "The offset in the request" + }, + "count": { + "type": "integer", + "format": "int64", + "title": "The total number of items" } } }, - "GitDeploymentMetadata": { + "ResendOrganizationInvitationReply": { "type": "object", "properties": { - "last_provisioned_deployment_id": { - "type": "string" - }, - "git_env": { - "$ref": "#/definitions/GitEnvDeploymentMetadata" + "invitation": { + "$ref": "#/definitions/OrganizationInvitation", + "title": "The organization invitation resent" } } }, - "GitEnvDeploymentMetadata": { + "GetSubscriptionReply": { "type": "object", "properties": { - "sha": { - "type": "string" - }, - "commit_author": { - "type": "string" - }, - "commit_message": { - "type": "string" + "subscription": { + "$ref": "#/definitions/Subscription" } } }, - "Instance": { + "Subscription": { "type": "object", "properties": { "id": { @@ -14852,632 +15530,553 @@ "type": "string", "format": "date-time" }, + "version": { + "type": "string", + "format": "uint64" + }, "organization_id": { "type": "string" }, - "app_id": { + "stripe_subscription_id": { "type": "string" }, - "service_id": { - "type": "string" + "status": { + "$ref": "#/definitions/Subscription.Status" }, - "regional_deployment_id": { - "type": "string" + "messages": { + "type": "array", + "items": { + "type": "string" + } }, - "allocation_id": { - "type": "string" + "has_pending_update": { + "type": "boolean" }, - "type": { + "stripe_pending_invoice_id": { "type": "string" }, - "replica_index": { - "type": "integer", - "format": "int64" + "terminate_at": { + "type": "string", + "format": "date-time" }, - "region": { - "type": "string" + "canceled_at": { + "type": "string", + "format": "date-time" }, - "datacenter": { - "type": "string" + "terminated_at": { + "type": "string", + "format": "date-time" }, - "hypervisor": { + "current_period_start": { + "type": "string", + "format": "date-time" + }, + "current_period_end": { + "type": "string", + "format": "date-time" + }, + "currency": { "type": "string" }, - "status": { - "$ref": "#/definitions/Instance.Status" + "amount_payable": { + "type": "string", + "format": "int64" }, - "messages": { - "type": "array", - "items": { - "type": "string" - } + "amount_paid": { + "type": "string", + "format": "int64" }, - "started_at": { + "amount_remaining": { + "type": "string", + "format": "int64" + }, + "payment_failure": { + "$ref": "#/definitions/Subscription.PaymentFailure" + }, + "trialing": { + "type": "boolean" + }, + "trial_ends_at": { "type": "string", "format": "date-time" }, - "succeeded_at": { + "trial_max_spend": { + "type": "string", + "format": "int64" + }, + "current_spend": { + "type": "string", + "format": "int64" + } + } + }, + "Subscription.PaymentFailure": { + "type": "object", + "properties": { + "failed_at": { "type": "string", "format": "date-time" }, - "terminated_at": { + "next_attempt": { "type": "string", "format": "date-time" }, - "xyz_deployment_id": { - "type": "string", - "description": "WARNING: Please don't use the following attribute.\nKoyeb doesn't guarantee backwards compatible breaking change and reserve the right to completely drop it without notice.\nUSE AT YOUR OWN RISK." + "attempt_count": { + "type": "string", + "format": "int64" + }, + "error_code": { + "type": "string" + }, + "error_reason": { + "type": "string" + }, + "error_type": { + "type": "string" + }, + "error_message": { + "type": "string" + }, + "payment_method_required": { + "type": "boolean" + }, + "redirect_url": { + "type": "string" + }, + "stripe_sdk": { + "$ref": "#/definitions/Subscription.PaymentFailure.StripeSDK" + } + } + }, + "Subscription.PaymentFailure.StripeSDK": { + "type": "object", + "properties": { + "client_secret_key": { + "type": "string" + }, + "raw_json": { + "type": "string" } } }, - "Instance.Status": { + "Subscription.Status": { "type": "string", "enum": [ - "ALLOCATING", - "STARTING", - "HEALTHY", - "UNHEALTHY", - "STOPPING", - "STOPPED", - "ERROR", - "SLEEPING" + "INVALID", + "CREATED", + "ACTIVE", + "WARNING", + "URGENT", + "CANCELING", + "CANCELED", + "TERMINATING", + "TERMINATED" ], - "default": "ALLOCATING" + "default": "INVALID" }, - "ListDeploymentEventsReply": { + "LogEntry": { "type": "object", "properties": { - "events": { - "type": "array", - "items": { - "$ref": "#/definitions/DeploymentEvent" - }, - "title": "The collection of events" - }, - "limit": { - "type": "integer", - "format": "int64", - "title": "The limit in the request" - }, - "offset": { - "type": "integer", - "format": "int64", - "title": "The offset in the request" + "msg": { + "type": "string" }, - "order": { + "created_at": { "type": "string", - "title": "The order in the request" + "format": "date-time" }, - "has_next": { - "type": "boolean", - "title": "If there is more items after in the collection" + "labels": { + "type": "object" } } }, - "ListDeploymentsReply": { + "QueryLogsReply": { "type": "object", "properties": { - "deployments": { + "data": { "type": "array", "items": { - "$ref": "#/definitions/DeploymentListItem" - }, - "title": "The collection of deployments" - }, - "limit": { - "type": "integer", - "format": "int64", - "title": "The limit in the request" + "$ref": "#/definitions/LogEntry" + } }, - "offset": { - "type": "integer", - "format": "int64", - "title": "The offset in the request" + "pagination": { + "$ref": "#/definitions/QueryLogsReplyPagination" + } + } + }, + "QueryLogsReplyPagination": { + "type": "object", + "properties": { + "has_more": { + "type": "boolean" }, - "count": { - "type": "integer", - "format": "int64", - "title": "The total number of items" + "next_start": { + "type": "string", + "format": "date-time" }, - "has_next": { - "type": "boolean", - "title": "If there is more items after in the collection" + "next_end": { + "type": "string", + "format": "date-time" } } }, - "NeonPostgresDatabaseDeploymentMetadata": { + "GetMetricsReply": { "type": "object", "properties": { - "reset_role_passwords": { + "metrics": { "type": "array", "items": { - "type": "string" + "$ref": "#/definitions/GetMetricsReply.Metric" } } } }, - "TriggerDeploymentMetadata": { + "GetMetricsReply.Metric": { "type": "object", "properties": { - "type": { - "$ref": "#/definitions/TriggerDeploymentMetadata.TriggerType" - }, - "actor": { - "$ref": "#/definitions/TriggerDeploymentMetadata.ActorType" + "labels": { + "type": "object", + "additionalProperties": { + "type": "string" + } }, - "git": { - "$ref": "#/definitions/TriggerGitDeploymentMetadata" + "samples": { + "type": "array", + "items": { + "$ref": "#/definitions/Sample" + } } } }, - "TriggerDeploymentMetadata.ActorType": { - "type": "string", - "enum": [ - "UNKNOWN_ACTOR", - "USER", - "SYSTEM" - ], - "default": "UNKNOWN_ACTOR" - }, - "TriggerDeploymentMetadata.TriggerType": { + "MetricName": { "type": "string", "enum": [ - "UNKNOWN_TYPE", - "GIT", - "RESUME", - "DATABASE_SYNC" + "UNKNOWN", + "CPU_TOTAL_PERCENT", + "MEM_RSS", + "HTTP_THROUGHPUT", + "HTTP_RESPONSE_TIME_50P", + "HTTP_RESPONSE_TIME_90P", + "HTTP_RESPONSE_TIME_99P", + "HTTP_RESPONSE_TIME_MAX", + "PUBLIC_DATA_TRANSFER_IN", + "PUBLIC_DATA_TRANSFER_OUT" ], - "default": "UNKNOWN_TYPE" + "default": "UNKNOWN" }, - "TriggerGitDeploymentMetadata": { + "Sample": { "type": "object", "properties": { - "provider": { - "$ref": "#/definitions/TriggerGitDeploymentMetadata.Provider" - }, - "repository": { - "type": "string" - }, - "branch": { - "type": "string" - }, - "sha": { - "type": "string" - }, - "message": { - "type": "string" - }, - "sender_username": { - "type": "string" - }, - "sender_avatar_url": { + "timestamp": { "type": "string" }, - "sender_profile_url": { - "type": "string" + "value": { + "type": "number", + "format": "double" } } }, - "TriggerGitDeploymentMetadata.Provider": { - "type": "string", - "enum": [ - "UNKNOWN", - "GITHUB" - ], - "default": "UNKNOWN" - }, - "CreateStageAttemptReply": { - "type": "object" - }, - "DeclareStageProgressReply": { - "type": "object" - }, - "DeclareStepProgressReply": { - "type": "object" - }, - "CreatePersistentVolumeReply": { + "ExecCommandIO": { "type": "object", "properties": { - "volume": { - "$ref": "#/definitions/PersistentVolume" + "data": { + "type": "string", + "format": "byte", + "description": "Data is base64 encoded" + }, + "close": { + "type": "boolean", + "description": "Indicate last data frame" } } }, - "CreatePersistentVolumeRequest": { + "ExecCommandReply": { "type": "object", "properties": { - "volume_type": { - "$ref": "#/definitions/PersistentVolumeBackingStore", - "title": "the volume backing store type" - }, - "name": { - "type": "string", - "title": "the volume name" + "stdout": { + "$ref": "#/definitions/ExecCommandIO" }, - "region": { - "type": "string", - "title": "the volume region" + "stderr": { + "$ref": "#/definitions/ExecCommandIO" }, - "read_only": { - "type": "boolean", - "title": "whether the volume must be set as read only" + "exited": { + "type": "boolean" }, - "max_size": { + "exit_code": { "type": "integer", - "format": "int64", - "title": "the size of the volume (in Gigabyte / GB)" - }, - "snapshot_id": { - "type": "string", - "title": "(optional) the id of the snapshot whence the volume comes from" - } - } - }, - "DeletePersistentVolumeReply": { - "type": "object", - "properties": { - "volume": { - "$ref": "#/definitions/PersistentVolume" - } - } - }, - "GetPersistentVolumeReply": { - "type": "object", - "properties": { - "volume": { - "$ref": "#/definitions/PersistentVolume" + "format": "int32" } } }, - "ListPersistentVolumeEventsReply": { + "ExecCommandRequest.Body": { "type": "object", "properties": { - "events": { + "command": { "type": "array", "items": { - "$ref": "#/definitions/PersistentVolumeEvent" + "type": "string" }, - "title": "The collection of events" - }, - "limit": { - "type": "integer", - "format": "int64", - "title": "The limit in the request" + "description": "Command to exec. Mandatory in the first frame sent" }, - "offset": { - "type": "integer", - "format": "int64", - "title": "The offset in the request" + "tty_size": { + "$ref": "#/definitions/ExecCommandRequest.TerminalSize" }, - "order": { - "type": "string", - "title": "The order in the request" + "stdin": { + "$ref": "#/definitions/ExecCommandIO" }, - "has_next": { + "disableTty": { "type": "boolean", - "title": "If there is more items after in the collection" + "description": "Disable TTY. It's enough to specify it in the first frame" } } }, - "ListPersistentVolumesReply": { + "ExecCommandRequest.IdType": { + "type": "string", + "enum": [ + "INVALID", + "INSTANCE_ID", + "SERVICE_ID" + ], + "default": "INVALID" + }, + "ExecCommandRequest.TerminalSize": { "type": "object", "properties": { - "volumes": { - "type": "array", - "items": { - "$ref": "#/definitions/PersistentVolume" - }, - "title": "The collection of persistent volumes" - }, - "limit": { + "height": { "type": "integer", - "format": "int64", - "title": "The limit in the request" + "format": "int32" }, - "offset": { + "width": { "type": "integer", - "format": "int64", - "title": "The offset in the request" - }, - "has_next": { - "type": "boolean", - "title": "If there is more items after in the collection" + "format": "int32" } } }, - "PersistentVolume": { + "Notification": { "type": "object", "properties": { "id": { - "type": "string", - "title": "the identifier for the volume object" + "type": "string" }, - "name": { - "type": "string", - "title": "the volume name" + "activity": { + "$ref": "#/definitions/Activity" }, - "snapshot_id": { - "type": "string", - "title": "(optional) the id of the snapshot whence the volume comes from" + "is_read": { + "type": "boolean" }, - "created_at": { - "type": "string", - "format": "date-time", - "title": "creation timestamp" + "is_seen": { + "type": "boolean" }, - "updated_at": { + "created_at": { "type": "string", - "format": "date-time", - "title": "last change timestamp" + "format": "date-time" + } + } + }, + "NotificationList": { + "type": "object", + "properties": { + "notifications": { + "type": "array", + "items": { + "$ref": "#/definitions/Notification" + } }, - "deleted_at": { - "type": "string", - "format": "date-time", - "title": "deletion timestamp" + "limit": { + "type": "integer", + "format": "int64" }, - "organization_id": { - "type": "string", - "title": "the organization to which the volume belongs to" + "offset": { + "type": "integer", + "format": "int64" }, - "service_id": { - "type": "string", - "title": "the service_id to which the volume is eventually bound to" + "count": { + "type": "integer", + "format": "int64" }, - "region": { - "type": "string", - "title": "the region where the volume exists" + "is_read": { + "type": "boolean" }, - "read_only": { - "type": "boolean", - "title": "whether to mount the volume in read-only mode" + "is_seen": { + "type": "boolean" }, - "max_size": { + "unread": { "type": "integer", - "format": "int64", - "title": "the maximum size of the volume (in Gigabyte / GB)" + "format": "int64" }, - "cur_size": { + "unseen": { "type": "integer", - "format": "int64", - "title": "the used amount of space as measured the last time (in Gigabyte / GB)" - }, - "status": { - "$ref": "#/definitions/PersistentVolumeStatus", - "title": "the status of the volume" - }, - "backing_store": { - "$ref": "#/definitions/PersistentVolumeBackingStore", - "title": "the backing store type" + "format": "int64" } - }, - "title": "The object that represent a volume to handle persistency for deployments" - }, - "PersistentVolumeBackingStore": { - "type": "string", - "enum": [ - "PERSISTENT_VOLUME_BACKING_STORE_INVALID", - "PERSISTENT_VOLUME_BACKING_STORE_LOCAL_BLK" - ], - "default": "PERSISTENT_VOLUME_BACKING_STORE_INVALID", - "title": "- PERSISTENT_VOLUME_BACKING_STORE_INVALID: zero value, invalid\n - PERSISTENT_VOLUME_BACKING_STORE_LOCAL_BLK: the backing store is a locally reachable block device" + } }, - "PersistentVolumeEvent": { + "BasicAuthPolicy": { "type": "object", "properties": { - "id": { - "type": "string" - }, - "when": { - "type": "string", - "format": "date-time" - }, - "organization_id": { - "type": "string" - }, - "persistent_volume_id": { - "type": "string" - }, - "type": { + "username": { "type": "string" }, - "message": { + "password": { "type": "string" - }, - "metadata": { - "type": "object" } } }, - "PersistentVolumeStatus": { - "type": "string", - "enum": [ - "PERSISTENT_VOLUME_STATUS_INVALID", - "PERSISTENT_VOLUME_STATUS_ATTACHED", - "PERSISTENT_VOLUME_STATUS_DETACHED", - "PERSISTENT_VOLUME_STATUS_DELETING", - "PERSISTENT_VOLUME_STATUS_DELETED" - ], - "default": "PERSISTENT_VOLUME_STATUS_INVALID", - "title": "- PERSISTENT_VOLUME_STATUS_INVALID: zero value, invalid\n - PERSISTENT_VOLUME_STATUS_ATTACHED: the volume is attached to an instance\n - PERSISTENT_VOLUME_STATUS_DETACHED: the volume is free to use\n - PERSISTENT_VOLUME_STATUS_DELETING: the volume will be deleted\n - PERSISTENT_VOLUME_STATUS_DELETED: the volume was deleted" - }, - "UpdatePersistentVolumeReply": { + "SecurityPolicies": { "type": "object", "properties": { - "volume": { - "$ref": "#/definitions/PersistentVolume" + "basic_auths": { + "type": "array", + "items": { + "$ref": "#/definitions/BasicAuthPolicy" + } + }, + "api_keys": { + "type": "array", + "items": { + "type": "string" + } } } }, - "CreateDomain": { + "ArchiveSource": { "type": "object", "properties": { - "name": { - "type": "string" - }, - "type": { - "$ref": "#/definitions/Domain.Type" - }, - "app_id": { + "id": { "type": "string", - "title": "to auto-attach to an app. Optional" + "title": "The ID of the archive to deploy" }, - "cloudflare": { - "$ref": "#/definitions/Domain.LoadBalancerCloudflare" + "buildpack": { + "$ref": "#/definitions/BuildpackBuilder" }, - "koyeb": { - "$ref": "#/definitions/Domain.LoadBalancerKoyeb", - "description": "Only applicable to auto-assigned domains, for organizations on the Scale plan." + "docker": { + "$ref": "#/definitions/DockerBuilder" } } }, - "CreateDomainReply": { + "BuildpackBuilder": { "type": "object", "properties": { - "domain": { - "$ref": "#/definitions/Domain" + "build_command": { + "type": "string", + "title": "A command used to override the build command, run after all build steps" + }, + "run_command": { + "type": "string", + "title": "A command used to override the default run command" + }, + "privileged": { + "type": "boolean", + "title": "A flag to run the container in privileged mode" } } }, - "DeleteDomainReply": { - "type": "object" - }, - "GetDomainReply": { + "ConfigFile": { "type": "object", "properties": { - "domain": { - "$ref": "#/definitions/Domain" + "path": { + "type": "string", + "title": "the path where the file is copied" + }, + "permissions": { + "type": "string", + "title": "the permissions of the file in format 0644" + }, + "content": { + "type": "string", + "title": "the content of the file" } } }, - "ListDomainsReply": { + "DeploymentHealthCheck": { "type": "object", "properties": { - "domains": { - "type": "array", - "items": { - "$ref": "#/definitions/Domain" - } + "grace_period": { + "type": "integer", + "format": "int64", + "title": "An optional initial period in seconds to wait for the instance to become healthy, default is 5s" }, - "limit": { + "interval": { "type": "integer", "format": "int64", - "title": "The limit in the request" + "title": "An optional period in seconds between two health checks, default is 60s" }, - "offset": { + "restart_limit": { "type": "integer", "format": "int64", - "title": "The offset in the request" + "title": "An optional number of consecutive failures before attempting to restart the service, default is 3" }, - "count": { + "timeout": { "type": "integer", "format": "int64", - "title": "The total number of items" + "title": "An optional maximum time to wait in seconds before considering the check as a failure, default is 5s" + }, + "tcp": { + "$ref": "#/definitions/TCPHealthCheck" + }, + "http": { + "$ref": "#/definitions/HTTPHealthCheck" } } }, - "RefreshDomainStatusReply": { - "type": "object" - }, - "UpdateDomain": { + "DeploymentProvisioningInfo": { "type": "object", "properties": { - "app_id": { + "sha": { "type": "string", - "description": "To attach or detach from an app for custom domain." + "description": "The git sha for this build (we resolve the reference at the start of the build)." }, - "subdomain": { + "image": { "type": "string", - "description": "To change subdomain for auto-assigned domain." - } - } - }, - "UpdateDomainReply": { - "type": "object", - "properties": { - "domain": { - "$ref": "#/definitions/Domain" - } - } - }, - "GetInstanceReply": { - "type": "object", - "properties": { - "instance": { - "$ref": "#/definitions/Instance" + "description": "The docker image built as a result of this build." + }, + "stages": { + "type": "array", + "items": { + "$ref": "#/definitions/DeploymentProvisioningInfo.Stage" + }, + "description": "Some info about the build." } } }, - "InstanceEvent": { + "DeploymentProvisioningInfo.Stage": { "type": "object", "properties": { - "id": { + "name": { "type": "string" }, - "when": { - "type": "string", - "format": "date-time" - }, - "organization_id": { - "type": "string" + "status": { + "$ref": "#/definitions/DeploymentProvisioningInfo.Stage.Status" }, - "instance_id": { - "type": "string" + "messages": { + "type": "array", + "items": { + "type": "string" + } }, - "type": { - "type": "string" + "started_at": { + "type": "string", + "format": "date-time" }, - "message": { - "type": "string" + "finished_at": { + "type": "string", + "format": "date-time" }, - "metadata": { - "type": "object" + "build_attempts": { + "type": "array", + "items": { + "$ref": "#/definitions/DeploymentProvisioningInfo.Stage.BuildAttempt" + } } } }, - "InstanceListItem": { + "DeploymentProvisioningInfo.Stage.BuildAttempt": { "type": "object", "properties": { "id": { - "type": "string" - }, - "created_at": { - "type": "string", - "format": "date-time" - }, - "updated_at": { - "type": "string", - "format": "date-time" - }, - "organization_id": { - "type": "string" - }, - "app_id": { - "type": "string" - }, - "service_id": { - "type": "string" - }, - "regional_deployment_id": { - "type": "string" - }, - "allocation_id": { - "type": "string" - }, - "type": { - "type": "string" - }, - "replica_index": { "type": "integer", "format": "int64" }, - "region": { - "type": "string" - }, - "datacenter": { - "type": "string" - }, "status": { - "$ref": "#/definitions/Instance.Status" + "$ref": "#/definitions/DeploymentProvisioningInfo.Stage.Status" }, "messages": { "type": "array", @@ -15485,376 +16084,360 @@ "type": "string" } }, - "xyz_deployment_id": { + "started_at": { "type": "string", - "description": "WARNING: Please don't use the following attribute.\nKoyeb doesn't guarantee backwards compatible breaking change and reserve the right to completely drop it without notice.\nUSE AT YOUR OWN RISK." - } - } - }, - "ListInstanceEventsReply": { - "type": "object", - "properties": { - "events": { + "format": "date-time" + }, + "finished_at": { + "type": "string", + "format": "date-time" + }, + "steps": { "type": "array", "items": { - "$ref": "#/definitions/InstanceEvent" - }, - "title": "The collection of events" + "$ref": "#/definitions/DeploymentProvisioningInfo.Stage.BuildAttempt.BuildStep" + } }, - "limit": { - "type": "integer", - "format": "int64", - "title": "The limit in the request" + "image_pushed": { + "type": "boolean" }, - "offset": { - "type": "integer", - "format": "int64", - "title": "The offset in the request" + "internal_failure": { + "type": "boolean" }, - "order": { - "type": "string", - "title": "The order in the request" + "retryable_failure": { + "type": "boolean" }, - "has_next": { + "wait_completion": { "type": "boolean", - "title": "If there is more items after in the collection" + "description": "This flag is used to finalize the build, and continue the deployment in case of success, or cancel and potentially retry the build in case of failure." } } }, - "ListInstancesReply": { + "DeploymentProvisioningInfo.Stage.BuildAttempt.BuildStep": { "type": "object", "properties": { - "instances": { - "type": "array", - "items": { - "$ref": "#/definitions/InstanceListItem" - }, - "title": "The collection of instances" + "name": { + "type": "string" }, - "limit": { - "type": "integer", - "format": "int64", - "title": "The limit in the request" + "status": { + "$ref": "#/definitions/DeploymentProvisioningInfo.Stage.Status" }, - "offset": { - "type": "integer", - "format": "int64", - "title": "The offset in the request" + "messages": { + "type": "array", + "items": { + "type": "string" + } }, - "count": { - "type": "integer", - "format": "int64", - "title": "The total number of items" + "started_at": { + "type": "string", + "format": "date-time" }, - "order": { + "finished_at": { "type": "string", - "title": "The order in the request" + "format": "date-time" } } }, - "Archive": { + "DeploymentProvisioningInfo.Stage.Status": { + "type": "string", + "enum": [ + "UNKNOWN", + "PENDING", + "RUNNING", + "FAILED", + "COMPLETED", + "ABORTED" + ], + "default": "UNKNOWN" + }, + "DeploymentScalingTarget": { "type": "object", "properties": { - "id": { - "type": "string", - "description": "The archive id, that can be referenced when creating or updating a service." - }, - "organization_id": { - "type": "string", - "description": "Organization owning the archive." + "average_cpu": { + "$ref": "#/definitions/DeploymentScalingTargetAverageCPU" }, - "upload_url": { - "type": "string", - "description": "The URL where to upload the archive. This URL is signed and can only be\nused to upload the archive until `valid_until`." + "average_mem": { + "$ref": "#/definitions/DeploymentScalingTargetAverageMem" }, - "size": { - "type": "string", - "format": "uint64", - "description": "The provisioned space for the archive." + "requests_per_second": { + "$ref": "#/definitions/DeploymentScalingTargetRequestsPerSecond" }, - "created_at": { - "type": "string", - "format": "date-time", - "description": "Date of creation of the archive." + "concurrent_requests": { + "$ref": "#/definitions/DeploymentScalingTargetConcurrentRequests" }, - "deleted_at": { - "type": "string", - "format": "date-time", - "description": "This field is automatically set by Koyeb when the\narchive is garbage collected." + "requests_response_time": { + "$ref": "#/definitions/DeploymentScalingTargetRequestsResponseTime" + }, + "sleep_idle_delay": { + "$ref": "#/definitions/DeploymentScalingTargetSleepIdleDelay" } } }, - "CreateArchive": { + "DeploymentScalingTargetAverageCPU": { "type": "object", "properties": { - "size": { - "type": "string", - "format": "uint64", - "description": "How much space to provision for the archive, in bytes." + "value": { + "type": "integer", + "format": "int64" } } }, - "CreateArchiveReply": { + "DeploymentScalingTargetAverageMem": { "type": "object", "properties": { - "archive": { - "$ref": "#/definitions/Archive" + "value": { + "type": "integer", + "format": "int64" } } }, - "AppEvent": { + "DeploymentScalingTargetConcurrentRequests": { "type": "object", "properties": { - "id": { - "type": "string" - }, - "when": { - "type": "string", - "format": "date-time" - }, - "organization_id": { - "type": "string" - }, - "app_id": { - "type": "string" - }, - "type": { - "type": "string" - }, - "message": { - "type": "string" - }, - "metadata": { - "type": "object" + "value": { + "type": "integer", + "format": "int64" } } }, - "AppListItem": { + "DeploymentScalingTargetRequestsPerSecond": { "type": "object", "properties": { - "id": { - "type": "string" - }, - "name": { - "type": "string" - }, - "organization_id": { - "type": "string" - }, - "updated_at": { - "type": "string", - "format": "date-time" - }, - "created_at": { - "type": "string", - "format": "date-time" - }, - "domains": { - "type": "array", - "items": { - "$ref": "#/definitions/Domain" - } - }, - "status": { - "$ref": "#/definitions/App.Status" - }, - "messages": { - "type": "array", - "items": { - "type": "string" - } + "value": { + "type": "integer", + "format": "int64" } } }, - "CreateAppReply": { + "DeploymentScalingTargetRequestsResponseTime": { "type": "object", "properties": { - "app": { - "$ref": "#/definitions/App", - "title": "The entity created" + "value": { + "type": "integer", + "format": "int64" + }, + "quantile": { + "type": "integer", + "format": "int64", + "description": "The quantile to use for autoscaling. For example, set to 95 to use the 95th\npercentile (p95) for autoscaling. Valid values are between 0 and 100." } } }, - "DeleteAppReply": { - "type": "object" + "DeploymentScalingTargetSleepIdleDelay": { + "type": "object", + "properties": { + "value": { + "type": "integer", + "format": "int64", + "description": "DEPRECATED: use deep_sleep_value instead.\nDelay in seconds after which a service which received 0 request is put to deep sleep." + }, + "deep_sleep_value": { + "type": "integer", + "format": "int64", + "description": "Delay in seconds after which a service which received 0 request is put to deep sleep." + }, + "light_sleep_value": { + "type": "integer", + "format": "int64", + "description": "Delay in seconds after which a service which received 0 request is put to light sleep." + } + } }, - "GetAppReply": { + "DeploymentStrategy": { "type": "object", "properties": { - "app": { - "$ref": "#/definitions/App", - "title": "The App retrieved" + "type": { + "$ref": "#/definitions/DeploymentStrategyType", + "title": "Strategy type" } } }, - "ListAppEventsReply": { + "DeploymentStrategyType": { + "type": "string", + "enum": [ + "DEPLOYMENT_STRATEGY_TYPE_INVALID", + "DEPLOYMENT_STRATEGY_TYPE_DEFAULT", + "DEPLOYMENT_STRATEGY_TYPE_CANARY", + "DEPLOYMENT_STRATEGY_TYPE_ROLLING", + "DEPLOYMENT_STRATEGY_TYPE_BLUE_GREEN", + "DEPLOYMENT_STRATEGY_TYPE_IMMEDIATE" + ], + "default": "DEPLOYMENT_STRATEGY_TYPE_INVALID", + "description": " - DEPLOYMENT_STRATEGY_TYPE_INVALID: DEPRECATED: Use DEPLOYMENT_STRATEGY_TYPE_DEFAULT instead.\n - DEPLOYMENT_STRATEGY_TYPE_DEFAULT: Default/unspecified strategy (resolves to platform default, currently ROLLING).\n - DEPLOYMENT_STRATEGY_TYPE_CANARY: Use canary strategy.\n - DEPLOYMENT_STRATEGY_TYPE_ROLLING: Use rolling strategy.\n - DEPLOYMENT_STRATEGY_TYPE_BLUE_GREEN: Use blue green strategy.\n - DEPLOYMENT_STRATEGY_TYPE_IMMEDIATE: Use immediate strategy." + }, + "DockerBuilder": { "type": "object", "properties": { - "events": { + "dockerfile": { + "type": "string", + "title": "A path to the Dockerfile" + }, + "entrypoint": { "type": "array", "items": { - "$ref": "#/definitions/AppEvent" + "type": "string" }, - "title": "The collection of events" + "title": "The docker ENTRYPOINT" }, - "limit": { - "type": "integer", - "format": "int64", - "title": "The limit in the request" + "command": { + "type": "string", + "title": "The docker CMD" }, - "offset": { - "type": "integer", - "format": "int64", - "title": "The offset in the request" + "args": { + "type": "array", + "items": { + "type": "string" + }, + "title": "The docker CMD args" }, - "order": { + "target": { "type": "string", - "title": "The order in the request" + "title": "The target for multi-stage builds" }, - "has_next": { + "privileged": { "type": "boolean", - "title": "If there is more items after in the collection" + "title": "A flag to run the container in privileged mode" } } }, - "ListAppsReply": { + "DockerSource": { "type": "object", "properties": { - "apps": { + "image": { + "type": "string" + }, + "command": { + "type": "string" + }, + "args": { "type": "array", "items": { - "$ref": "#/definitions/AppListItem" + "type": "string" } }, - "limit": { - "type": "integer", - "format": "int64", - "title": "The limit in the request" - }, - "offset": { - "type": "integer", - "format": "int64", - "title": "The offset in the request" + "image_registry_secret": { + "type": "string" }, - "count": { - "type": "integer", - "format": "int64", - "title": "The total number of items" + "entrypoint": { + "type": "array", + "items": { + "type": "string" + } }, - "has_next": { + "privileged": { "type": "boolean", - "title": "If there is more items after in the collection" + "title": "A flag to run the container in privileged mode" } } }, - "PauseAppReply": { - "type": "object" - }, - "ResumeAppReply": { - "type": "object" - }, - "UpdateApp": { + "Env": { "type": "object", "properties": { - "name": { + "key": { "type": "string" }, - "life_cycle": { - "$ref": "#/definitions/AppLifeCycle" + "value": { + "type": "string" + }, + "secret": { + "type": "string" } } }, - "UpdateAppReply": { + "GetRegionalDeploymentReply": { "type": "object", "properties": { - "app": { - "$ref": "#/definitions/App", - "title": "The entity updated" + "regional_deployment": { + "$ref": "#/definitions/RegionalDeployment" } } }, - "ReviewOrganizationCapacityReply": { + "GitSource": { "type": "object", "properties": { - "has_capacity": { - "type": "boolean" + "repository": { + "type": "string", + "description": "A url to a git repository (contains the provider as well) .e.g: github.com/koyeb/test." + }, + "branch": { + "type": "string", + "title": "A git branch that will be tracked for new commits and deployments will be created" + }, + "tag": { + "type": "string", + "title": "A git tag that should be built" + }, + "sha": { + "type": "string", + "title": "A git commit that should be built (useful for pinning to a commit, this will always be set when a deployment is created by a code push)" + }, + "build_command": { + "type": "string", + "title": "A command used to override the build command, run after all build steps \u2014 deprecated, use buildpack.build_command instead" + }, + "run_command": { + "type": "string", + "title": "A command used to override the default run command - deprecated, use buildpack.run_command instead" + }, + "no_deploy_on_push": { + "type": "boolean", + "title": "A flag to disable a new deployment when a push event is detected" + }, + "workdir": { + "type": "string", + "title": "A subdirectory to use as the build directory" + }, + "buildpack": { + "$ref": "#/definitions/BuildpackBuilder" + }, + "docker": { + "$ref": "#/definitions/DockerBuilder" } } }, - "ReviewOrganizationCapacityRequest": { + "HTTPHeader": { "type": "object", "properties": { - "plan": { + "key": { "type": "string" }, - "trialing": { - "type": "boolean" + "value": { + "type": "string" } } }, - "AutocompleteReply": { + "HTTPHealthCheck": { "type": "object", "properties": { - "secrets": { - "type": "array", - "items": { - "type": "string" - }, - "title": "List of available secrets" + "port": { + "type": "integer", + "format": "int64", + "title": "The port to use to perform the health check, must be declared in the ports section" }, - "user_env": { - "type": "array", - "items": { - "type": "string" - }, - "title": "List of available user's environment variables" + "path": { + "type": "string", + "title": "The path to use to perform the HTTP health check" }, - "system_env": { + "method": { + "type": "string", + "title": "An optional HTTP method to use to perform the health check, default is GET" + }, + "headers": { "type": "array", "items": { - "type": "string" + "$ref": "#/definitions/HTTPHeader" }, - "title": "List of available system's environment variables" - } - } - }, - "AutocompleteRequest": { - "type": "object", - "properties": { - "definition": { - "$ref": "#/definitions/DeploymentDefinition", - "title": "Deployment definition" - } - } - }, - "CreateServiceReply": { - "type": "object", - "properties": { - "service": { - "$ref": "#/definitions/Service", - "title": "The entity created" - } - } - }, - "DeleteServiceReply": { - "type": "object" - }, - "GetServiceReply": { - "type": "object", - "properties": { - "service": { - "$ref": "#/definitions/Service", - "title": "The Service retrieved" + "title": "An optional list of HTTP headers to provide when performing the request, default is empty" } } }, - "ListServiceEventsReply": { + "ListRegionalDeploymentEventsReply": { "type": "object", "properties": { "events": { "type": "array", "items": { - "$ref": "#/definitions/ServiceEvent" + "$ref": "#/definitions/RegionalDeploymentEvent" }, "title": "The collection of events" }, @@ -15878,14 +16461,15 @@ } } }, - "ListServicesReply": { + "ListRegionalDeploymentsReply": { "type": "object", "properties": { - "services": { + "regional_deployments": { "type": "array", "items": { - "$ref": "#/definitions/ServiceListItem" - } + "$ref": "#/definitions/RegionalDeploymentListItem" + }, + "title": "The collection of regional deployments" }, "limit": { "type": "integer", @@ -15908,77 +16492,51 @@ } } }, - "PauseServiceReply": { - "type": "object" - }, - "RedeployReply": { - "type": "object", - "properties": { - "deployment": { - "$ref": "#/definitions/Deployment", - "title": "The entity updated" - } - } - }, - "RedeployRequest.Info": { + "Port": { "type": "object", "properties": { - "deployment_group": { - "type": "string" + "port": { + "type": "integer", + "format": "int64" }, - "sha": { + "protocol": { "type": "string" - }, - "use_cache": { - "type": "boolean" - }, - "skip_build": { - "type": "boolean", - "description": "If set to true, the build stage will be skipped and the image coming from the last successful build step will be used instead.\nThe call fails if no previous successful builds happened." } } }, - "ResumeServiceReply": { - "type": "object" - }, - "ServiceEvent": { + "RegionalDeployment": { "type": "object", "properties": { "id": { "type": "string" }, - "when": { + "created_at": { "type": "string", "format": "date-time" }, - "organization_id": { - "type": "string" - }, - "service_id": { - "type": "string" + "updated_at": { + "type": "string", + "format": "date-time" }, - "type": { - "type": "string" + "scheduled_at": { + "type": "string", + "format": "date-time" }, - "message": { - "type": "string" + "allocated_at": { + "type": "string", + "format": "date-time" }, - "metadata": { - "type": "object" - } - } - }, - "ServiceListItem": { - "type": "object", - "properties": { - "id": { - "type": "string" + "started_at": { + "type": "string", + "format": "date-time" }, - "name": { - "type": "string" + "succeeded_at": { + "type": "string", + "format": "date-time" }, - "type": { - "$ref": "#/definitions/Service.Type" + "terminated_at": { + "type": "string", + "format": "date-time" }, "organization_id": { "type": "string" @@ -15986,16 +16544,20 @@ "app_id": { "type": "string" }, - "updated_at": { - "type": "string", - "format": "date-time" + "service_id": { + "type": "string" }, - "created_at": { - "type": "string", - "format": "date-time" + "region": { + "type": "string" + }, + "parent_id": { + "type": "string" + }, + "child_id": { + "type": "string" }, "status": { - "$ref": "#/definitions/Service.Status" + "$ref": "#/definitions/RegionalDeployment.Status" }, "messages": { "type": "array", @@ -16003,299 +16565,274 @@ "type": "string" } }, - "version": { - "type": "string", - "format": "uint64", - "title": "A version updated whenever this state changes (useful for caching)" - }, - "state": { - "$ref": "#/definitions/ServiceState" - }, - "active_deployment_id": { - "type": "string" - }, - "latest_deployment_id": { - "type": "string" - }, - "life_cycle": { - "$ref": "#/definitions/ServiceLifeCycle" - } - } - }, - "UpdateService": { - "type": "object", - "properties": { "definition": { - "$ref": "#/definitions/DeploymentDefinition" + "$ref": "#/definitions/RegionalDeploymentDefinition" }, - "metadata": { - "$ref": "#/definitions/DeploymentMetadata" + "datacenters": { + "type": "array", + "items": { + "type": "string" + } }, - "skip_build": { - "type": "boolean", - "description": "If set to true, the build stage will be skipped and the image coming from the last successful build step will be used instead.\nThe call fails if no previous successful builds happened." + "metadata": { + "$ref": "#/definitions/RegionalDeploymentMetadata" }, - "save_only": { - "type": "boolean", - "title": "If set, do not trigger a deployment, only store the new settings" + "provisioning_info": { + "$ref": "#/definitions/DeploymentProvisioningInfo" }, - "life_cycle": { - "$ref": "#/definitions/ServiceLifeCycle" - } - } - }, - "UpdateServiceReply": { - "type": "object", - "properties": { - "service": { - "$ref": "#/definitions/Service", - "title": "The entity updated" - } - } - }, - "AzureContainerRegistryConfiguration": { - "type": "object", - "properties": { - "registry_name": { - "type": "string" + "role": { + "$ref": "#/definitions/RegionalDeployment.Role" }, - "username": { - "type": "string" + "version": { + "type": "string", + "format": "uint64" }, - "password": { + "deployment_group": { + "type": "string", + "title": "Legacy stuff" + }, + "deployment_id": { "type": "string" } } }, - "CreateSecret": { + "RegionalDeployment.Role": { + "type": "string", + "enum": [ + "INVALID", + "ACTIVE", + "UPCOMING", + "CURRENT" + ], + "default": "INVALID" + }, + "RegionalDeployment.Status": { + "type": "string", + "enum": [ + "PENDING", + "PROVISIONING", + "SCHEDULED", + "CANCELING", + "CANCELED", + "ALLOCATING", + "STARTING", + "HEALTHY", + "DEGRADED", + "UNHEALTHY", + "STOPPING", + "STOPPED", + "ERRORING", + "ERROR", + "SLEEPING" + ], + "default": "PENDING" + }, + "RegionalDeploymentDefinition": { "type": "object", "properties": { "name": { "type": "string" }, "type": { - "$ref": "#/definitions/SecretType" - }, - "value": { - "type": "string" + "$ref": "#/definitions/RegionalDeploymentDefinition.Type" }, - "docker_hub_registry": { - "$ref": "#/definitions/DockerHubRegistryConfiguration" + "strategy": { + "$ref": "#/definitions/DeploymentStrategy" }, - "private_registry": { - "$ref": "#/definitions/PrivateRegistryConfiguration" + "routes": { + "type": "array", + "items": { + "$ref": "#/definitions/Route" + } }, - "digital_ocean_registry": { - "$ref": "#/definitions/DigitalOceanRegistryConfiguration" + "ports": { + "type": "array", + "items": { + "$ref": "#/definitions/Port" + } }, - "github_registry": { - "$ref": "#/definitions/GitHubRegistryConfiguration" + "env": { + "type": "array", + "items": { + "$ref": "#/definitions/Env" + } }, - "gitlab_registry": { - "$ref": "#/definitions/GitLabRegistryConfiguration" + "region": { + "type": "string" }, - "gcp_container_registry": { - "$ref": "#/definitions/GCPContainerRegistryConfiguration" + "scaling": { + "$ref": "#/definitions/Scaling" }, - "azure_container_registry": { - "$ref": "#/definitions/AzureContainerRegistryConfiguration" - } - } - }, - "CreateSecretReply": { - "type": "object", - "properties": { - "secret": { - "$ref": "#/definitions/Secret" - } - } - }, - "DatabaseRolePassword": { - "type": "object", - "properties": { - "username": { + "instance_type": { "type": "string" }, - "password": { + "deployment_group": { "type": "string" + }, + "health_checks": { + "type": "array", + "items": { + "$ref": "#/definitions/DeploymentHealthCheck" + } + }, + "volumes": { + "type": "array", + "items": { + "$ref": "#/definitions/RegionalDeploymentVolume" + } + }, + "config_files": { + "type": "array", + "items": { + "$ref": "#/definitions/ConfigFile" + } + }, + "skip_cache": { + "type": "boolean" + }, + "docker": { + "$ref": "#/definitions/DockerSource" + }, + "git": { + "$ref": "#/definitions/GitSource" + }, + "archive": { + "$ref": "#/definitions/ArchiveSource" } } }, - "DeleteSecretReply": { - "type": "object" + "RegionalDeploymentDefinition.Type": { + "type": "string", + "enum": [ + "INVALID", + "WEB", + "WORKER", + "_", + "SANDBOX" + ], + "default": "INVALID", + "title": "- _: We match with DeploymentDefinition.Type, so we skip 3 which is DATABASE" }, - "DigitalOceanRegistryConfiguration": { + "RegionalDeploymentEvent": { "type": "object", "properties": { - "username": { + "id": { "type": "string" }, - "password": { - "type": "string" - } - } - }, - "DockerHubRegistryConfiguration": { - "type": "object", - "properties": { - "username": { - "type": "string" + "when": { + "type": "string", + "format": "date-time" }, - "password": { - "type": "string" - } - } - }, - "GCPContainerRegistryConfiguration": { - "type": "object", - "properties": { - "keyfile_content": { + "organization_id": { "type": "string" }, - "url": { + "regional_deployment_id": { "type": "string" - } - } - }, - "GetSecretReply": { - "type": "object", - "properties": { - "secret": { - "$ref": "#/definitions/Secret" - } - } - }, - "GitHubRegistryConfiguration": { - "type": "object", - "properties": { - "username": { + }, + "type": { "type": "string" }, - "password": { + "message": { "type": "string" + }, + "metadata": { + "type": "object" } } }, - "GitLabRegistryConfiguration": { + "RegionalDeploymentListItem": { "type": "object", "properties": { - "username": { + "id": { "type": "string" }, - "password": { + "created_at": { + "type": "string", + "format": "date-time" + }, + "updated_at": { + "type": "string", + "format": "date-time" + }, + "region": { "type": "string" - } - } - }, - "ListSecretsReply": { - "type": "object", - "properties": { - "secrets": { + }, + "status": { + "$ref": "#/definitions/RegionalDeployment.Status" + }, + "messages": { "type": "array", "items": { - "$ref": "#/definitions/Secret" + "type": "string" } }, - "limit": { - "type": "integer", - "format": "int64" - }, - "offset": { - "type": "integer", - "format": "int64" - }, - "count": { - "type": "integer", - "format": "int64" + "definition": { + "$ref": "#/definitions/RegionalDeploymentDefinition" } } }, - "PrivateRegistryConfiguration": { + "RegionalDeploymentMetadata": { + "type": "object" + }, + "RegionalDeploymentVolume": { "type": "object", "properties": { - "username": { - "type": "string" + "id": { + "type": "string", + "title": "the id of the volume" }, - "password": { - "type": "string" + "path": { + "type": "string", + "title": "the path where the volume is mounted to" }, - "url": { - "type": "string" + "replica_index": { + "type": "integer", + "format": "int64", + "title": "the replica index to mount the volume to" } } }, - "RevealSecretReply": { + "Route": { "type": "object", "properties": { - "value": {} + "port": { + "type": "integer", + "format": "int64" + }, + "path": { + "type": "string" + }, + "security_policies": { + "$ref": "#/definitions/SecurityPolicies" + } } }, - "Secret": { + "Scaling": { "type": "object", "properties": { - "id": { - "type": "string" - }, - "name": { - "type": "string" - }, - "organization_id": { - "type": "string" - }, - "type": { - "$ref": "#/definitions/SecretType" - }, - "updated_at": { - "type": "string", - "format": "date-time" - }, - "created_at": { - "type": "string", - "format": "date-time" - }, - "value": { - "type": "string" - }, - "docker_hub_registry": { - "$ref": "#/definitions/DockerHubRegistryConfiguration" - }, - "private_registry": { - "$ref": "#/definitions/PrivateRegistryConfiguration" - }, - "digital_ocean_registry": { - "$ref": "#/definitions/DigitalOceanRegistryConfiguration" - }, - "github_registry": { - "$ref": "#/definitions/GitHubRegistryConfiguration" - }, - "gitlab_registry": { - "$ref": "#/definitions/GitLabRegistryConfiguration" - }, - "gcp_container_registry": { - "$ref": "#/definitions/GCPContainerRegistryConfiguration" + "min": { + "type": "integer", + "format": "int64" }, - "azure_container_registry": { - "$ref": "#/definitions/AzureContainerRegistryConfiguration" + "max": { + "type": "integer", + "format": "int64" }, - "database_role_password": { - "$ref": "#/definitions/DatabaseRolePassword" + "targets": { + "type": "array", + "items": { + "$ref": "#/definitions/DeploymentScalingTarget" + } } } }, - "SecretType": { - "type": "string", - "enum": [ - "SIMPLE", - "REGISTRY", - "MANAGED" - ], - "default": "SIMPLE" - }, - "UpdateSecretReply": { + "TCPHealthCheck": { "type": "object", "properties": { - "secret": { - "$ref": "#/definitions/Secret" + "port": { + "type": "integer", + "format": "int64", + "title": "The port to use to perform the health check, must be declared in the ports section" } } }, @@ -16317,6 +16854,10 @@ "name": { "type": "string", "title": "The name of the snapshot" + }, + "project_id": { + "type": "string", + "title": "(Optional) The project ID to associate with the snapshot" } } }, @@ -16447,1145 +16988,1429 @@ } } }, - "ksearch.App": { + "ArchiveDeploymentMetadata": { "type": "object", "properties": { - "id": { + "last_provisioned_deployment_id": { + "type": "string" + } + } + }, + "AutoRelease": { + "type": "object", + "properties": { + "groups": { + "type": "array", + "items": { + "$ref": "#/definitions/AutoRelease.Group" + } + } + } + }, + "AutoRelease.Group": { + "type": "object", + "properties": { + "name": { "type": "string" }, - "organization_id": { + "repository": { "type": "string" }, - "name": { + "git_ref": { + "type": "string", + "title": "A git ref to track (.e.g: refs/tags/ or refs/heads/" + }, + "latest_sha": { + "type": "string", + "title": "The last hash that was resolved (used to avoid triggering releases when things haven't changed)" + } + }, + "title": "Configuration extracted from the latest deployment in this deployment_group" + }, + "AutocompleteReply": { + "type": "object", + "properties": { + "secrets": { + "type": "array", + "items": { + "type": "string" + }, + "title": "List of available secrets" + }, + "user_env": { + "type": "array", + "items": { + "type": "string" + }, + "title": "List of available user's environment variables" + }, + "system_env": { + "type": "array", + "items": { + "type": "string" + }, + "title": "List of available system's environment variables" + } + } + }, + "AutocompleteRequest": { + "type": "object", + "properties": { + "definition": { + "$ref": "#/definitions/DeploymentDefinition", + "title": "Deployment definition" + } + } + }, + "CreateService": { + "type": "object", + "properties": { + "app_id": { "type": "string" + }, + "definition": { + "$ref": "#/definitions/DeploymentDefinition" + }, + "life_cycle": { + "$ref": "#/definitions/ServiceLifeCycle" + }, + "project_id": { + "type": "string", + "title": "(Optional) The project ID to associate with the service" } } }, - "ksearch.GlobalDeployment": { + "CreateServiceReply": { + "type": "object", + "properties": { + "service": { + "$ref": "#/definitions/Service", + "title": "The entity created" + } + } + }, + "DatabaseDeploymentMetadata": { + "type": "object", + "properties": { + "neon_postgres": { + "$ref": "#/definitions/NeonPostgresDatabaseDeploymentMetadata" + } + } + }, + "DatabaseSource": { + "type": "object", + "properties": { + "neon_postgres": { + "$ref": "#/definitions/NeonPostgresDatabase" + } + } + }, + "DeleteServiceReply": { + "type": "object" + }, + "DeleteServiceScalingReply": { + "type": "object", + "title": "Empty reply - success is indicated by no error" + }, + "Deployment": { "type": "object", "properties": { "id": { "type": "string" }, + "created_at": { + "type": "string", + "format": "date-time" + }, + "updated_at": { + "type": "string", + "format": "date-time" + }, + "allocated_at": { + "type": "string", + "format": "date-time" + }, + "started_at": { + "type": "string", + "format": "date-time" + }, + "succeeded_at": { + "type": "string", + "format": "date-time" + }, + "terminated_at": { + "type": "string", + "format": "date-time" + }, "organization_id": { "type": "string" }, - "app_id": { - "type": "string" + "app_id": { + "type": "string" + }, + "service_id": { + "type": "string" + }, + "parent_id": { + "type": "string" + }, + "child_id": { + "type": "string" + }, + "status": { + "$ref": "#/definitions/Deployment.Status" + }, + "metadata": { + "$ref": "#/definitions/DeploymentMetadata" + }, + "definition": { + "$ref": "#/definitions/DeploymentDefinition" + }, + "messages": { + "type": "array", + "items": { + "type": "string" + } + }, + "provisioning_info": { + "$ref": "#/definitions/DeploymentProvisioningInfo" }, - "service_id": { - "type": "string" - } - } - }, - "ksearch.Instance": { - "type": "object", - "properties": { - "id": { - "type": "string" + "database_info": { + "$ref": "#/definitions/DeploymentDatabaseInfo" }, - "organization_id": { - "type": "string" + "skip_build": { + "type": "boolean" }, - "app_id": { - "type": "string" + "role": { + "$ref": "#/definitions/Deployment.Role" }, - "service_id": { - "type": "string" + "version": { + "type": "string", + "format": "uint64" }, - "allocation_id": { + "deployment_group": { "type": "string" } } }, - "ksearch.Organization": { + "Deployment.Role": { + "type": "string", + "enum": [ + "INVALID", + "ACTIVE", + "UPCOMING", + "CURRENT" + ], + "default": "INVALID" + }, + "Deployment.Status": { + "type": "string", + "enum": [ + "PENDING", + "PROVISIONING", + "SCHEDULED", + "CANCELING", + "CANCELED", + "ALLOCATING", + "STARTING", + "HEALTHY", + "DEGRADED", + "UNHEALTHY", + "STOPPING", + "STOPPED", + "ERRORING", + "ERROR", + "STASHED", + "SLEEPING" + ], + "default": "PENDING" + }, + "DeploymentDatabaseInfo": { "type": "object", "properties": { - "id": { - "type": "string" - }, - "name": { - "type": "string" + "neon_postgres": { + "$ref": "#/definitions/DeploymentNeonPostgresDatabaseInfo" } } }, - "ksearch.RegionalDeployment": { + "DeploymentDefinition": { "type": "object", "properties": { - "id": { + "name": { "type": "string" }, - "organization_id": { - "type": "string" + "type": { + "$ref": "#/definitions/DeploymentDefinition.Type" }, - "app_id": { - "type": "string" + "strategy": { + "$ref": "#/definitions/DeploymentStrategy" }, - "service_id": { - "type": "string" + "routes": { + "type": "array", + "items": { + "$ref": "#/definitions/DeploymentRoute" + } }, - "region": { - "type": "string" - } - } - }, - "ksearch.SearchReply": { - "type": "object", - "properties": { - "organizations": { + "ports": { "type": "array", "items": { - "$ref": "#/definitions/ksearch.Organization" + "$ref": "#/definitions/DeploymentPort" } }, - "users": { + "proxy_ports": { "type": "array", "items": { - "$ref": "#/definitions/ksearch.User" + "$ref": "#/definitions/DeploymentProxyPort" } }, - "apps": { + "env": { "type": "array", "items": { - "$ref": "#/definitions/ksearch.App" + "$ref": "#/definitions/DeploymentEnv" } }, - "services": { + "regions": { "type": "array", "items": { - "$ref": "#/definitions/ksearch.Service" + "type": "string" } }, - "global_deployments": { + "scalings": { "type": "array", "items": { - "$ref": "#/definitions/ksearch.GlobalDeployment" + "$ref": "#/definitions/DeploymentScaling" } }, - "regional_deployments": { + "instance_types": { "type": "array", "items": { - "$ref": "#/definitions/ksearch.RegionalDeployment" + "$ref": "#/definitions/DeploymentInstanceType" } }, - "instances": { + "health_checks": { "type": "array", "items": { - "$ref": "#/definitions/ksearch.Instance" + "$ref": "#/definitions/DeploymentHealthCheck" + } + }, + "volumes": { + "type": "array", + "items": { + "$ref": "#/definitions/DeploymentVolume" + } + }, + "config_files": { + "type": "array", + "items": { + "$ref": "#/definitions/ConfigFile" } + }, + "skip_cache": { + "type": "boolean" + }, + "docker": { + "$ref": "#/definitions/DockerSource" + }, + "git": { + "$ref": "#/definitions/GitSource" + }, + "database": { + "$ref": "#/definitions/DatabaseSource" + }, + "archive": { + "$ref": "#/definitions/ArchiveSource" } } }, - "ksearch.Service": { + "DeploymentDefinition.Type": { + "type": "string", + "enum": [ + "INVALID", + "WEB", + "WORKER", + "DATABASE", + "SANDBOX" + ], + "default": "INVALID" + }, + "DeploymentEnv": { "type": "object", "properties": { - "id": { + "scopes": { + "type": "array", + "items": { + "type": "string" + } + }, + "key": { "type": "string" }, - "organization_id": { + "value": { "type": "string" }, - "app_id": { + "secret": { "type": "string" + } + } + }, + "DeploymentInstanceType": { + "type": "object", + "properties": { + "scopes": { + "type": "array", + "items": { + "type": "string" + } }, - "name": { + "type": { "type": "string" } } }, - "ksearch.User": { + "DeploymentMetadata": { "type": "object", "properties": { - "id": { + "trigger": { + "$ref": "#/definitions/TriggerDeploymentMetadata" + }, + "database": { + "$ref": "#/definitions/DatabaseDeploymentMetadata" + }, + "git": { + "$ref": "#/definitions/GitDeploymentMetadata" + }, + "archive": { + "$ref": "#/definitions/ArchiveDeploymentMetadata" + }, + "proxy_ports": { + "type": "array", + "items": { + "$ref": "#/definitions/DeploymentProxyPortMetadata" + } + }, + "sandbox": { + "$ref": "#/definitions/SandboxMetadata" + } + } + }, + "DeploymentNeonPostgresDatabaseInfo": { + "type": "object", + "properties": { + "active_time_seconds": { + "type": "string", + "format": "int64" + }, + "compute_time_seconds": { + "type": "string", + "format": "int64" + }, + "written_data_bytes": { + "type": "string", + "format": "int64" + }, + "data_transfer_bytes": { + "type": "string", + "format": "int64" + }, + "data_storage_bytes_hour": { + "type": "string", + "format": "int64" + }, + "server_host": { "type": "string" }, - "email": { + "server_port": { + "type": "integer", + "format": "int64" + }, + "endpoint_state": { + "type": "string" + }, + "endpoint_last_active": { + "type": "string", + "format": "date-time" + }, + "default_branch_id": { + "type": "string" + }, + "default_branch_name": { "type": "string" }, - "name": { + "default_branch_state": { "type": "string" }, - "github_user": { - "type": "string" + "default_branch_logical_size": { + "type": "string", + "format": "int64" + }, + "roles": { + "type": "array", + "items": { + "$ref": "#/definitions/DeploymentNeonPostgresDatabaseInfoRole" + } } } }, - "Activity": { + "DeploymentNeonPostgresDatabaseInfoRole": { "type": "object", "properties": { - "id": { + "name": { "type": "string" }, - "actor": { - "$ref": "#/definitions/Object" - }, - "object": { - "$ref": "#/definitions/Object" - }, - "verb": { + "secret_id": { "type": "string" - }, - "metadata": { - "type": "object" - }, - "created_at": { - "type": "string", - "format": "date-time" } } }, - "ActivityList": { + "DeploymentPort": { "type": "object", "properties": { - "activities": { - "type": "array", - "items": { - "$ref": "#/definitions/Activity" - } - }, - "limit": { - "type": "integer", - "format": "int64" - }, - "offset": { + "port": { "type": "integer", "format": "int64" }, - "has_next": { - "type": "boolean" + "protocol": { + "type": "string", + "title": "One of http, http2, tcp" } } }, - "Notification": { + "DeploymentProxyPort": { "type": "object", "properties": { - "id": { - "type": "string" - }, - "activity": { - "$ref": "#/definitions/Activity" - }, - "is_read": { - "type": "boolean" - }, - "is_seen": { - "type": "boolean" + "port": { + "type": "integer", + "format": "int64" }, - "created_at": { - "type": "string", - "format": "date-time" + "protocol": { + "$ref": "#/definitions/ProxyPortProtocol" } } }, - "NotificationList": { + "DeploymentProxyPortMetadata": { "type": "object", "properties": { - "notifications": { - "type": "array", - "items": { - "$ref": "#/definitions/Notification" - } - }, - "limit": { - "type": "integer", - "format": "int64" - }, - "offset": { - "type": "integer", - "format": "int64" + "host": { + "type": "string" }, - "count": { + "public_port": { "type": "integer", "format": "int64" }, - "is_read": { - "type": "boolean" - }, - "is_seen": { - "type": "boolean" - }, - "unread": { + "port": { "type": "integer", "format": "int64" }, - "unseen": { - "type": "integer", - "format": "int64" + "protocol": { + "$ref": "#/definitions/ProxyPortProtocol" } } }, - "Object": { + "DeploymentRoute": { "type": "object", "properties": { - "id": { - "type": "string" - }, - "name": { - "type": "string" + "port": { + "type": "integer", + "format": "int64" }, - "type": { + "path": { "type": "string" }, - "metadata": { - "type": "object" - }, - "deleted": { - "type": "boolean" - } - } - }, - "GetRegionReply": { - "type": "object", - "properties": { - "region": { - "$ref": "#/definitions/Region", - "title": "The Region retrieved" + "security_policies": { + "$ref": "#/definitions/SecurityPolicies" } } }, - "ListRegionsReply": { + "DeploymentScaling": { "type": "object", "properties": { - "regions": { + "scopes": { "type": "array", "items": { - "$ref": "#/definitions/RegionListItem" + "type": "string" } }, - "limit": { + "min": { "type": "integer", - "format": "int64", - "title": "The limit in the request" + "format": "int64" }, - "offset": { + "max": { "type": "integer", - "format": "int64", - "title": "The offset in the request" + "format": "int64" }, - "count": { - "type": "integer", - "format": "int64", - "title": "The total number of items" + "targets": { + "type": "array", + "items": { + "$ref": "#/definitions/DeploymentScalingTarget" + } } } }, - "Region": { + "DeploymentVolume": { "type": "object", "properties": { "id": { "type": "string", - "title": "The id of the region" + "title": "the id of the volume" }, - "name": { + "path": { "type": "string", - "title": "The name of the region" - }, - "coordinates": { - "type": "array", - "items": { - "type": "string" - }, - "title": "The coordinates of the region (lat/long)" + "title": "the path where the volume is mounted to" }, - "status": { - "type": "string", - "title": "The status of the region" + "replica_index": { + "type": "integer", + "format": "int64", + "title": "optionally, explicitly choose the replica index to mount the volume to" }, - "instances": { + "scopes": { "type": "array", "items": { "type": "string" }, - "title": "A list of instances available in this region" - }, - "datacenters": { + "title": "scope of the associated" + } + } + }, + "DesiredDeployment": { + "type": "object", + "properties": { + "groups": { "type": "array", "items": { - "type": "string" - }, - "title": "A list of datacenters available in this region" - }, - "volumes_enabled": { - "type": "boolean", - "title": "Are the volumes enabled for this instance type" - }, - "scope": { - "type": "string", - "description": "The scope of the region, continent, metropolitan area, etc." + "$ref": "#/definitions/DesiredDeployment.Group" + } } } }, - "RegionListItem": { + "DesiredDeployment.Group": { "type": "object", "properties": { - "id": { - "type": "string", - "title": "The id of the region" - }, "name": { - "type": "string", - "title": "The name of the region" + "type": "string" }, - "coordinates": { + "deployment_ids": { "type": "array", "items": { "type": "string" - }, - "title": "The coordinates of the region (lat/long)" - }, - "status": { - "type": "string", - "title": "The status of the region" - }, - "instances": { + } + } + } + }, + "GetServiceReply": { + "type": "object", + "properties": { + "service": { + "$ref": "#/definitions/Service", + "title": "The Service retrieved" + } + } + }, + "GetServiceScalingReply": { + "type": "object", + "properties": { + "scalings": { "type": "array", "items": { - "type": "string" + "$ref": "#/definitions/ManualServiceScaling" }, - "title": "A list of instances available in this region" + "title": "The current manual scaling configuration" + } + } + }, + "GitDeploymentMetadata": { + "type": "object", + "properties": { + "last_provisioned_deployment_id": { + "type": "string" }, - "datacenters": { - "type": "array", - "items": { - "type": "string" - }, - "title": "A list of datacenters available in this region" + "git_env": { + "$ref": "#/definitions/GitEnvDeploymentMetadata" + } + } + }, + "GitEnvDeploymentMetadata": { + "type": "object", + "properties": { + "sha": { + "type": "string" }, - "volumes_enabled": { - "type": "boolean", - "title": "Are the volumes enabled for this instance type" + "commit_author": { + "type": "string" }, - "scope": { - "type": "string", - "description": "The scope of the region, continent, metropolitan area, etc." + "commit_message": { + "type": "string" } } }, - "CatalogGPUDetails": { + "ListServiceEventsReply": { "type": "object", "properties": { - "count": { + "events": { + "type": "array", + "items": { + "$ref": "#/definitions/ServiceEvent" + }, + "title": "The collection of events" + }, + "limit": { "type": "integer", "format": "int64", - "title": "The number of GPUs" + "title": "The limit in the request" }, - "brand": { - "type": "string", - "title": "The brand of GPU" + "offset": { + "type": "integer", + "format": "int64", + "title": "The offset in the request" }, - "memory": { + "order": { "type": "string", - "title": "GPU memory" + "title": "The order in the request" }, - "name": { - "type": "string", - "title": "Name of GPU" + "has_next": { + "type": "boolean", + "title": "If there is more items after in the collection" } } }, - "CatalogInstance": { + "ListServicesReply": { "type": "object", "properties": { - "id": { - "type": "string", - "title": "The name of the instance" + "services": { + "type": "array", + "items": { + "$ref": "#/definitions/ServiceListItem" + } }, - "description": { - "type": "string", - "title": "A short description of the instance" + "limit": { + "type": "integer", + "format": "int64", + "title": "The limit in the request" }, - "vcpu": { + "offset": { "type": "integer", "format": "int64", - "description": "The number of cpus. Deprecated. Use vcpu_shares instead." + "title": "The offset in the request" }, - "memory": { - "type": "string", - "title": "The memory in bytes in a format like 5MB" + "count": { + "type": "integer", + "format": "int64", + "title": "The total number of items" }, - "disk": { - "type": "string", - "title": "The size of the disk in bytes in a format like 5MB" + "has_next": { + "type": "boolean", + "title": "If there is more items after in the collection" + } + } + }, + "ManualServiceScaling": { + "type": "object", + "properties": { + "scopes": { + "type": "array", + "items": { + "type": "string" + } }, - "price_per_second": { - "type": "string", - "title": "The price to pay per second" + "instances": { + "type": "integer", + "format": "int64" + } + } + }, + "NeonPostgresDatabase": { + "type": "object", + "properties": { + "pg_version": { + "type": "integer", + "format": "int64" }, - "price_hourly": { - "type": "string", - "title": "The price to pay per hour" + "region": { + "type": "string" }, - "price_monthly": { - "type": "string", - "title": "The price to pay per month" + "instance_type": { + "type": "string" }, - "regions": { + "roles": { "type": "array", "items": { - "type": "string" - }, - "title": "The regions where this instance type is available" - }, - "status": { - "type": "string", - "title": "The status of the instance" + "$ref": "#/definitions/NeonPostgresDatabase.NeonRole" + } }, - "require_plan": { + "databases": { "type": "array", "items": { - "type": "string" - }, - "title": "The plan required to use instance" - }, - "vcpu_shares": { - "type": "number", - "format": "float", - "description": "The number of vcpu shares reserved for the instance." + "$ref": "#/definitions/NeonPostgresDatabase.NeonDatabase" + } + } + } + }, + "NeonPostgresDatabase.NeonDatabase": { + "type": "object", + "properties": { + "name": { + "type": "string" }, - "display_name": { - "type": "string", - "title": "The display name of the instance" + "owner": { + "type": "string" + } + } + }, + "NeonPostgresDatabase.NeonRole": { + "type": "object", + "properties": { + "name": { + "type": "string" }, - "aliases": { + "secret": { + "type": "string" + } + } + }, + "NeonPostgresDatabaseDeploymentMetadata": { + "type": "object", + "properties": { + "reset_role_passwords": { "type": "array", "items": { "type": "string" - }, - "title": "Aliases" - }, - "type": { - "type": "string", - "title": "The type of the instance (e.g. \"gpu\")" + } + } + } + }, + "PauseServiceReply": { + "type": "object" + }, + "ProxyPortProtocol": { + "type": "string", + "enum": [ + "tcp" + ], + "default": "tcp" + }, + "RedeployReply": { + "type": "object", + "properties": { + "deployment": { + "$ref": "#/definitions/Deployment", + "title": "The entity updated" + } + } + }, + "RedeployRequest.Info": { + "type": "object", + "properties": { + "deployment_group": { + "type": "string" }, - "gpu": { - "$ref": "#/definitions/CatalogGPUDetails", - "title": "GPU details" + "sha": { + "type": "string" }, - "service_types": { - "type": "array", - "items": { - "type": "string" - }, - "title": "Allowed service types for this instance (e.g. [\"web\", \"worker\"])" + "use_cache": { + "type": "boolean" }, - "volumes_enabled": { + "skip_build": { "type": "boolean", - "title": "Are the volumes enabled for this instance type" + "description": "If set to true, the build stage will be skipped and the image coming from the last successful build step will be used instead.\nThe call fails if no previous successful builds happened." + } + } + }, + "ResumeServiceReply": { + "type": "object" + }, + "SandboxMetadata": { + "type": "object", + "properties": { + "public_url": { + "type": "string" }, - "light_sleep_enabled": { - "type": "boolean", - "title": "Is light sleep enabled for this instance type" + "routing_key": { + "type": "string" } } }, - "CatalogInstanceListItem": { + "Service": { "type": "object", "properties": { "id": { - "type": "string", - "title": "The name of the instance" + "type": "string" }, - "description": { + "created_at": { "type": "string", - "title": "A short description of the instance" + "format": "date-time" }, - "vcpu": { - "type": "integer", - "format": "int64", - "description": "The number of cpus. Deprecated. Use vcpu_shares instead." + "updated_at": { + "type": "string", + "format": "date-time" }, - "memory": { + "started_at": { "type": "string", - "title": "The memory in bytes in a format like 5MB" + "format": "date-time" }, - "disk": { + "succeeded_at": { "type": "string", - "title": "The size of the disk in bytes in a format like 5MB" + "format": "date-time" }, - "price_per_second": { + "paused_at": { "type": "string", - "title": "The price to pay per second" + "format": "date-time" }, - "price_hourly": { + "resumed_at": { "type": "string", - "title": "The price to pay per hour" + "format": "date-time" }, - "price_monthly": { + "terminated_at": { "type": "string", - "title": "The price to pay per month" + "format": "date-time" }, - "regions": { - "type": "array", - "items": { - "type": "string" - }, - "title": "The regions where this instance type is available" + "name": { + "type": "string" }, - "status": { - "type": "string", - "title": "The status of the instance" + "type": { + "$ref": "#/definitions/Service.Type" }, - "require_plan": { - "type": "array", - "items": { - "type": "string" - }, - "title": "The plan required to use instance" + "organization_id": { + "type": "string" }, - "vcpu_shares": { - "type": "number", - "format": "float", - "description": "The number of vcpu shares reserved for the instance." + "app_id": { + "type": "string" }, - "display_name": { - "type": "string", - "title": "The display name of the instance" + "status": { + "$ref": "#/definitions/Service.Status" }, - "aliases": { + "messages": { "type": "array", "items": { "type": "string" - }, - "title": "Aliases" + } }, - "type": { + "version": { "type": "string", - "title": "The type of the instance (e.g. \"gpu\")" + "format": "uint64" }, - "gpu": { - "$ref": "#/definitions/CatalogGPUDetails", - "title": "GPU details" + "active_deployment_id": { + "type": "string" }, - "service_types": { - "type": "array", - "items": { - "type": "string" - }, - "title": "Allowed service types for this instance (e.g. [\"web\", \"worker\"])" + "latest_deployment_id": { + "type": "string" }, - "volumes_enabled": { - "type": "boolean", - "title": "Are the volumes enabled for this instance type" + "last_provisioned_deployment_id": { + "type": "string" }, - "light_sleep_enabled": { - "type": "boolean", - "title": "Is light sleep enabled for this instance type" + "state": { + "$ref": "#/definitions/ServiceState", + "title": "Legacy stuff" + }, + "life_cycle": { + "$ref": "#/definitions/ServiceLifeCycle" } } }, - "GetCatalogInstanceReply": { + "Service.Status": { + "type": "string", + "enum": [ + "STARTING", + "HEALTHY", + "DEGRADED", + "UNHEALTHY", + "DELETING", + "DELETED", + "PAUSING", + "PAUSED", + "RESUMING" + ], + "default": "STARTING" + }, + "Service.Type": { + "type": "string", + "enum": [ + "INVALID_TYPE", + "WEB", + "WORKER", + "DATABASE", + "SANDBOX" + ], + "default": "INVALID_TYPE" + }, + "ServiceEvent": { "type": "object", "properties": { - "instance": { - "$ref": "#/definitions/CatalogInstance", - "title": "The instance retrieved" + "id": { + "type": "string" + }, + "when": { + "type": "string", + "format": "date-time" + }, + "organization_id": { + "type": "string" + }, + "service_id": { + "type": "string" + }, + "type": { + "type": "string" + }, + "message": { + "type": "string" + }, + "metadata": { + "type": "object" } } }, - "ListCatalogInstancesReply": { + "ServiceLifeCycle": { "type": "object", "properties": { - "instances": { - "type": "array", - "items": { - "$ref": "#/definitions/CatalogInstanceListItem" - } - }, - "limit": { - "type": "integer", - "format": "int64", - "title": "The limit in the request" - }, - "offset": { + "delete_after_sleep": { "type": "integer", - "format": "int64", - "title": "The offset in the request" + "format": "int64" }, - "count": { + "delete_after_create": { "type": "integer", - "format": "int64", - "title": "The total number of items" + "format": "int64" } } }, - "DatacenterListItem": { + "ServiceListItem": { "type": "object", "properties": { "id": { - "type": "string", - "title": "e.g. \"par1\"" + "type": "string" }, - "region_id": { - "type": "string", - "title": "e.g. \"par\"" + "name": { + "type": "string" }, - "domain": { + "type": { + "$ref": "#/definitions/Service.Type" + }, + "organization_id": { + "type": "string" + }, + "app_id": { + "type": "string" + }, + "updated_at": { "type": "string", - "title": "e.g. \"all-par1.infra.prod.koyeb.com\"" + "format": "date-time" }, - "coordinates": { - "type": "array", - "items": { - "type": "string" - }, - "title": "e.g. \"8.856614\" ,\"2.352221\"?" + "created_at": { + "type": "string", + "format": "date-time" }, - "use_gpu": { - "type": "boolean", - "title": "e.g. true" + "status": { + "$ref": "#/definitions/Service.Status" }, - "regions": { + "messages": { "type": "array", "items": { "type": "string" - }, - "title": "e.g. \"par\", \"fra\"" - } - } - }, - "ListDatacentersReply": { - "type": "object", - "properties": { - "datacenters": { - "type": "array", - "items": { - "$ref": "#/definitions/DatacenterListItem" - } - } - } - }, - "AvailabilityLevel": { - "type": "string", - "enum": [ - "UNKNOWN", - "LOW", - "MEDIUM", - "HIGH" - ], - "default": "UNKNOWN" - }, - "CatalogUsage": { - "type": "object", - "properties": { - "instances": { - "type": "object", - "additionalProperties": { - "$ref": "#/definitions/InstanceAvailability" - } - } - } - }, - "InstanceAvailability": { - "type": "object", - "properties": { - "regions": { - "type": "object", - "additionalProperties": { - "$ref": "#/definitions/RegionAvailability" } }, - "availability": { - "$ref": "#/definitions/AvailabilityLevel" - } - } - }, - "ListUsageReply": { - "type": "object", - "properties": { - "usage": { - "$ref": "#/definitions/CatalogUsage", - "title": "The Usage retrieved" + "version": { + "type": "string", + "format": "uint64", + "title": "A version updated whenever this state changes (useful for caching)" + }, + "state": { + "$ref": "#/definitions/ServiceState" + }, + "active_deployment_id": { + "type": "string" + }, + "latest_deployment_id": { + "type": "string" + }, + "life_cycle": { + "$ref": "#/definitions/ServiceLifeCycle" } } }, - "RegionAvailability": { + "ServiceState": { "type": "object", "properties": { - "availability": { - "$ref": "#/definitions/AvailabilityLevel" + "desired_deployment": { + "$ref": "#/definitions/DesiredDeployment" + }, + "auto_release": { + "$ref": "#/definitions/AutoRelease" } } }, - "ExecCommandIO": { + "TriggerDeploymentMetadata": { "type": "object", "properties": { - "data": { - "type": "string", - "format": "byte", - "description": "Data is base64 encoded" + "type": { + "$ref": "#/definitions/TriggerDeploymentMetadata.TriggerType" }, - "close": { - "type": "boolean", - "description": "Indicate last data frame" + "actor": { + "$ref": "#/definitions/TriggerDeploymentMetadata.ActorType" + }, + "git": { + "$ref": "#/definitions/TriggerGitDeploymentMetadata" } } }, - "ExecCommandReply": { + "TriggerDeploymentMetadata.ActorType": { + "type": "string", + "enum": [ + "UNKNOWN_ACTOR", + "USER", + "SYSTEM" + ], + "default": "UNKNOWN_ACTOR" + }, + "TriggerDeploymentMetadata.TriggerType": { + "type": "string", + "enum": [ + "UNKNOWN_TYPE", + "GIT", + "RESUME", + "DATABASE_SYNC" + ], + "default": "UNKNOWN_TYPE" + }, + "TriggerGitDeploymentMetadata": { "type": "object", "properties": { - "stdout": { - "$ref": "#/definitions/ExecCommandIO" + "provider": { + "$ref": "#/definitions/TriggerGitDeploymentMetadata.Provider" }, - "stderr": { - "$ref": "#/definitions/ExecCommandIO" + "repository": { + "type": "string" }, - "exited": { - "type": "boolean" + "branch": { + "type": "string" }, - "exit_code": { - "type": "integer", - "format": "int32" - } - } - }, - "ExecCommandRequest.Body": { - "type": "object", - "properties": { - "command": { - "type": "array", - "items": { - "type": "string" - }, - "description": "Command to exec. Mandatory in the first frame sent" + "sha": { + "type": "string" }, - "tty_size": { - "$ref": "#/definitions/ExecCommandRequest.TerminalSize" + "message": { + "type": "string" }, - "stdin": { - "$ref": "#/definitions/ExecCommandIO" + "sender_username": { + "type": "string" }, - "disableTty": { - "type": "boolean", - "description": "Disable TTY. It's enough to specify it in the first frame" + "sender_avatar_url": { + "type": "string" + }, + "sender_profile_url": { + "type": "string" } } }, - "ExecCommandRequest.IdType": { + "TriggerGitDeploymentMetadata.Provider": { "type": "string", "enum": [ - "INVALID", - "INSTANCE_ID", - "SERVICE_ID" + "UNKNOWN", + "GITHUB" ], - "default": "INVALID" + "default": "UNKNOWN" }, - "ExecCommandRequest.TerminalSize": { + "UpdateService": { "type": "object", "properties": { - "height": { - "type": "integer", - "format": "int32" + "definition": { + "$ref": "#/definitions/DeploymentDefinition" }, - "width": { - "type": "integer", - "format": "int32" + "metadata": { + "$ref": "#/definitions/DeploymentMetadata" + }, + "skip_build": { + "type": "boolean", + "description": "If set to true, the build stage will be skipped and the image coming from the last successful build step will be used instead.\nThe call fails if no previous successful builds happened." + }, + "save_only": { + "type": "boolean", + "title": "If set, do not trigger a deployment, only store the new settings" + }, + "life_cycle": { + "$ref": "#/definitions/ServiceLifeCycle" } } }, - "GetMetricsReply": { + "UpdateServiceReply": { "type": "object", "properties": { - "metrics": { - "type": "array", - "items": { - "$ref": "#/definitions/GetMetricsReply.Metric" - } + "service": { + "$ref": "#/definitions/Service", + "title": "The entity updated" } } }, - "GetMetricsReply.Metric": { + "UpdateServiceScalingReply": { "type": "object", - "properties": { - "labels": { - "type": "object", - "additionalProperties": { - "type": "string" - } - }, - "samples": { - "type": "array", - "items": { - "$ref": "#/definitions/Sample" - } - } - } + "title": "Empty reply - success is indicated by no error" }, - "MetricName": { - "type": "string", - "enum": [ - "UNKNOWN", - "CPU_TOTAL_PERCENT", - "MEM_RSS", - "HTTP_THROUGHPUT", - "HTTP_RESPONSE_TIME_50P", - "HTTP_RESPONSE_TIME_90P", - "HTTP_RESPONSE_TIME_99P", - "HTTP_RESPONSE_TIME_MAX", - "PUBLIC_DATA_TRANSFER_IN", - "PUBLIC_DATA_TRANSFER_OUT" - ], - "default": "UNKNOWN" + "CancelDeploymentReply": { + "type": "object" }, - "Sample": { + "DeploymentEvent": { "type": "object", "properties": { - "timestamp": { + "id": { "type": "string" }, - "value": { - "type": "number", - "format": "double" + "when": { + "type": "string", + "format": "date-time" + }, + "organization_id": { + "type": "string" + }, + "deployment_id": { + "type": "string" + }, + "type": { + "type": "string" + }, + "message": { + "type": "string" + }, + "metadata": { + "type": "object" } } }, - "LogEntry": { + "DeploymentListItem": { "type": "object", "properties": { - "msg": { + "id": { "type": "string" }, "created_at": { "type": "string", "format": "date-time" }, - "labels": { - "type": "object" - } - } - }, - "QueryLogsReply": { - "type": "object", - "properties": { - "data": { + "updated_at": { + "type": "string", + "format": "date-time" + }, + "allocated_at": { + "type": "string", + "format": "date-time" + }, + "started_at": { + "type": "string", + "format": "date-time" + }, + "succeeded_at": { + "type": "string", + "format": "date-time" + }, + "terminated_at": { + "type": "string", + "format": "date-time" + }, + "organization_id": { + "type": "string" + }, + "app_id": { + "type": "string" + }, + "service_id": { + "type": "string" + }, + "parent_id": { + "type": "string" + }, + "child_id": { + "type": "string" + }, + "status": { + "$ref": "#/definitions/Deployment.Status" + }, + "metadata": { + "$ref": "#/definitions/DeploymentMetadata" + }, + "definition": { + "$ref": "#/definitions/DeploymentDefinition" + }, + "messages": { "type": "array", "items": { - "$ref": "#/definitions/LogEntry" + "type": "string" } }, - "pagination": { - "$ref": "#/definitions/QueryLogsReplyPagination" + "provisioning_info": { + "$ref": "#/definitions/DeploymentProvisioningInfo" + }, + "database_info": { + "$ref": "#/definitions/DeploymentDatabaseInfo" + }, + "version": { + "type": "string", + "format": "uint64" + }, + "deployment_group": { + "type": "string" } } }, - "QueryLogsReplyPagination": { + "GetDeploymentReply": { "type": "object", "properties": { - "has_more": { - "type": "boolean" - }, - "next_start": { - "type": "string", - "format": "date-time" - }, - "next_end": { - "type": "string", - "format": "date-time" + "deployment": { + "$ref": "#/definitions/Deployment" } } }, - "LoginReply": { + "GetDeploymentScalingReply": { "type": "object", "properties": { - "token": { - "$ref": "#/definitions/Token" + "replicas": { + "type": "array", + "items": { + "$ref": "#/definitions/GetDeploymentScalingReplyItem" + }, + "title": "The replicas" } } }, - "LoginRequest": { + "GetDeploymentScalingReplyItem": { "type": "object", - "example": { - "email": "john@snow.com", - "password": "..." - }, "properties": { - "email": { + "region": { "type": "string", - "title": "User email" + "title": "The replica region" }, - "password": { - "type": "string", - "title": "User password" + "replica_index": { + "type": "integer", + "format": "int64" }, - "organization_id": { - "type": "string", - "title": "(Optional) Login into this organization" + "instances": { + "type": "array", + "items": { + "$ref": "#/definitions/Instance" + }, + "description": "An array of `active` and `starting` instances.\n\nStatus of the active instance (and if none the most recent instance)\n string status = 4;\n Status message of the active instance (and if none the most recent instance)\n string message = 5;" } } }, - "LogoutReply": { - "type": "object" - }, - "Token": { + "Instance": { "type": "object", - "example": { - "id": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...", - "expires": "2022-09-08T14:00:00Z", - "user_id": "996d7822-6b58-11e9-956f-32001b70f000", - "organization_id": "9f33b2c6-6b58-11e9-883c-32001b70f000" - }, "properties": { "id": { "type": "string" }, - "user_id": { - "type": "string" - }, - "organization_id": { - "type": "string" + "created_at": { + "type": "string", + "format": "date-time" }, - "expires_at": { + "updated_at": { "type": "string", "format": "date-time" - } - } - }, - "GetIntercomProfileReply": { - "type": "object", - "properties": { - "hash": { - "type": "string" - } - } - }, - "DeleteUserReply": { - "type": "object", - "properties": { - "user": { - "$ref": "#/definitions/User" - } - } - }, - "User": { - "type": "object", - "example": { - "id": "78352123-a06f-4ec2-81ed-27a056725385", - "email": "john@snow.com", - "name": "John Snow", - "avatar_url": "https://www.gravatar.com/avatar/00000000000000000000000000000000", - "is_admin": false, - "is_test": true, - "two_factor_authentication": false, - "last_login": "0001-01-01T00:00:00Z", - "last_login_id": "10.1.1.1", - "updated_at": "0001-01-01T00:00:00Z", - "created_at": "0001-01-01T00:00:00Z", - "newsletter_subscribed": true, - "email_validated": true - }, - "properties": { - "id": { - "type": "string" }, - "email": { + "organization_id": { "type": "string" }, - "avatar_url": { + "app_id": { "type": "string" }, - "two_factor_authentication": { - "type": "boolean" + "service_id": { + "type": "string" }, - "last_login": { - "type": "string", - "format": "date-time" + "regional_deployment_id": { + "type": "string" }, - "last_login_ip": { + "allocation_id": { "type": "string" }, - "updated_at": { - "type": "string", - "format": "date-time" + "type": { + "type": "string" }, - "created_at": { - "type": "string", - "format": "date-time" + "replica_index": { + "type": "integer", + "format": "int64" }, - "newsletter_subscribed": { - "type": "boolean" + "region": { + "type": "string" }, - "github_id": { + "datacenter": { "type": "string" }, - "github_user": { + "hypervisor": { "type": "string" }, - "flags": { + "status": { + "$ref": "#/definitions/Instance.Status" + }, + "messages": { "type": "array", "items": { - "$ref": "#/definitions/UserFlags" + "type": "string" } }, - "name": { - "type": "string" + "started_at": { + "type": "string", + "format": "date-time" }, - "email_validated": { - "type": "boolean" + "succeeded_at": { + "type": "string", + "format": "date-time" }, - "trialed": { - "type": "boolean" + "terminated_at": { + "type": "string", + "format": "date-time" + }, + "xyz_deployment_id": { + "type": "string", + "description": "WARNING: Please don't use the following attribute.\nKoyeb doesn't guarantee backwards compatible breaking change and reserve the right to completely drop it without notice.\nUSE AT YOUR OWN RISK." } - }, - "title": "Represent a User" + } }, - "UserFlags": { + "Instance.Status": { "type": "string", "enum": [ - "ADMIN", - "TEST", - "RESTRICTED", - "ACTIVE", - "BETA", - "MAX_ORGANIZATIONS_25", - "MAX_ORGANIZATIONS_100", - "MAX_ORGANIZATIONS_1000", - "MAX_ORGANIZATIONS_10000", - "MAX_ORGANIZATIONS_100000", - "MAX_ORGANIZATIONS_1000000", - "PARTNER_CSP", - "IGNORE_ORGANIZATION_NAME_RESERVATION_RULE_NEON_PREFIX" + "ALLOCATING", + "STARTING", + "HEALTHY", + "UNHEALTHY", + "STOPPING", + "STOPPED", + "ERROR", + "SLEEPING" ], - "default": "ADMIN", - "title": "- ADMIN: A user is an admin user\n - TEST: A user is a test user\n - RESTRICTED: Whether this account as restricted access\n - ACTIVE: Whether this account is active\n - BETA: Account in beta program\n - MAX_ORGANIZATIONS_25: User can create this much organizations, overriding the default amount\n - PARTNER_CSP: User can create sub-organizations\n - IGNORE_ORGANIZATION_NAME_RESERVATION_RULE_NEON_PREFIX: User can bypass organization name reservations rules" - }, - "ConfirmPaymentAuthorizationReply": { - "type": "object", - "properties": { - "payment_method": { - "$ref": "#/definitions/PaymentMethod" - } - } - }, - "CreatePaymentAuthorizationReply": { - "type": "object", - "properties": { - "payment_method": { - "$ref": "#/definitions/PaymentMethod" - } - } - }, - "CreatePaymentAuthorizationRequest": { - "type": "object" - }, - "DeletePaymentMethodReply": { - "type": "object" + "default": "ALLOCATING" }, - "GetPaymentMethodReply": { + "ListDeploymentEventsReply": { "type": "object", "properties": { - "payment_method": { - "$ref": "#/definitions/PaymentMethod" + "events": { + "type": "array", + "items": { + "$ref": "#/definitions/DeploymentEvent" + }, + "title": "The collection of events" + }, + "limit": { + "type": "integer", + "format": "int64", + "title": "The limit in the request" + }, + "offset": { + "type": "integer", + "format": "int64", + "title": "The offset in the request" + }, + "order": { + "type": "string", + "title": "The order in the request" + }, + "has_next": { + "type": "boolean", + "title": "If there is more items after in the collection" } } }, - "ListPaymentMethodsReply": { + "ListDeploymentsReply": { "type": "object", "properties": { - "payment_methods": { + "deployments": { "type": "array", "items": { - "$ref": "#/definitions/PaymentMethod" + "$ref": "#/definitions/DeploymentListItem" }, - "title": "The collection of payment methods" + "title": "The collection of deployments" }, "limit": { "type": "integer", @@ -17601,205 +18426,205 @@ "type": "integer", "format": "int64", "title": "The total number of items" + }, + "has_next": { + "type": "boolean", + "title": "If there is more items after in the collection" } } }, - "PaymentMethod": { + "CreateStageAttemptReply": { + "type": "object" + }, + "DeclareStageProgressReply": { + "type": "object" + }, + "DeclareStepProgressReply": { + "type": "object" + }, + "VerifyDockerImageReply": { "type": "object", "properties": { - "id": { - "type": "string" - }, - "created_at": { - "type": "string", - "format": "date-time" - }, - "updated_at": { - "type": "string", - "format": "date-time" + "success": { + "type": "boolean", + "title": "Whether the image is accessible or not" }, - "version": { + "reason": { "type": "string", - "format": "uint64" + "title": "(Optional) If the image is not accessible, the reason" }, - "organization_id": { + "code": { + "$ref": "#/definitions/VerifyDockerImageReply.ErrCode", + "title": "(Optional) If the image is not accessible, return an error code" + } + } + }, + "VerifyDockerImageReply.ErrCode": { + "type": "string", + "enum": [ + "UNKNOWN", + "AUTH_ACCESS_DENIED", + "ANON_ACCESS_DENIED", + "AUTH_NOT_FOUND", + "ANON_NOT_FOUND", + "REGISTRY_ERROR", + "TIMEOUT", + "DNS", + "MALFORMED", + "INVALID_OS", + "INVALID_ARCH", + "INVALID_SCHEME", + "GENERIC" + ], + "default": "UNKNOWN", + "description": "- UNKNOWN: Default value\n - AUTH_ACCESS_DENIED: The registry denied access to an authenticated request\n - ANON_ACCESS_DENIED: The registry denied access to an anonymous request\n - AUTH_NOT_FOUND: The image has not been found after an authenticated request\n - ANON_NOT_FOUND: The image has not been found after an anonymous request\n - REGISTRY_ERROR: The registry returned an error\n - TIMEOUT: The request to the registry timed out\n - DNS: There was an error trying to resolve the name of the registry\n - MALFORMED: The provided image name is malformed\n - INVALID_OS: The operating system is not supported\n - INVALID_ARCH: The architecture is not supported\n - INVALID_SCHEME: The scheme is not https\n - GENERIC: Generic catch-all error code", + "title": "The error code associated to each specific failure mode" + }, + "AzureContainerRegistryConfiguration": { + "type": "object", + "properties": { + "registry_name": { "type": "string" }, - "type": { + "username": { "type": "string" }, - "provider": { + "password": { "type": "string" - }, - "status": { - "$ref": "#/definitions/PaymentMethod.Status" - }, - "messages": { - "type": "array", - "items": { - "type": "string" - } - }, - "stripe_payment_method_id": { + } + } + }, + "CreateSecret": { + "type": "object", + "properties": { + "name": { "type": "string" }, - "authorization_verified_at": { - "type": "string", - "format": "date-time" - }, - "authorization_canceled_at": { - "type": "string", - "format": "date-time" + "type": { + "$ref": "#/definitions/SecretType" }, - "authorization_stripe_payment_intent_id": { + "value": { "type": "string" }, - "authorization_stripe_payment_intent_client_secret": { - "type": "string" + "docker_hub_registry": { + "$ref": "#/definitions/DockerHubRegistryConfiguration" }, - "card_brand": { - "type": "string" + "private_registry": { + "$ref": "#/definitions/PrivateRegistryConfiguration" }, - "card_country": { - "type": "string" + "digital_ocean_registry": { + "$ref": "#/definitions/DigitalOceanRegistryConfiguration" }, - "card_funding": { - "type": "string" + "github_registry": { + "$ref": "#/definitions/GitHubRegistryConfiguration" }, - "card_fingerprint": { - "type": "string" + "gitlab_registry": { + "$ref": "#/definitions/GitLabRegistryConfiguration" }, - "card_last_digits": { - "type": "string" + "gcp_container_registry": { + "$ref": "#/definitions/GCPContainerRegistryConfiguration" }, - "card_expiration_month": { - "type": "integer", - "format": "int64" + "azure_container_registry": { + "$ref": "#/definitions/AzureContainerRegistryConfiguration" }, - "card_expiration_year": { - "type": "integer", - "format": "int64" + "project_id": { + "type": "string", + "title": "(Optional) The project ID to associate with the secret" } } }, - "PaymentMethod.Status": { - "type": "string", - "enum": [ - "INVALID", - "CREATED", - "AUTHORIZED", - "DECLINED", - "CANCELED", - "EXPIRED", - "UNCHECKED" - ], - "default": "INVALID" - }, - "RedeemCouponReply": { - "type": "object" - }, - "RedeemCouponRequest": { + "CreateSecretReply": { "type": "object", "properties": { - "code": { - "type": "string" + "secret": { + "$ref": "#/definitions/Secret" } } }, - "CreateCredential": { + "DatabaseRolePassword": { "type": "object", "properties": { - "name": { - "type": "string", - "title": "Credential name" - }, - "description": { - "type": "string", - "title": "Credential description" - }, - "type": { - "$ref": "#/definitions/Credential.Type", - "title": "Credential type" + "username": { + "type": "string" }, - "organization_id": { - "type": "string", - "title": "Organization id for user credential" + "password": { + "type": "string" } } }, - "CreateCredentialReply": { + "DeleteSecretReply": { + "type": "object" + }, + "DigitalOceanRegistryConfiguration": { "type": "object", "properties": { - "credential": { - "$ref": "#/definitions/Credential" + "username": { + "type": "string" + }, + "password": { + "type": "string" } } }, - "Credential": { + "DockerHubRegistryConfiguration": { "type": "object", "properties": { - "id": { - "type": "string" - }, - "type": { - "$ref": "#/definitions/Credential.Type" - }, - "name": { + "username": { "type": "string" }, - "token": { + "password": { "type": "string" - }, - "description": { + } + } + }, + "GCPContainerRegistryConfiguration": { + "type": "object", + "properties": { + "keyfile_content": { "type": "string" }, - "user_id": { + "url": { "type": "string" - }, - "organization_id": { + } + } + }, + "GetSecretReply": { + "type": "object", + "properties": { + "secret": { + "$ref": "#/definitions/Secret" + } + } + }, + "GitHubRegistryConfiguration": { + "type": "object", + "properties": { + "username": { "type": "string" }, - "updated_at": { - "type": "string", - "format": "date-time" - }, - "created_at": { - "type": "string", - "format": "date-time" - }, - "expires_at": { - "type": "string", - "format": "date-time" + "password": { + "type": "string" } } }, - "Credential.Type": { - "type": "string", - "enum": [ - "INVALID", - "USER", - "ORGANIZATION" - ], - "default": "INVALID" - }, - "DeleteCredentialReply": { - "type": "object" - }, - "GetCredentialReply": { + "GitLabRegistryConfiguration": { "type": "object", "properties": { - "credential": { - "$ref": "#/definitions/Credential" + "username": { + "type": "string" + }, + "password": { + "type": "string" } } }, - "ListCredentialsReply": { + "ListSecretsReply": { "type": "object", "properties": { - "credentials": { + "secrets": { "type": "array", "items": { - "$ref": "#/definitions/Credential" + "$ref": "#/definitions/Secret" } }, "limit": { @@ -17816,218 +18641,246 @@ } } }, - "UpdateCredentialReply": { + "PrivateRegistryConfiguration": { "type": "object", "properties": { - "credential": { - "$ref": "#/definitions/Credential" + "username": { + "type": "string" + }, + "password": { + "type": "string" + }, + "url": { + "type": "string" } } }, - "GetSubscriptionReply": { + "RevealSecretReply": { "type": "object", "properties": { - "subscription": { - "$ref": "#/definitions/Subscription" - } + "value": {} } }, - "Subscription": { + "Secret": { "type": "object", "properties": { "id": { "type": "string" }, - "created_at": { - "type": "string", - "format": "date-time" - }, - "updated_at": { - "type": "string", - "format": "date-time" - }, - "version": { - "type": "string", - "format": "uint64" - }, - "organization_id": { - "type": "string" - }, - "stripe_subscription_id": { + "name": { "type": "string" }, - "status": { - "$ref": "#/definitions/Subscription.Status" - }, - "messages": { - "type": "array", - "items": { - "type": "string" - } - }, - "has_pending_update": { - "type": "boolean" - }, - "stripe_pending_invoice_id": { + "organization_id": { "type": "string" }, - "terminate_at": { - "type": "string", - "format": "date-time" - }, - "canceled_at": { - "type": "string", - "format": "date-time" + "type": { + "$ref": "#/definitions/SecretType" }, - "terminated_at": { + "updated_at": { "type": "string", "format": "date-time" }, - "current_period_start": { + "created_at": { "type": "string", "format": "date-time" }, - "current_period_end": { + "project_id": { "type": "string", - "format": "date-time" + "description": "The project ID this secret belongs to. Empty if the secret is organization-level." }, - "currency": { + "value": { "type": "string" }, - "amount_payable": { - "type": "string", - "format": "int64" + "docker_hub_registry": { + "$ref": "#/definitions/DockerHubRegistryConfiguration" }, - "amount_paid": { - "type": "string", - "format": "int64" + "private_registry": { + "$ref": "#/definitions/PrivateRegistryConfiguration" }, - "amount_remaining": { - "type": "string", - "format": "int64" + "digital_ocean_registry": { + "$ref": "#/definitions/DigitalOceanRegistryConfiguration" }, - "payment_failure": { - "$ref": "#/definitions/Subscription.PaymentFailure" + "github_registry": { + "$ref": "#/definitions/GitHubRegistryConfiguration" }, - "trialing": { - "type": "boolean" + "gitlab_registry": { + "$ref": "#/definitions/GitLabRegistryConfiguration" }, - "trial_ends_at": { - "type": "string", - "format": "date-time" + "gcp_container_registry": { + "$ref": "#/definitions/GCPContainerRegistryConfiguration" }, - "trial_max_spend": { - "type": "string", - "format": "int64" + "azure_container_registry": { + "$ref": "#/definitions/AzureContainerRegistryConfiguration" }, - "current_spend": { - "type": "string", - "format": "int64" + "database_role_password": { + "$ref": "#/definitions/DatabaseRolePassword" } } }, - "Subscription.PaymentFailure": { + "SecretType": { + "type": "string", + "enum": [ + "SIMPLE", + "REGISTRY", + "MANAGED" + ], + "default": "SIMPLE" + }, + "UpdateSecretReply": { "type": "object", "properties": { - "failed_at": { - "type": "string", - "format": "date-time" - }, - "next_attempt": { - "type": "string", - "format": "date-time" - }, - "attempt_count": { - "type": "string", - "format": "int64" - }, - "error_code": { - "type": "string" - }, - "error_reason": { + "secret": { + "$ref": "#/definitions/Secret" + } + } + }, + "CreateDomain": { + "type": "object", + "properties": { + "name": { "type": "string" }, - "error_type": { - "type": "string" + "type": { + "$ref": "#/definitions/Domain.Type" }, - "error_message": { - "type": "string" + "app_id": { + "type": "string", + "title": "to auto-attach to an app. Optional" }, - "payment_method_required": { - "type": "boolean" + "cloudflare": { + "$ref": "#/definitions/Domain.LoadBalancerCloudflare" }, - "redirect_url": { - "type": "string" + "koyeb": { + "$ref": "#/definitions/Domain.LoadBalancerKoyeb", + "description": "Only applicable to auto-assigned domains, for organizations on the Scale plan." }, - "stripe_sdk": { - "$ref": "#/definitions/Subscription.PaymentFailure.StripeSDK" + "project_id": { + "type": "string", + "title": "(Optional) The project ID to associate with the domain" } } }, - "Subscription.PaymentFailure.StripeSDK": { + "CreateDomainReply": { "type": "object", "properties": { - "client_secret_key": { - "type": "string" - }, - "raw_json": { - "type": "string" + "domain": { + "$ref": "#/definitions/Domain" } } }, - "Subscription.Status": { - "type": "string", - "enum": [ - "INVALID", - "CREATED", - "ACTIVE", - "WARNING", - "URGENT", - "CANCELING", - "CANCELED", - "TERMINATING", - "TERMINATED" - ], - "default": "INVALID" + "DeleteDomainReply": { + "type": "object" }, - "CreateOrganizationInvitationReply": { + "Domain": { "type": "object", "properties": { - "invitation": { - "$ref": "#/definitions/OrganizationInvitation", - "title": "The organization invitation sent" + "id": { + "type": "string" + }, + "organization_id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "created_at": { + "type": "string", + "format": "date-time" + }, + "updated_at": { + "type": "string", + "format": "date-time" + }, + "status": { + "$ref": "#/definitions/Domain.Status" + }, + "type": { + "$ref": "#/definitions/Domain.Type" + }, + "app_id": { + "type": "string" + }, + "deployment_group": { + "type": "string" + }, + "verified_at": { + "type": "string", + "format": "date-time" + }, + "intended_cname": { + "type": "string" + }, + "messages": { + "type": "array", + "items": { + "type": "string" + } + }, + "version": { + "type": "string", + "format": "uint64" + }, + "cloudflare": { + "$ref": "#/definitions/Domain.LoadBalancerCloudflare" + }, + "koyeb": { + "$ref": "#/definitions/Domain.LoadBalancerKoyeb" + }, + "project_id": { + "type": "string", + "description": "The project ID this domain belongs to. Empty if the domain is organization-level." } } }, - "CreateOrganizationInvitationRequest": { + "Domain.LoadBalancerCloudflare": { + "type": "object" + }, + "Domain.LoadBalancerKoyeb": { "type": "object", "properties": { - "email": { - "type": "string", - "title": "The email of the person to invite" + "request_timeout_seconds": { + "type": "integer", + "format": "int64", + "title": "Between 100 and 900" } } }, - "DeleteOrganizationInvitationReply": { - "type": "object" + "Domain.Status": { + "type": "string", + "enum": [ + "PENDING", + "ACTIVE", + "ERROR", + "DELETING", + "DELETED" + ], + "default": "PENDING" }, - "GetOrganizationInvitationReply": { + "Domain.Type": { + "type": "string", + "enum": [ + "AUTOASSIGNED", + "CUSTOM" + ], + "default": "AUTOASSIGNED", + "title": "- AUTOASSIGNED: Domain like -.koyeb.app" + }, + "GetDomainReply": { "type": "object", "properties": { - "invitation": { - "$ref": "#/definitions/OrganizationInvitation" + "domain": { + "$ref": "#/definitions/Domain" } } }, - "ListOrganizationInvitationsReply": { + "ListDomainsReply": { "type": "object", "properties": { - "invitations": { + "domains": { "type": "array", "items": { - "$ref": "#/definitions/OrganizationInvitation" - }, - "title": "The collection of organization invitations" + "$ref": "#/definitions/Domain" + } }, "limit": { "type": "integer", @@ -18046,491 +18899,400 @@ } } }, - "Organization.Status": { - "type": "string", - "enum": [ - "WARNING", - "LOCKED", - "ACTIVE", - "DEACTIVATING", - "DEACTIVATED", - "DELETING", - "DELETED" - ], - "default": "WARNING" + "RefreshDomainStatusReply": { + "type": "object" }, - "OrganizationInvitation": { + "UpdateDomain": { "type": "object", "properties": { - "id": { - "type": "string" - }, - "email": { - "type": "string" - }, - "role": { - "$ref": "#/definitions/UserRole.Role" - }, - "status": { - "$ref": "#/definitions/OrganizationInvitation.Status" - }, - "expires_at": { + "app_id": { "type": "string", - "format": "date-time" - }, - "organization_id": { - "type": "string" - }, - "organization": { - "$ref": "#/definitions/PublicOrganization" - }, - "invitee_id": { - "type": "string" - }, - "invitee": { - "$ref": "#/definitions/PublicUser" - }, - "inviter_id": { - "type": "string" + "description": "To attach or detach from an app for custom domain." }, - "inviter": { - "$ref": "#/definitions/PublicUser" + "subdomain": { + "type": "string", + "description": "To change subdomain for auto-assigned domain." } } }, - "OrganizationInvitation.Status": { - "type": "string", - "enum": [ - "INVALID", - "PENDING", - "ACCEPTED", - "REFUSED", - "EXPIRED" - ], - "default": "INVALID" - }, - "Plan": { - "type": "string", - "enum": [ - "hobby", - "starter", - "startup", - "business", - "enterprise", - "internal", - "hobby23", - "no_plan", - "pro", - "scale", - "partner_csp", - "partner_csp_unit" - ], - "default": "hobby" - }, - "PublicOrganization": { + "UpdateDomainReply": { "type": "object", "properties": { - "id": { - "type": "string" - }, - "name": { - "type": "string" - }, - "plan": { - "$ref": "#/definitions/Plan" - }, - "status": { - "$ref": "#/definitions/Organization.Status" - }, - "external_id": { - "type": "string" + "domain": { + "$ref": "#/definitions/Domain" } } }, - "PublicUser": { + "App": { "type": "object", "properties": { "id": { "type": "string" }, - "email": { - "type": "string" - }, "name": { "type": "string" }, - "avatar_url": { + "organization_id": { "type": "string" }, - "github_id": { - "type": "string" + "created_at": { + "type": "string", + "format": "date-time" }, - "github_user": { - "type": "string" - } - } - }, - "ResendOrganizationInvitationReply": { - "type": "object", - "properties": { - "invitation": { - "$ref": "#/definitions/OrganizationInvitation", - "title": "The organization invitation resent" + "updated_at": { + "type": "string", + "format": "date-time" + }, + "started_at": { + "type": "string", + "format": "date-time" + }, + "succeeded_at": { + "type": "string", + "format": "date-time" + }, + "paused_at": { + "type": "string", + "format": "date-time" + }, + "resumed_at": { + "type": "string", + "format": "date-time" + }, + "terminated_at": { + "type": "string", + "format": "date-time" + }, + "status": { + "$ref": "#/definitions/App.Status" + }, + "messages": { + "type": "array", + "items": { + "type": "string" + } + }, + "version": { + "type": "string", + "format": "uint64" + }, + "domains": { + "type": "array", + "items": { + "$ref": "#/definitions/Domain" + } + }, + "life_cycle": { + "$ref": "#/definitions/AppLifeCycle" } } }, - "UserRole.Role": { + "App.Status": { "type": "string", "enum": [ - "INVALID", - "OWNER" - ], - "default": "INVALID" - }, - "ConfirmOrganizationActionReply": { - "type": "object" - }, - "DomainLoadBalancerQuotas": { - "type": "object", - "properties": { - "max_koyeb": { - "type": "integer", - "format": "int64" - } - } + "STARTING", + "HEALTHY", + "DEGRADED", + "UNHEALTHY", + "DELETING", + "DELETED", + "PAUSING", + "PAUSED", + "RESUMING" + ], + "default": "STARTING" }, - "GetQuotasReply": { + "AppEvent": { "type": "object", "properties": { - "quotas": { - "$ref": "#/definitions/Quotas" + "id": { + "type": "string" + }, + "when": { + "type": "string", + "format": "date-time" + }, + "organization_id": { + "type": "string" + }, + "app_id": { + "type": "string" + }, + "type": { + "type": "string" + }, + "message": { + "type": "string" + }, + "metadata": { + "type": "object" } } }, - "PersistentVolumeQuotas": { + "AppLifeCycle": { "type": "object", "properties": { - "max_total_size": { - "type": "integer", - "format": "int64", - "description": "MaxTotalSize for all volumes on a region (in Gigabyte / GB)." - }, - "max_volume_size": { - "type": "integer", - "format": "int64", - "description": "MaxVolumeSize for one volume (in Gigabyte / GB)." - }, - "max_per_instance_size": { - "type": "integer", - "format": "int64", - "description": "MaxPerInstanceSize for all volumes on an instance (in Gigabyte / GB)." + "delete_when_empty": { + "type": "boolean" } } }, - "Quotas": { + "AppListItem": { "type": "object", "properties": { - "apps": { - "type": "string", - "format": "int64" - }, - "services": { - "type": "string", - "format": "int64" + "id": { + "type": "string" }, - "domains": { - "type": "string", - "format": "int64", - "title": "Deprecated, use custom_domains instead" + "name": { + "type": "string" }, - "services_by_app": { - "type": "string", - "format": "int64" + "organization_id": { + "type": "string" }, - "service_provisioning_concurrency": { + "updated_at": { "type": "string", - "format": "int64" + "format": "date-time" }, - "memory_mb": { + "created_at": { "type": "string", - "format": "int64" - }, - "instance_types": { - "type": "array", - "items": { - "type": "string" - } + "format": "date-time" }, - "regions": { + "domains": { "type": "array", "items": { - "type": "string" - } - }, - "max_organization_members": { - "type": "string", - "format": "int64" - }, - "max_instances_by_type": { - "type": "object", - "additionalProperties": { - "type": "string", - "format": "int64" - } - }, - "persistent_volumes_by_region": { - "type": "object", - "additionalProperties": { - "$ref": "#/definitions/PersistentVolumeQuotas" + "$ref": "#/definitions/Domain" } }, - "custom_domains": { - "type": "string", - "format": "int64" - }, - "domains_load_balancer": { - "$ref": "#/definitions/DomainLoadBalancerQuotas" - }, - "metrics_retention": { - "type": "integer", - "format": "int32", - "title": "Time in days" - }, - "logs_retention": { - "type": "integer", - "format": "int32", - "title": "Time in days" + "status": { + "$ref": "#/definitions/App.Status" }, - "access_reserved_subdomains": { + "messages": { "type": "array", "items": { "type": "string" - }, - "title": "The mapping between reserved_subdomain names and their value is in the code" - }, - "proxy_ports": { - "type": "integer", - "format": "int64" - }, - "scale_to_zero": { - "$ref": "#/definitions/ScaleToZeroQuotas" + } + } + } + }, + "CreateApp": { + "type": "object", + "properties": { + "name": { + "type": "string" }, - "archives": { - "type": "string", - "format": "int64" + "life_cycle": { + "$ref": "#/definitions/AppLifeCycle" }, - "archive_max_size_mb": { + "project_id": { "type": "string", - "format": "int64" + "title": "(Optional) The project ID to associate with the app" } } }, - "ScaleToZeroQuotas": { + "CreateAppReply": { "type": "object", "properties": { - "is_deep_sleep_enabled": { - "type": "boolean", - "title": "deep sleep limits" - }, - "deep_sleep_idle_delay_min": { - "type": "integer", - "format": "int64" - }, - "deep_sleep_idle_delay_max": { - "type": "integer", - "format": "int64" - }, - "is_light_sleep_enabled": { - "type": "boolean", - "title": "light sleep limits" - }, - "light_sleep_idle_delay_min": { - "type": "integer", - "format": "int64" - }, - "light_sleep_idle_delay_max": { - "type": "integer", - "format": "int64" + "app": { + "$ref": "#/definitions/App", + "title": "The entity created" } } }, - "AppsSummary": { + "DeleteAppReply": { + "type": "object" + }, + "GetAppReply": { "type": "object", "properties": { - "total": { - "type": "string", - "format": "int64", - "title": "Total number of apps" - }, - "by_status": { - "type": "object", - "additionalProperties": { - "type": "string", - "format": "int64" - }, - "title": "Number of apps grouped by status" + "app": { + "$ref": "#/definitions/App", + "title": "The App retrieved" } } }, - "DomainsSummary": { + "ListAppEventsReply": { "type": "object", "properties": { - "total": { - "type": "string", + "events": { + "type": "array", + "items": { + "$ref": "#/definitions/AppEvent" + }, + "title": "The collection of events" + }, + "limit": { + "type": "integer", "format": "int64", - "title": "Total number of domains" + "title": "The limit in the request" }, - "by_status": { - "type": "object", - "additionalProperties": { - "type": "string", - "format": "int64" - }, - "title": "Number of domains grouped by status" + "offset": { + "type": "integer", + "format": "int64", + "title": "The offset in the request" + }, + "order": { + "type": "string", + "title": "The order in the request" + }, + "has_next": { + "type": "boolean", + "title": "If there is more items after in the collection" } } }, - "GetOrganizationSummaryReply": { + "ListAppsReply": { "type": "object", "properties": { - "summary": { - "$ref": "#/definitions/OrganizationSummary", - "title": "Organization usage summary" + "apps": { + "type": "array", + "items": { + "$ref": "#/definitions/AppListItem" + } + }, + "limit": { + "type": "integer", + "format": "int64", + "title": "The limit in the request" + }, + "offset": { + "type": "integer", + "format": "int64", + "title": "The offset in the request" + }, + "count": { + "type": "integer", + "format": "int64", + "title": "The total number of items" + }, + "has_next": { + "type": "boolean", + "title": "If there is more items after in the collection" } } }, - "InstancesSummary": { + "PauseAppReply": { + "type": "object" + }, + "ResumeAppReply": { + "type": "object" + }, + "UpdateApp": { "type": "object", "properties": { - "total": { - "type": "string", - "format": "int64", - "title": "Total number of instances" + "name": { + "type": "string" }, - "by_type": { - "type": "object", - "additionalProperties": { - "type": "string", - "format": "int64" - }, - "title": "Number of instances grouped by type" + "life_cycle": { + "$ref": "#/definitions/AppLifeCycle" } } }, - "MembersSummary": { + "UpdateAppReply": { "type": "object", "properties": { - "total": { - "type": "string", - "format": "int64", - "title": "Number of members" - }, - "invitations_by_status": { - "type": "object", - "additionalProperties": { - "type": "string", - "format": "int64" - }, - "title": "Number of invitations grouped by status" + "app": { + "$ref": "#/definitions/App", + "title": "The entity updated" } } }, - "NeonPostgresSummary": { + "CreatePersistentVolumeReply": { "type": "object", "properties": { - "total": { - "type": "string", - "format": "int64", - "title": "Total number of databases" - }, - "by_instance_type": { - "type": "object", - "additionalProperties": { - "type": "string", - "format": "int64" - }, - "title": "Number of databases grouped by instance type" + "volume": { + "$ref": "#/definitions/PersistentVolume" } } }, - "OrganizationSummary": { + "CreatePersistentVolumeRequest": { "type": "object", "properties": { - "organization_id": { - "type": "string" - }, - "instances": { - "$ref": "#/definitions/InstancesSummary" + "volume_type": { + "$ref": "#/definitions/PersistentVolumeBackingStore", + "title": "the volume backing store type" }, - "apps": { - "$ref": "#/definitions/AppsSummary" + "name": { + "type": "string", + "title": "the volume name" }, - "services": { - "type": "object", - "additionalProperties": { - "$ref": "#/definitions/ServiceSummary" - }, - "title": "Number of services grouped by type" + "region": { + "type": "string", + "title": "the volume region" }, - "domains": { - "$ref": "#/definitions/DomainsSummary" + "read_only": { + "type": "boolean", + "title": "whether the volume must be set as read only" }, - "secrets": { - "$ref": "#/definitions/SecretsSummary" + "max_size": { + "type": "integer", + "format": "int64", + "title": "the size of the volume (in Gigabyte / GB)" }, - "neon_postgres": { - "$ref": "#/definitions/NeonPostgresSummary" + "snapshot_id": { + "type": "string", + "title": "(optional) the id of the snapshot whence the volume comes from" }, - "members": { - "$ref": "#/definitions/MembersSummary" + "project_id": { + "type": "string", + "title": "(Optional) The project ID to associate with the volume" } } }, - "SecretsSummary": { + "DeletePersistentVolumeReply": { "type": "object", "properties": { - "total": { - "type": "string", - "format": "int64", - "title": "Total number of secrets" - }, - "by_type": { - "type": "object", - "additionalProperties": { - "type": "string", - "format": "int64" - }, - "title": "Number of secrets grouped by type" + "volume": { + "$ref": "#/definitions/PersistentVolume" } } }, - "ServiceSummary": { + "GetPersistentVolumeReply": { "type": "object", "properties": { - "total": { - "type": "string", + "volume": { + "$ref": "#/definitions/PersistentVolume" + } + } + }, + "ListPersistentVolumeEventsReply": { + "type": "object", + "properties": { + "events": { + "type": "array", + "items": { + "$ref": "#/definitions/PersistentVolumeEvent" + }, + "title": "The collection of events" + }, + "limit": { + "type": "integer", "format": "int64", - "title": "Total number of services" + "title": "The limit in the request" }, - "by_status": { - "type": "object", - "additionalProperties": { - "type": "string", - "format": "int64" - }, - "title": "Number of services grouped by status" + "offset": { + "type": "integer", + "format": "int64", + "title": "The offset in the request" + }, + "order": { + "type": "string", + "title": "The order in the request" + }, + "has_next": { + "type": "boolean", + "title": "If there is more items after in the collection" } } }, - "ListOrganizationMembersReply": { + "ListPersistentVolumesReply": { "type": "object", "properties": { - "members": { + "volumes": { "type": "array", "items": { - "$ref": "#/definitions/OrganizationMember" + "$ref": "#/definitions/PersistentVolume" }, - "title": "The collection of organization members" + "title": "The collection of persistent volumes" }, "limit": { "type": "integer", @@ -18542,384 +19304,649 @@ "format": "int64", "title": "The offset in the request" }, - "count": { + "has_next": { + "type": "boolean", + "title": "If there is more items after in the collection" + } + } + }, + "PersistentVolume": { + "type": "object", + "properties": { + "id": { + "type": "string", + "title": "the identifier for the volume object" + }, + "name": { + "type": "string", + "title": "the volume name" + }, + "snapshot_id": { + "type": "string", + "title": "(optional) the id of the snapshot whence the volume comes from" + }, + "created_at": { + "type": "string", + "format": "date-time", + "title": "creation timestamp" + }, + "updated_at": { + "type": "string", + "format": "date-time", + "title": "last change timestamp" + }, + "deleted_at": { + "type": "string", + "format": "date-time", + "title": "deletion timestamp" + }, + "organization_id": { + "type": "string", + "title": "the organization to which the volume belongs to" + }, + "service_id": { + "type": "string", + "title": "the service_id to which the volume is eventually bound to" + }, + "region": { + "type": "string", + "title": "the region where the volume exists" + }, + "read_only": { + "type": "boolean", + "title": "whether to mount the volume in read-only mode" + }, + "max_size": { "type": "integer", "format": "int64", - "title": "The total number of items" + "title": "the maximum size of the volume (in Gigabyte / GB)" + }, + "cur_size": { + "type": "integer", + "format": "int64", + "title": "the used amount of space as measured the last time (in Gigabyte / GB)" + }, + "status": { + "$ref": "#/definitions/PersistentVolumeStatus", + "title": "the status of the volume" + }, + "backing_store": { + "$ref": "#/definitions/PersistentVolumeBackingStore", + "title": "the backing store type" } - } + }, + "title": "The object that represent a volume to handle persistency for deployments" }, - "OrganizationMember": { + "PersistentVolumeBackingStore": { + "type": "string", + "enum": [ + "PERSISTENT_VOLUME_BACKING_STORE_INVALID", + "PERSISTENT_VOLUME_BACKING_STORE_LOCAL_BLK" + ], + "default": "PERSISTENT_VOLUME_BACKING_STORE_INVALID", + "title": "- PERSISTENT_VOLUME_BACKING_STORE_INVALID: zero value, invalid\n - PERSISTENT_VOLUME_BACKING_STORE_LOCAL_BLK: the backing store is a locally reachable block device" + }, + "PersistentVolumeEvent": { "type": "object", "properties": { "id": { "type": "string" }, + "when": { + "type": "string", + "format": "date-time" + }, "organization_id": { "type": "string" }, - "user_id": { + "persistent_volume_id": { "type": "string" }, - "external_id": { + "type": { "type": "string" }, - "joined_at": { - "type": "string", - "format": "date-time" - }, - "role": { - "$ref": "#/definitions/UserRole.Role" - }, - "status": { - "$ref": "#/definitions/OrganizationMember.Status" - }, - "user": { - "$ref": "#/definitions/PublicUser" + "message": { + "type": "string" }, - "organization": { - "$ref": "#/definitions/PublicOrganization" + "metadata": { + "type": "object" } } }, - "OrganizationMember.Status": { + "PersistentVolumeStatus": { "type": "string", "enum": [ - "INVALID", - "ACTIVE", - "DELETED" + "PERSISTENT_VOLUME_STATUS_INVALID", + "PERSISTENT_VOLUME_STATUS_ATTACHED", + "PERSISTENT_VOLUME_STATUS_DETACHED", + "PERSISTENT_VOLUME_STATUS_DELETING", + "PERSISTENT_VOLUME_STATUS_DELETED", + "PERSISTENT_VOLUME_STATUS_ARCHIVING" ], - "default": "INVALID" + "default": "PERSISTENT_VOLUME_STATUS_INVALID", + "title": "- PERSISTENT_VOLUME_STATUS_INVALID: zero value, invalid\n - PERSISTENT_VOLUME_STATUS_ATTACHED: the volume is attached to an instance\n - PERSISTENT_VOLUME_STATUS_DETACHED: the volume is free to use\n - PERSISTENT_VOLUME_STATUS_DELETING: the volume will be deleted\n - PERSISTENT_VOLUME_STATUS_DELETED: the volume was deleted\n - PERSISTENT_VOLUME_STATUS_ARCHIVING: the volume is being archived (snapshot being created and migrated to remote storage)" }, - "RemoveOrganizationMemberReply": { + "UpdatePersistentVolumeReply": { "type": "object", "properties": { - "member": { - "$ref": "#/definitions/OrganizationMember" + "volume": { + "$ref": "#/definitions/PersistentVolume" } } }, - "AcceptOrganizationInvitationReply": { + "Archive": { "type": "object", "properties": { - "invitation": { - "$ref": "#/definitions/OrganizationInvitation", - "title": "The organization invitation accepted" + "id": { + "type": "string", + "description": "The archive id, that can be referenced when creating or updating a service." + }, + "organization_id": { + "type": "string", + "description": "Organization owning the archive." + }, + "upload_url": { + "type": "string", + "description": "The URL where to upload the archive. This URL is signed and can only be\nused to upload the archive until `valid_until`." + }, + "size": { + "type": "string", + "format": "uint64", + "description": "The provisioned space for the archive." + }, + "created_at": { + "type": "string", + "format": "date-time", + "description": "Date of creation of the archive." + }, + "deleted_at": { + "type": "string", + "format": "date-time", + "description": "This field is automatically set by Koyeb when the\narchive is garbage collected." } } }, - "Action": { - "type": "string", - "enum": [ - "signin", - "signup", - "register" - ], - "default": "signin" - }, - "Budget": { + "CreateArchive": { "type": "object", "properties": { - "amount": { + "size": { "type": "string", - "format": "int64" + "format": "uint64", + "description": "How much space to provision for the archive, in bytes." }, - "thresholds": { - "type": "array", - "items": { - "type": "string", - "format": "int64" - } + "project_id": { + "type": "string", + "title": "(Optional) The project ID to associate with the archive" } } }, - "CannyAuthReply": { + "CreateArchiveReply": { "type": "object", "properties": { - "token": { - "type": "string" + "archive": { + "$ref": "#/definitions/Archive" } } }, - "CannyAuthRequest": { - "type": "object" - }, - "ClearIdenfyVerificationResultReply": { - "type": "object" + "GetInstanceReply": { + "type": "object", + "properties": { + "instance": { + "$ref": "#/definitions/Instance" + } + } }, - "ClearIdenfyVerificationResultRequest": { + "InstanceEvent": { "type": "object", "properties": { - "user_id": { + "id": { "type": "string" }, + "when": { + "type": "string", + "format": "date-time" + }, "organization_id": { "type": "string" + }, + "instance_id": { + "type": "string" + }, + "type": { + "type": "string" + }, + "message": { + "type": "string" + }, + "metadata": { + "type": "object" } } }, - "CreateAccessTokenReply": { + "InstanceListItem": { "type": "object", "properties": { - "token": { + "id": { + "type": "string" + }, + "created_at": { + "type": "string", + "format": "date-time" + }, + "updated_at": { + "type": "string", + "format": "date-time" + }, + "organization_id": { + "type": "string" + }, + "app_id": { + "type": "string" + }, + "service_id": { + "type": "string" + }, + "regional_deployment_id": { + "type": "string" + }, + "allocation_id": { "type": "string" + }, + "type": { + "type": "string" + }, + "replica_index": { + "type": "integer", + "format": "int64" + }, + "region": { + "type": "string" + }, + "datacenter": { + "type": "string" + }, + "status": { + "$ref": "#/definitions/Instance.Status" + }, + "messages": { + "type": "array", + "items": { + "type": "string" + } + }, + "xyz_deployment_id": { + "type": "string", + "description": "WARNING: Please don't use the following attribute.\nKoyeb doesn't guarantee backwards compatible breaking change and reserve the right to completely drop it without notice.\nUSE AT YOUR OWN RISK." } } }, - "CreateAccountRequest": { + "ListInstanceEventsReply": { "type": "object", - "example": { - "email": "john@snow.com", - "password": "..." - }, "properties": { - "email": { - "type": "string" + "events": { + "type": "array", + "items": { + "$ref": "#/definitions/InstanceEvent" + }, + "title": "The collection of events" }, - "password": { - "type": "string" + "limit": { + "type": "integer", + "format": "int64", + "title": "The limit in the request" }, - "name": { - "type": "string" + "offset": { + "type": "integer", + "format": "int64", + "title": "The offset in the request" }, - "captcha": { - "type": "string" + "order": { + "type": "string", + "title": "The order in the request" + }, + "has_next": { + "type": "boolean", + "title": "If there is more items after in the collection" } - }, - "description": "Create new account", - "title": "Create new account", - "required": [ - "email", - "password" - ] + } }, - "CreateBudgetReply": { + "ListInstancesReply": { "type": "object", "properties": { - "budget": { - "$ref": "#/definitions/Budget" + "instances": { + "type": "array", + "items": { + "$ref": "#/definitions/InstanceListItem" + }, + "title": "The collection of instances" + }, + "limit": { + "type": "integer", + "format": "int64", + "title": "The limit in the request" + }, + "offset": { + "type": "integer", + "format": "int64", + "title": "The offset in the request" + }, + "count": { + "type": "integer", + "format": "int64", + "title": "The total number of items" + }, + "order": { + "type": "string", + "title": "The order in the request" } } }, - "CreateOrganizationReply": { + "ReviewOrganizationCapacityReply": { "type": "object", "properties": { - "organization": { - "$ref": "#/definitions/Organization" + "has_capacity": { + "type": "boolean" } } }, - "CreateOrganizationRequest": { + "ReviewOrganizationCapacityRequest": { "type": "object", "properties": { - "name": { + "plan": { "type": "string" + }, + "trialing": { + "type": "boolean" } } }, - "DeactivateOrganizationReply": { - "type": "object", - "properties": { - "organization": { - "$ref": "#/definitions/Organization" - } - } - }, - "DeclineOrganizationInvitationReply": { + "ComposeReply": { "type": "object", "properties": { - "invitation": { - "$ref": "#/definitions/OrganizationInvitation", - "title": "The organization invitation declined" + "app": { + "$ref": "#/definitions/App" + }, + "services": { + "type": "array", + "items": { + "$ref": "#/definitions/Service" + } } } }, - "DeleteBudgetReply": { - "type": "object" - }, - "DeleteOrganizationReply": { + "CreateCompose": { "type": "object", "properties": { - "organization": { - "$ref": "#/definitions/Organization" + "app": { + "$ref": "#/definitions/CreateApp" + }, + "services": { + "type": "array", + "items": { + "$ref": "#/definitions/CreateService" + } } } }, - "DiscourseAuthReply": { + "AppUsage": { "type": "object", "properties": { - "sso": { + "app_id": { "type": "string" }, - "sig": { + "app_name": { "type": "string" + }, + "services": { + "type": "array", + "items": { + "$ref": "#/definitions/ServiceUsage" + } + }, + "databases": { + "type": "array", + "items": { + "$ref": "#/definitions/DatabaseUsage" + } } } }, - "DiscourseAuthRequest": { + "DatabaseUsage": { "type": "object", "properties": { - "payload": { + "service_id": { "type": "string" }, - "sig": { + "service_name": { "type": "string" + }, + "compute_time_seconds": { + "type": "integer", + "format": "int64" + }, + "data_storage_megabytes_hours": { + "type": "integer", + "format": "int64" } } }, - "GetBudgetReply": { - "type": "object", - "properties": { - "budget": { - "$ref": "#/definitions/Budget" - } - } - }, - "GetGithubInstallationReply": { + "DatabaseUsageDetails": { "type": "object", "properties": { - "installation_id": { + "organization_id": { "type": "string" }, - "installation_url": { + "app_id": { "type": "string" }, - "name": { + "app_name": { "type": "string" }, - "avatar_url": { + "service_id": { "type": "string" }, - "status": { - "$ref": "#/definitions/kgitproxy.GithubInstallation.Status" + "service_name": { + "type": "string" }, - "installed_at": { + "compute_time_seconds": { + "type": "integer", + "format": "int64" + }, + "data_storage_megabytes_hour": { + "type": "integer", + "format": "int64" + }, + "started_at": { "type": "string", "format": "date-time" }, - "suspended_at": { + "terminated_at": { "type": "string", "format": "date-time" + } + } + }, + "GetOrganizationUsageDetailsReply": { + "type": "object", + "properties": { + "usage_details": { + "type": "array", + "items": { + "$ref": "#/definitions/UsageDetails" + }, + "title": "The collection of usage instances" }, - "indexing_status": { - "$ref": "#/definitions/kgitproxy.IndexingStatus" + "database_details": { + "type": "array", + "items": { + "$ref": "#/definitions/DatabaseUsageDetails" + }, + "title": "The collection of database deployments used during the month" }, - "indexed_repositories": { + "limit": { "type": "integer", - "format": "int64" + "format": "int64", + "title": "The limit in the request" }, - "total_repositories": { + "offset": { "type": "integer", - "format": "int64" + "format": "int64", + "title": "The offset in the request" + }, + "count": { + "type": "integer", + "format": "int64", + "title": "The total number of items" + }, + "order": { + "type": "string", + "title": "The order in the request" } } }, - "GetIdenfyTokenReply": { + "GetOrganizationUsageReply": { "type": "object", "properties": { - "auth_token": { - "type": "string" + "usage": { + "$ref": "#/definitions/Usage", + "title": "The computed usage of instances per month" } } }, - "GetOAuthOptionsReply": { + "InstanceUsage": { "type": "object", "properties": { - "oauth_providers": { + "duration_seconds": { + "type": "integer", + "format": "int64" + } + } + }, + "PeriodUsage": { + "type": "object", + "properties": { + "starting_time": { + "type": "string", + "format": "date-time" + }, + "ending_time": { + "type": "string", + "format": "date-time" + }, + "apps": { "type": "array", "items": { - "$ref": "#/definitions/OAuthProvider" + "$ref": "#/definitions/AppUsage" } } - }, - "description": "A list of providers which you can use for single sign-on." + } }, - "GetOrganizationReply": { + "RegionUsage": { "type": "object", "properties": { - "organization": { - "$ref": "#/definitions/Organization" + "instances": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/InstanceUsage" + } } } }, - "GetUserOrganizationInvitationReply": { + "ServiceUsage": { "type": "object", "properties": { - "invitation": { - "$ref": "#/definitions/OrganizationInvitation" + "service_id": { + "type": "string" + }, + "service_name": { + "type": "string" + }, + "regions": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/RegionUsage" + } } } }, - "GetUserSettingsReply": { + "Usage": { "type": "object", "properties": { - "settings": { - "$ref": "#/definitions/UserSettings" + "organization_id": { + "type": "string" + }, + "periods": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/PeriodUsage" + } } } }, - "GithubInstallationReply": { + "UsageDetails": { "type": "object", "properties": { + "organization_id": { + "type": "string" + }, + "instance_id": { + "type": "string" + }, + "app_id": { + "type": "string" + }, "app_name": { - "type": "string", - "title": "The github app name" + "type": "string" + }, + "service_id": { + "type": "string" + }, + "service_name": { + "type": "string" + }, + "regional_deployment_id": { + "type": "string" + }, + "region": { + "type": "string" + }, + "deployment_id": { + "type": "string" + }, + "instance_type": { + "type": "string" }, - "app_id": { - "type": "string", - "format": "int64", - "title": "The github app id" + "duration_seconds": { + "type": "integer", + "format": "int64" }, - "url": { + "started_at": { "type": "string", - "title": "The url to start the installation flow" + "format": "date-time" }, - "state": { - "type": "string", - "title": "The state required by the protocol, it is only valid 10 minutes and encodes\ninformation about the type of flow" - } - } - }, - "GithubInstallationRequest": { - "type": "object", - "properties": { - "metadata": { + "terminated_at": { "type": "string", - "title": "A small (limited to 400 characters) string of arbitrary metadata which will\nbe encoded in the state" - } - } - }, - "HasUnpaidInvoicesReply": { - "type": "object", - "properties": { - "has_unpaid_invoices": { - "type": "boolean" + "format": "date-time" } } }, - "InviteUserRequest": { + "GetRegionReply": { "type": "object", "properties": { - "email": { - "type": "string" - }, - "name": { - "type": "string" - }, - "message": { - "type": "string" + "region": { + "$ref": "#/definitions/Region", + "title": "The Region retrieved" } } }, - "ListUserOrganizationInvitationsReply": { + "ListRegionsReply": { "type": "object", "properties": { - "invitations": { + "regions": { "type": "array", "items": { - "$ref": "#/definitions/OrganizationInvitation" - }, - "title": "The collection of organization invitations" + "$ref": "#/definitions/RegionListItem" + } }, "limit": { "type": "integer", @@ -18938,494 +19965,605 @@ } } }, - "ListUserOrganizationsReply": { + "Region": { "type": "object", "properties": { - "organizations": { + "id": { + "type": "string", + "title": "The id of the region" + }, + "name": { + "type": "string", + "title": "The name of the region" + }, + "coordinates": { "type": "array", "items": { - "$ref": "#/definitions/Organization" + "type": "string" }, - "title": "The collection of organizations" + "title": "The coordinates of the region (lat/long)" }, - "limit": { - "type": "integer", - "format": "int64", - "title": "The limit in the request" + "status": { + "type": "string", + "title": "The status of the region" }, - "offset": { - "type": "integer", - "format": "int64", - "title": "The offset in the request" + "instances": { + "type": "array", + "items": { + "type": "string" + }, + "title": "A list of instances available in this region" }, - "has_next": { + "datacenters": { + "type": "array", + "items": { + "type": "string" + }, + "title": "A list of datacenters available in this region" + }, + "volumes_enabled": { "type": "boolean", - "title": "If there is more items after in the collection" - } - } - }, - "LoginMethodReply": { - "type": "object", - "properties": { - "method": { - "$ref": "#/definitions/LoginMethodReply.Method" - } - } - }, - "LoginMethodReply.Method": { - "type": "string", - "enum": [ - "KOYEB", - "WORKOS" - ], - "default": "KOYEB" - }, - "ManageReply": { - "type": "object", - "properties": { - "url": { - "type": "string" + "title": "Are the volumes enabled for this instance type" + }, + "scope": { + "type": "string", + "description": "The scope of the region, continent, metropolitan area, etc." } } }, - "NextInvoiceReply": { + "RegionListItem": { "type": "object", "properties": { - "stripe_invoice": { - "type": "object" + "id": { + "type": "string", + "title": "The id of the region" }, - "lines": { + "name": { + "type": "string", + "title": "The name of the region" + }, + "coordinates": { "type": "array", "items": { - "$ref": "#/definitions/NextInvoiceReply.Line" - } + "type": "string" + }, + "title": "The coordinates of the region (lat/long)" }, - "discounts": { + "status": { + "type": "string", + "title": "The status of the region" + }, + "instances": { "type": "array", "items": { - "$ref": "#/definitions/NextInvoiceReply.Discount" - } - } - } - }, - "NextInvoiceReply.Discount": { - "type": "object", - "properties": { - "type": { - "$ref": "#/definitions/NextInvoiceReply.Discount.Type" + "type": "string" + }, + "title": "A list of instances available in this region" }, - "name": { - "type": "string" + "datacenters": { + "type": "array", + "items": { + "type": "string" + }, + "title": "A list of datacenters available in this region" }, - "amount": { + "volumes_enabled": { + "type": "boolean", + "title": "Are the volumes enabled for this instance type" + }, + "scope": { "type": "string", - "format": "int64" + "description": "The scope of the region, continent, metropolitan area, etc." } } }, - "NextInvoiceReply.Discount.Type": { + "AvailabilityLevel": { "type": "string", "enum": [ - "PERCENT_OFF", - "AMOUNT_OFF" + "UNKNOWN", + "LOW", + "MEDIUM", + "HIGH" ], - "default": "PERCENT_OFF" + "default": "UNKNOWN" }, - "NextInvoiceReply.Line": { + "CatalogUsage": { "type": "object", "properties": { - "amount_excluding_tax": { - "type": "integer", - "format": "int32" - }, - "period": { - "$ref": "#/definitions/NextInvoiceReply.Line.Period" - }, - "plan_nickname": { - "type": "string" - }, - "price": { - "$ref": "#/definitions/NextInvoiceReply.Line.Price" - }, - "quantity": { - "type": "integer", - "format": "int32" + "instances": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/InstanceAvailability" + } } } }, - "NextInvoiceReply.Line.Period": { + "InstanceAvailability": { "type": "object", "properties": { - "start": { - "type": "string", - "format": "date-time" + "regions": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/RegionAvailability" + } }, - "end": { - "type": "string", - "format": "date-time" + "availability": { + "$ref": "#/definitions/AvailabilityLevel" } } }, - "NextInvoiceReply.Line.Price": { + "ListUsageReply": { "type": "object", "properties": { - "unit_amount_decimal": { - "type": "number", - "format": "double" + "usage": { + "$ref": "#/definitions/CatalogUsage", + "title": "The Usage retrieved" } } }, - "OAuthCallbackReply": { + "RegionAvailability": { "type": "object", "properties": { - "token": { - "$ref": "#/definitions/Token", - "title": "A jwt token to be used for session" + "availability": { + "$ref": "#/definitions/AvailabilityLevel" } } }, - "OAuthCallbackRequest": { + "CatalogGPUDetails": { "type": "object", "properties": { - "state": { - "type": "string", - "title": "The state created at the origin of the OAuth flow" + "count": { + "type": "integer", + "format": "int64", + "title": "The number of GPUs" }, - "code": { + "brand": { "type": "string", - "title": "The code returned by the OAuth provider" + "title": "The brand of GPU" }, - "setup_action": { + "memory": { "type": "string", - "description": "setup_action is populated in the context of a GitHub app installation\nrequest. For logins and signups, it is not set." + "title": "GPU memory" }, - "installation_id": { + "name": { "type": "string", - "description": "installation_id is populated in the context of a GitHub app installation\nrequest. For logins and signups, it is not set." + "title": "Name of GPU" } } }, - "OAuthProvider": { + "CatalogInstance": { "type": "object", "properties": { "id": { "type": "string", - "title": "The name of the provider (.e.g github, google)" + "title": "The name of the instance" }, - "url": { + "description": { "type": "string", - "title": "The URL to call to initiate the OAuth flow" + "title": "A short description of the instance" }, - "state": { + "vcpu": { + "type": "integer", + "format": "int64", + "description": "The number of cpus. Deprecated. Use vcpu_shares instead." + }, + "memory": { "type": "string", - "title": "The OAuth state required by the protocol, it is only valid 10 minutes and\nencodes information about the type of flow" - } - } - }, - "Organization": { - "type": "object", - "properties": { - "id": { - "type": "string" + "title": "The memory in bytes in a format like 5MB" }, - "external_id": { - "type": "string" + "disk": { + "type": "string", + "title": "The size of the disk in bytes in a format like 5MB" }, - "provisioning": { - "type": "boolean" + "price_per_second": { + "type": "string", + "title": "The price to pay per second" }, - "address1": { - "type": "string" + "price_hourly": { + "type": "string", + "title": "The price to pay per hour" }, - "address2": { - "type": "string" + "price_monthly": { + "type": "string", + "title": "The price to pay per month" }, - "city": { - "type": "string" + "regions": { + "type": "array", + "items": { + "type": "string" + }, + "title": "The regions where this instance type is available" }, - "postal_code": { - "type": "string" + "status": { + "type": "string", + "title": "The status of the instance" }, - "state": { - "type": "string" + "require_plan": { + "type": "array", + "items": { + "type": "string" + }, + "title": "The plan required to use instance" }, - "country": { - "type": "string" + "vcpu_shares": { + "type": "number", + "format": "float", + "description": "The number of vcpu shares reserved for the instance." }, - "company": { - "type": "boolean" + "display_name": { + "type": "string", + "title": "The display name of the instance" }, - "vat_number": { - "type": "string" + "aliases": { + "type": "array", + "items": { + "type": "string" + }, + "title": "Aliases" }, - "billing_name": { - "type": "string" + "type": { + "type": "string", + "title": "The type of the instance (e.g. \"gpu\")" }, - "billing_email": { - "type": "string" + "gpu": { + "$ref": "#/definitions/CatalogGPUDetails", + "title": "GPU details" }, - "name": { - "type": "string" + "service_types": { + "type": "array", + "items": { + "type": "string" + }, + "title": "Allowed service types for this instance (e.g. [\"web\", \"worker\"])" }, - "plan": { - "$ref": "#/definitions/Plan" + "volumes_enabled": { + "type": "boolean", + "title": "Are the volumes enabled for this instance type" }, - "plan_updated_at": { + "light_sleep_enabled": { + "type": "boolean", + "title": "Is light sleep enabled for this instance type" + } + } + }, + "CatalogInstanceListItem": { + "type": "object", + "properties": { + "id": { "type": "string", - "format": "date-time" + "title": "The name of the instance" }, - "has_payment_method": { - "type": "boolean" + "description": { + "type": "string", + "title": "A short description of the instance" }, - "subscription_id": { - "type": "string" + "vcpu": { + "type": "integer", + "format": "int64", + "description": "The number of cpus. Deprecated. Use vcpu_shares instead." }, - "current_subscription_id": { - "type": "string" + "memory": { + "type": "string", + "title": "The memory in bytes in a format like 5MB" }, - "latest_subscription_id": { - "type": "string" + "disk": { + "type": "string", + "title": "The size of the disk in bytes in a format like 5MB" }, - "signup_qualification": { - "type": "object" + "price_per_second": { + "type": "string", + "title": "The price to pay per second" }, - "status": { - "$ref": "#/definitions/Organization.Status" + "price_hourly": { + "type": "string", + "title": "The price to pay per hour" }, - "status_message": { - "$ref": "#/definitions/OrganizationDetailedStatus" + "price_monthly": { + "type": "string", + "title": "The price to pay per month" }, - "deactivation_reason": { - "$ref": "#/definitions/Organization.DeactivationReason" + "regions": { + "type": "array", + "items": { + "type": "string" + }, + "title": "The regions where this instance type is available" }, - "verified": { - "type": "boolean" + "status": { + "type": "string", + "title": "The status of the instance" }, - "qualifies_for_hobby23": { - "type": "boolean" + "require_plan": { + "type": "array", + "items": { + "type": "string" + }, + "title": "The plan required to use instance" }, - "reprocess_after": { + "vcpu_shares": { + "type": "number", + "format": "float", + "description": "The number of vcpu shares reserved for the instance." + }, + "display_name": { "type": "string", - "format": "date-time" + "title": "The display name of the instance" }, - "trialing": { - "type": "boolean" + "aliases": { + "type": "array", + "items": { + "type": "string" + }, + "title": "Aliases" }, - "trial_starts_at": { + "type": { "type": "string", - "format": "date-time" + "title": "The type of the instance (e.g. \"gpu\")" }, - "trial_ends_at": { - "type": "string", - "format": "date-time" + "gpu": { + "$ref": "#/definitions/CatalogGPUDetails", + "title": "GPU details" }, - "email_domain_allowlist": { + "service_types": { "type": "array", "items": { "type": "string" - } - } - }, - "title": "Represent an Organization" - }, - "Organization.DeactivationReason": { - "type": "string", - "enum": [ - "INVALID", - "REQUESTED_BY_OWNER", - "SUBSCRIPTION_TERMINATION", - "LOCKED_BY_ADMIN", - "VERIFICATION_FAILED", - "TRIAL_DID_NOT_CONVERT" - ], - "default": "INVALID" - }, - "OrganizationDetailedStatus": { - "type": "string", - "enum": [ - "NEW", - "EMAIL_NOT_VALIDATED", - "BILLING_INFO_MISSING", - "LOCKED", - "PAYMENT_FAILURE", - "VALID", - "PENDING_VERIFICATION", - "VERIFICATION_FAILED", - "REVIEWING_ACCOUNT", - "PLAN_UPGRADE_REQUIRED" - ], - "default": "NEW" - }, - "ReactivateOrganizationReply": { - "type": "object", - "properties": { - "organization": { - "$ref": "#/definitions/Organization" + }, + "title": "Allowed service types for this instance (e.g. [\"web\", \"worker\"])" + }, + "volumes_enabled": { + "type": "boolean", + "title": "Are the volumes enabled for this instance type" + }, + "light_sleep_enabled": { + "type": "boolean", + "title": "Is light sleep enabled for this instance type" } } }, - "ResendEmailValidationReply": { - "type": "object" - }, - "ResendEmailValidationRequest": { - "type": "object" - }, - "ResetPasswordReply": { - "type": "object" - }, - "ResetPasswordRequest": { + "GetCatalogInstanceReply": { "type": "object", - "example": { - "email": "john@snow.com" - }, "properties": { - "email": { - "type": "string" + "instance": { + "$ref": "#/definitions/CatalogInstance", + "title": "The instance retrieved" } } }, - "UnscopeOrganizationTokenRequest": { - "type": "object" - }, - "UpdateBudgetReply": { + "ListCatalogInstancesReply": { "type": "object", "properties": { - "budget": { - "$ref": "#/definitions/Budget" + "instances": { + "type": "array", + "items": { + "$ref": "#/definitions/CatalogInstanceListItem" + } + }, + "limit": { + "type": "integer", + "format": "int64", + "title": "The limit in the request" + }, + "offset": { + "type": "integer", + "format": "int64", + "title": "The offset in the request" + }, + "count": { + "type": "integer", + "format": "int64", + "title": "The total number of items" } } }, - "UpdateOrganizationNameReply": { + "DatacenterListItem": { "type": "object", "properties": { - "organization": { - "$ref": "#/definitions/Organization" + "id": { + "type": "string", + "title": "e.g. \"par1\"" + }, + "region_id": { + "type": "string", + "title": "e.g. \"par\"" + }, + "domain": { + "type": "string", + "title": "e.g. \"all-par1.infra.prod.koyeb.com\"" + }, + "coordinates": { + "type": "array", + "items": { + "type": "string" + }, + "title": "e.g. \"8.856614\" ,\"2.352221\"?" + }, + "use_gpu": { + "type": "boolean", + "title": "e.g. true" + }, + "regions": { + "type": "array", + "items": { + "type": "string" + }, + "title": "e.g. \"par\", \"fra\"" } } }, - "UpdateOrganizationPlanReply": { + "ListDatacentersReply": { "type": "object", "properties": { - "organization": { - "$ref": "#/definitions/Organization" + "datacenters": { + "type": "array", + "items": { + "$ref": "#/definitions/DatacenterListItem" + } } } }, - "UpdateOrganizationReply": { + "ksearch.App": { "type": "object", "properties": { - "organization": { - "$ref": "#/definitions/Organization" + "id": { + "type": "string" + }, + "organization_id": { + "type": "string" + }, + "name": { + "type": "string" } } }, - "UpdatePasswordRequest": { + "ksearch.GlobalDeployment": { "type": "object", - "example": { - "id": "...", - "password": "..." - }, "properties": { "id": { "type": "string" }, - "password": { + "organization_id": { + "type": "string" + }, + "app_id": { + "type": "string" + }, + "service_id": { "type": "string" } } }, - "UpdateUserRequest.UserUpdateBody": { + "ksearch.Instance": { "type": "object", "properties": { "id": { "type": "string" }, - "email": { + "organization_id": { "type": "string" }, - "current_password": { + "app_id": { "type": "string" }, - "password": { + "service_id": { "type": "string" }, - "newsletter_subscribed": { - "type": "boolean" - }, - "name": { + "allocation_id": { "type": "string" } } }, - "UpdateUserSettingsReply": { + "ksearch.Organization": { "type": "object", "properties": { - "settings": { - "$ref": "#/definitions/UserSettings" + "id": { + "type": "string" + }, + "name": { + "type": "string" } } }, - "UpdateUserSettingsRequest": { + "ksearch.RegionalDeployment": { "type": "object", "properties": { - "failed_deployment_email_notification": { - "type": "boolean", - "description": "(Optional) Toggle failed deployment email notification." + "id": { + "type": "string" + }, + "organization_id": { + "type": "string" + }, + "app_id": { + "type": "string" + }, + "service_id": { + "type": "string" + }, + "region": { + "type": "string" } } }, - "UpsertSignupQualificationReply": { + "ksearch.SearchReply": { "type": "object", "properties": { - "organization": { - "$ref": "#/definitions/Organization" + "organizations": { + "type": "array", + "items": { + "$ref": "#/definitions/ksearch.Organization" + } + }, + "users": { + "type": "array", + "items": { + "$ref": "#/definitions/ksearch.User" + } + }, + "apps": { + "type": "array", + "items": { + "$ref": "#/definitions/ksearch.App" + } + }, + "services": { + "type": "array", + "items": { + "$ref": "#/definitions/ksearch.Service" + } + }, + "global_deployments": { + "type": "array", + "items": { + "$ref": "#/definitions/ksearch.GlobalDeployment" + } + }, + "regional_deployments": { + "type": "array", + "items": { + "$ref": "#/definitions/ksearch.RegionalDeployment" + } + }, + "instances": { + "type": "array", + "items": { + "$ref": "#/definitions/ksearch.Instance" + } } } }, - "UserReply": { + "ksearch.Service": { "type": "object", "properties": { - "user": { - "$ref": "#/definitions/User" + "id": { + "type": "string" + }, + "organization_id": { + "type": "string" + }, + "app_id": { + "type": "string" + }, + "name": { + "type": "string" } } }, - "UserSettings": { + "ksearch.User": { "type": "object", "properties": { "id": { "type": "string" }, - "user_id": { + "email": { "type": "string" }, - "failed_deployment_email_notification": { - "type": "boolean" + "name": { + "type": "string" + }, + "github_user": { + "type": "string" } } - }, - "Empty": { - "type": "object" - }, - "kgitproxy.GithubInstallation.Status": { - "type": "string", - "enum": [ - "INVALID", - "INSTALLED", - "SUSPENDED", - "DELETED" - ], - "default": "INVALID" - }, - "kgitproxy.IndexingStatus": { - "type": "string", - "enum": [ - "INVALID_INDEXING_STATUS", - "NOT_STARTED", - "IN_PROGRESS", - "COMPLETED" - ], - "default": "INVALID_INDEXING_STATUS" } }, "securityDefinitions": {