diff --git a/.openapi-generator/FILES b/.openapi-generator/FILES index 64978e9..90f6d98 100644 --- a/.openapi-generator/FILES +++ b/.openapi-generator/FILES @@ -265,4 +265,127 @@ setup.cfg setup.py test-requirements.txt test/__init__.py +test/test_application_env_vars.py +test/test_application_spec.py +test/test_application_status_type.py +test/test_applications_summary_status_type.py +test/test_auth_config.py +test/test_batch.py +test/test_batch_limit.py +test/test_batch_sequence.py +test/test_certificate_signing_request.py +test/test_certificate_signing_request_list.py +test/test_certificate_signing_request_spec.py +test/test_certificate_signing_request_status.py +test/test_certificatesigningrequest_api.py +test/test_condition.py +test/test_condition_status.py +test/test_condition_type.py +test/test_config_provider_spec.py +test/test_cpu_resource_monitor_spec.py +test/test_custom_resource_monitor_spec.py +test/test_default_api.py +test/test_device.py +test/test_device_api.py +test/test_device_application_status.py +test/test_device_applications_summary_status.py +test/test_device_config_status.py +test/test_device_console.py +test/test_device_hooks_spec.py +test/test_device_integrity_status.py +test/test_device_integrity_status_summary.py +test/test_device_integrity_status_summary_type.py +test/test_device_list.py +test/test_device_os_spec.py +test/test_device_os_status.py +test/test_device_reboot_hook_spec.py +test/test_device_resource_status.py +test/test_device_resource_status_type.py +test/test_device_spec.py +test/test_device_spec_systemd.py +test/test_device_status.py +test/test_device_summary_status.py +test/test_device_summary_status_type.py +test/test_device_system_info.py +test/test_device_update_hook_spec.py +test/test_device_updated_status.py +test/test_device_updated_status_type.py +test/test_devices_summary.py +test/test_disk_resource_monitor_spec.py +test/test_disruption_allowance.py +test/test_enrollment_config.py +test/test_enrollment_request.py +test/test_enrollment_request_approval.py +test/test_enrollment_request_list.py +test/test_enrollment_request_spec.py +test/test_enrollment_request_status.py +test/test_enrollment_service.py +test/test_enrollment_service_auth.py +test/test_enrollment_service_service.py +test/test_enrollmentconfig_api.py +test/test_enrollmentrequest_api.py +test/test_error.py +test/test_file_operation.py +test/test_file_spec.py +test/test_fleet.py +test/test_fleet_api.py +test/test_fleet_list.py +test/test_fleet_rollout_status.py +test/test_fleet_spec.py +test/test_fleet_spec_template.py +test/test_fleet_status.py +test/test_generic_repo_spec.py +test/test_git_config_provider_spec.py +test/test_git_config_provider_spec_git_ref.py +test/test_hook_action.py +test/test_hook_action_executable.py +test/test_hook_action_executable_spec.py +test/test_hook_action_one_of.py +test/test_hook_action_one_of1.py +test/test_hook_action_spec.py +test/test_hook_action_systemd_spec.py +test/test_hook_action_systemd_unit.py +test/test_http_config.py +test/test_http_config_provider_spec.py +test/test_http_config_provider_spec_http_ref.py +test/test_http_repo_spec.py +test/test_image_application_provider.py +test/test_inline_config_provider_spec.py +test/test_kubernetes_secret_provider_spec.py +test/test_kubernetes_secret_provider_spec_secret_ref.py +test/test_label_selector.py +test/test_list_meta.py +test/test_match_expression.py +test/test_memory_resource_monitor_spec.py +test/test_object_meta.py +test/test_patch_request_inner.py +test/test_rendered_application_spec.py +test/test_rendered_device_spec.py +test/test_rendered_device_spec_systemd.py +test/test_repo_spec_type.py +test/test_repository.py +test/test_repository_api.py +test/test_repository_list.py +test/test_repository_spec.py +test/test_repository_status.py +test/test_resource_alert_rule.py +test/test_resource_alert_severity_type.py +test/test_resource_monitor.py +test/test_resource_monitor_spec.py +test/test_resource_sync.py +test/test_resource_sync_list.py +test/test_resource_sync_spec.py +test/test_resource_sync_status.py +test/test_resourcesync_api.py +test/test_rollout_device_selection.py +test/test_rollout_policy.py +test/test_sort_order.py +test/test_ssh_config.py +test/test_ssh_repo_spec.py +test/test_status.py +test/test_template_version.py +test/test_template_version_list.py +test/test_template_version_spec.py +test/test_template_version_status.py +test/test_templateversion_api.py tox.ini diff --git a/README.md b/README.md index d927f7c..c2c0937 100644 --- a/README.md +++ b/README.md @@ -67,7 +67,7 @@ configuration = flightctl.Configuration( with flightctl.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = flightctl.CertificatesigningrequestApi(api_client) - certificate_signing_request = flightctl.CertificateSigningRequest() # CertificateSigningRequest | + certificate_signing_request = flightctl.CertificateSigningRequest() # CertificateSigningRequest | try: api_response = api_instance.create_certificate_signing_request(certificate_signing_request) @@ -84,65 +84,65 @@ All URIs are relative to *http://localhost* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- -*CertificatesigningrequestApi* | [**create_certificate_signing_request**](docs/CertificatesigningrequestApi.md#create_certificate_signing_request) | **POST** /api/v1/certificatesigningrequests | -*CertificatesigningrequestApi* | [**delete_certificate_signing_request**](docs/CertificatesigningrequestApi.md#delete_certificate_signing_request) | **DELETE** /api/v1/certificatesigningrequests/{name} | -*CertificatesigningrequestApi* | [**delete_certificate_signing_requests**](docs/CertificatesigningrequestApi.md#delete_certificate_signing_requests) | **DELETE** /api/v1/certificatesigningrequests | -*CertificatesigningrequestApi* | [**list_certificate_signing_requests**](docs/CertificatesigningrequestApi.md#list_certificate_signing_requests) | **GET** /api/v1/certificatesigningrequests | -*CertificatesigningrequestApi* | [**patch_certificate_signing_request**](docs/CertificatesigningrequestApi.md#patch_certificate_signing_request) | **PATCH** /api/v1/certificatesigningrequests/{name} | -*CertificatesigningrequestApi* | [**read_certificate_signing_request**](docs/CertificatesigningrequestApi.md#read_certificate_signing_request) | **GET** /api/v1/certificatesigningrequests/{name} | -*CertificatesigningrequestApi* | [**replace_certificate_signing_request**](docs/CertificatesigningrequestApi.md#replace_certificate_signing_request) | **PUT** /api/v1/certificatesigningrequests/{name} | -*DefaultApi* | [**approve_certificate_signing_request**](docs/DefaultApi.md#approve_certificate_signing_request) | **POST** /api/v1/certificatesigningrequests/{name}/approval | -*DefaultApi* | [**auth_config**](docs/DefaultApi.md#auth_config) | **GET** /api/v1/auth/config | -*DefaultApi* | [**auth_validate**](docs/DefaultApi.md#auth_validate) | **GET** /api/v1/auth/validate | -*DefaultApi* | [**deny_certificate_signing_request**](docs/DefaultApi.md#deny_certificate_signing_request) | **DELETE** /api/v1/certificatesigningrequests/{name}/approval | -*DeviceApi* | [**create_device**](docs/DeviceApi.md#create_device) | **POST** /api/v1/devices | -*DeviceApi* | [**delete_device**](docs/DeviceApi.md#delete_device) | **DELETE** /api/v1/devices/{name} | -*DeviceApi* | [**delete_devices**](docs/DeviceApi.md#delete_devices) | **DELETE** /api/v1/devices | -*DeviceApi* | [**get_rendered_device_spec**](docs/DeviceApi.md#get_rendered_device_spec) | **GET** /api/v1/devices/{name}/rendered | -*DeviceApi* | [**list_devices**](docs/DeviceApi.md#list_devices) | **GET** /api/v1/devices | -*DeviceApi* | [**patch_device**](docs/DeviceApi.md#patch_device) | **PATCH** /api/v1/devices/{name} | -*DeviceApi* | [**read_device**](docs/DeviceApi.md#read_device) | **GET** /api/v1/devices/{name} | -*DeviceApi* | [**read_device_status**](docs/DeviceApi.md#read_device_status) | **GET** /api/v1/devices/{name}/status | -*DeviceApi* | [**replace_device**](docs/DeviceApi.md#replace_device) | **PUT** /api/v1/devices/{name} | -*DeviceApi* | [**replace_device_status**](docs/DeviceApi.md#replace_device_status) | **PUT** /api/v1/devices/{name}/status | -*DeviceApi* | [**request_console**](docs/DeviceApi.md#request_console) | **GET** /api/v1/devices/{name}/console | -*EnrollmentconfigApi* | [**enrollment_config**](docs/EnrollmentconfigApi.md#enrollment_config) | **GET** /api/v1/enrollmentconfig/{name} | -*EnrollmentrequestApi* | [**approve_enrollment_request**](docs/EnrollmentrequestApi.md#approve_enrollment_request) | **POST** /api/v1/enrollmentrequests/{name}/approval | -*EnrollmentrequestApi* | [**create_enrollment_request**](docs/EnrollmentrequestApi.md#create_enrollment_request) | **POST** /api/v1/enrollmentrequests | -*EnrollmentrequestApi* | [**delete_enrollment_request**](docs/EnrollmentrequestApi.md#delete_enrollment_request) | **DELETE** /api/v1/enrollmentrequests/{name} | -*EnrollmentrequestApi* | [**delete_enrollment_requests**](docs/EnrollmentrequestApi.md#delete_enrollment_requests) | **DELETE** /api/v1/enrollmentrequests | -*EnrollmentrequestApi* | [**list_enrollment_requests**](docs/EnrollmentrequestApi.md#list_enrollment_requests) | **GET** /api/v1/enrollmentrequests | -*EnrollmentrequestApi* | [**read_enrollment_request**](docs/EnrollmentrequestApi.md#read_enrollment_request) | **GET** /api/v1/enrollmentrequests/{name} | -*EnrollmentrequestApi* | [**read_enrollment_request_status**](docs/EnrollmentrequestApi.md#read_enrollment_request_status) | **GET** /api/v1/enrollmentrequests/{name}/status | -*EnrollmentrequestApi* | [**replace_enrollment_request**](docs/EnrollmentrequestApi.md#replace_enrollment_request) | **PUT** /api/v1/enrollmentrequests/{name} | -*EnrollmentrequestApi* | [**replace_enrollment_request_status**](docs/EnrollmentrequestApi.md#replace_enrollment_request_status) | **PUT** /api/v1/enrollmentrequests/{name}/status | -*FleetApi* | [**create_fleet**](docs/FleetApi.md#create_fleet) | **POST** /api/v1/fleets | -*FleetApi* | [**delete_fleet**](docs/FleetApi.md#delete_fleet) | **DELETE** /api/v1/fleets/{name} | -*FleetApi* | [**delete_fleets**](docs/FleetApi.md#delete_fleets) | **DELETE** /api/v1/fleets | -*FleetApi* | [**list_fleets**](docs/FleetApi.md#list_fleets) | **GET** /api/v1/fleets | -*FleetApi* | [**patch_fleet**](docs/FleetApi.md#patch_fleet) | **PATCH** /api/v1/fleets/{name} | -*FleetApi* | [**read_fleet**](docs/FleetApi.md#read_fleet) | **GET** /api/v1/fleets/{name} | -*FleetApi* | [**read_fleet_status**](docs/FleetApi.md#read_fleet_status) | **GET** /api/v1/fleets/{name}/status | -*FleetApi* | [**replace_fleet**](docs/FleetApi.md#replace_fleet) | **PUT** /api/v1/fleets/{name} | -*FleetApi* | [**replace_fleet_status**](docs/FleetApi.md#replace_fleet_status) | **PUT** /api/v1/fleets/{name}/status | -*RepositoryApi* | [**create_repository**](docs/RepositoryApi.md#create_repository) | **POST** /api/v1/repositories | -*RepositoryApi* | [**delete_repositories**](docs/RepositoryApi.md#delete_repositories) | **DELETE** /api/v1/repositories | -*RepositoryApi* | [**delete_repository**](docs/RepositoryApi.md#delete_repository) | **DELETE** /api/v1/repositories/{name} | -*RepositoryApi* | [**list_repositories**](docs/RepositoryApi.md#list_repositories) | **GET** /api/v1/repositories | -*RepositoryApi* | [**patch_repository**](docs/RepositoryApi.md#patch_repository) | **PATCH** /api/v1/repositories/{name} | -*RepositoryApi* | [**read_repository**](docs/RepositoryApi.md#read_repository) | **GET** /api/v1/repositories/{name} | -*RepositoryApi* | [**replace_repository**](docs/RepositoryApi.md#replace_repository) | **PUT** /api/v1/repositories/{name} | -*ResourcesyncApi* | [**create_resource_sync**](docs/ResourcesyncApi.md#create_resource_sync) | **POST** /api/v1/resourcesyncs | -*ResourcesyncApi* | [**delete_resource_sync**](docs/ResourcesyncApi.md#delete_resource_sync) | **DELETE** /api/v1/resourcesyncs/{name} | -*ResourcesyncApi* | [**delete_resource_syncs**](docs/ResourcesyncApi.md#delete_resource_syncs) | **DELETE** /api/v1/resourcesyncs | -*ResourcesyncApi* | [**list_resource_sync**](docs/ResourcesyncApi.md#list_resource_sync) | **GET** /api/v1/resourcesyncs | -*ResourcesyncApi* | [**patch_resource_sync**](docs/ResourcesyncApi.md#patch_resource_sync) | **PATCH** /api/v1/resourcesyncs/{name} | -*ResourcesyncApi* | [**read_resource_sync**](docs/ResourcesyncApi.md#read_resource_sync) | **GET** /api/v1/resourcesyncs/{name} | -*ResourcesyncApi* | [**replace_resource_sync**](docs/ResourcesyncApi.md#replace_resource_sync) | **PUT** /api/v1/resourcesyncs/{name} | -*TemplateversionApi* | [**delete_template_version**](docs/TemplateversionApi.md#delete_template_version) | **DELETE** /api/v1/fleets/{fleet}/templateversions/{name} | -*TemplateversionApi* | [**delete_template_versions**](docs/TemplateversionApi.md#delete_template_versions) | **DELETE** /api/v1/fleets/{fleet}/templateversions | -*TemplateversionApi* | [**list_template_versions**](docs/TemplateversionApi.md#list_template_versions) | **GET** /api/v1/fleets/{fleet}/templateversions | -*TemplateversionApi* | [**read_template_version**](docs/TemplateversionApi.md#read_template_version) | **GET** /api/v1/fleets/{fleet}/templateversions/{name} | +*CertificatesigningrequestApi* | [**create_certificate_signing_request**](docs/CertificatesigningrequestApi.md#create_certificate_signing_request) | **POST** /api/v1/certificatesigningrequests | +*CertificatesigningrequestApi* | [**delete_certificate_signing_request**](docs/CertificatesigningrequestApi.md#delete_certificate_signing_request) | **DELETE** /api/v1/certificatesigningrequests/{name} | +*CertificatesigningrequestApi* | [**delete_certificate_signing_requests**](docs/CertificatesigningrequestApi.md#delete_certificate_signing_requests) | **DELETE** /api/v1/certificatesigningrequests | +*CertificatesigningrequestApi* | [**list_certificate_signing_requests**](docs/CertificatesigningrequestApi.md#list_certificate_signing_requests) | **GET** /api/v1/certificatesigningrequests | +*CertificatesigningrequestApi* | [**patch_certificate_signing_request**](docs/CertificatesigningrequestApi.md#patch_certificate_signing_request) | **PATCH** /api/v1/certificatesigningrequests/{name} | +*CertificatesigningrequestApi* | [**read_certificate_signing_request**](docs/CertificatesigningrequestApi.md#read_certificate_signing_request) | **GET** /api/v1/certificatesigningrequests/{name} | +*CertificatesigningrequestApi* | [**replace_certificate_signing_request**](docs/CertificatesigningrequestApi.md#replace_certificate_signing_request) | **PUT** /api/v1/certificatesigningrequests/{name} | +*DefaultApi* | [**approve_certificate_signing_request**](docs/DefaultApi.md#approve_certificate_signing_request) | **POST** /api/v1/certificatesigningrequests/{name}/approval | +*DefaultApi* | [**auth_config**](docs/DefaultApi.md#auth_config) | **GET** /api/v1/auth/config | +*DefaultApi* | [**auth_validate**](docs/DefaultApi.md#auth_validate) | **GET** /api/v1/auth/validate | +*DefaultApi* | [**deny_certificate_signing_request**](docs/DefaultApi.md#deny_certificate_signing_request) | **DELETE** /api/v1/certificatesigningrequests/{name}/approval | +*DeviceApi* | [**create_device**](docs/DeviceApi.md#create_device) | **POST** /api/v1/devices | +*DeviceApi* | [**delete_device**](docs/DeviceApi.md#delete_device) | **DELETE** /api/v1/devices/{name} | +*DeviceApi* | [**delete_devices**](docs/DeviceApi.md#delete_devices) | **DELETE** /api/v1/devices | +*DeviceApi* | [**get_rendered_device_spec**](docs/DeviceApi.md#get_rendered_device_spec) | **GET** /api/v1/devices/{name}/rendered | +*DeviceApi* | [**list_devices**](docs/DeviceApi.md#list_devices) | **GET** /api/v1/devices | +*DeviceApi* | [**patch_device**](docs/DeviceApi.md#patch_device) | **PATCH** /api/v1/devices/{name} | +*DeviceApi* | [**read_device**](docs/DeviceApi.md#read_device) | **GET** /api/v1/devices/{name} | +*DeviceApi* | [**read_device_status**](docs/DeviceApi.md#read_device_status) | **GET** /api/v1/devices/{name}/status | +*DeviceApi* | [**replace_device**](docs/DeviceApi.md#replace_device) | **PUT** /api/v1/devices/{name} | +*DeviceApi* | [**replace_device_status**](docs/DeviceApi.md#replace_device_status) | **PUT** /api/v1/devices/{name}/status | +*DeviceApi* | [**request_console**](docs/DeviceApi.md#request_console) | **GET** /api/v1/devices/{name}/console | +*EnrollmentconfigApi* | [**enrollment_config**](docs/EnrollmentconfigApi.md#enrollment_config) | **GET** /api/v1/enrollmentconfig/{name} | +*EnrollmentrequestApi* | [**approve_enrollment_request**](docs/EnrollmentrequestApi.md#approve_enrollment_request) | **POST** /api/v1/enrollmentrequests/{name}/approval | +*EnrollmentrequestApi* | [**create_enrollment_request**](docs/EnrollmentrequestApi.md#create_enrollment_request) | **POST** /api/v1/enrollmentrequests | +*EnrollmentrequestApi* | [**delete_enrollment_request**](docs/EnrollmentrequestApi.md#delete_enrollment_request) | **DELETE** /api/v1/enrollmentrequests/{name} | +*EnrollmentrequestApi* | [**delete_enrollment_requests**](docs/EnrollmentrequestApi.md#delete_enrollment_requests) | **DELETE** /api/v1/enrollmentrequests | +*EnrollmentrequestApi* | [**list_enrollment_requests**](docs/EnrollmentrequestApi.md#list_enrollment_requests) | **GET** /api/v1/enrollmentrequests | +*EnrollmentrequestApi* | [**read_enrollment_request**](docs/EnrollmentrequestApi.md#read_enrollment_request) | **GET** /api/v1/enrollmentrequests/{name} | +*EnrollmentrequestApi* | [**read_enrollment_request_status**](docs/EnrollmentrequestApi.md#read_enrollment_request_status) | **GET** /api/v1/enrollmentrequests/{name}/status | +*EnrollmentrequestApi* | [**replace_enrollment_request**](docs/EnrollmentrequestApi.md#replace_enrollment_request) | **PUT** /api/v1/enrollmentrequests/{name} | +*EnrollmentrequestApi* | [**replace_enrollment_request_status**](docs/EnrollmentrequestApi.md#replace_enrollment_request_status) | **PUT** /api/v1/enrollmentrequests/{name}/status | +*FleetApi* | [**create_fleet**](docs/FleetApi.md#create_fleet) | **POST** /api/v1/fleets | +*FleetApi* | [**delete_fleet**](docs/FleetApi.md#delete_fleet) | **DELETE** /api/v1/fleets/{name} | +*FleetApi* | [**delete_fleets**](docs/FleetApi.md#delete_fleets) | **DELETE** /api/v1/fleets | +*FleetApi* | [**list_fleets**](docs/FleetApi.md#list_fleets) | **GET** /api/v1/fleets | +*FleetApi* | [**patch_fleet**](docs/FleetApi.md#patch_fleet) | **PATCH** /api/v1/fleets/{name} | +*FleetApi* | [**read_fleet**](docs/FleetApi.md#read_fleet) | **GET** /api/v1/fleets/{name} | +*FleetApi* | [**read_fleet_status**](docs/FleetApi.md#read_fleet_status) | **GET** /api/v1/fleets/{name}/status | +*FleetApi* | [**replace_fleet**](docs/FleetApi.md#replace_fleet) | **PUT** /api/v1/fleets/{name} | +*FleetApi* | [**replace_fleet_status**](docs/FleetApi.md#replace_fleet_status) | **PUT** /api/v1/fleets/{name}/status | +*RepositoryApi* | [**create_repository**](docs/RepositoryApi.md#create_repository) | **POST** /api/v1/repositories | +*RepositoryApi* | [**delete_repositories**](docs/RepositoryApi.md#delete_repositories) | **DELETE** /api/v1/repositories | +*RepositoryApi* | [**delete_repository**](docs/RepositoryApi.md#delete_repository) | **DELETE** /api/v1/repositories/{name} | +*RepositoryApi* | [**list_repositories**](docs/RepositoryApi.md#list_repositories) | **GET** /api/v1/repositories | +*RepositoryApi* | [**patch_repository**](docs/RepositoryApi.md#patch_repository) | **PATCH** /api/v1/repositories/{name} | +*RepositoryApi* | [**read_repository**](docs/RepositoryApi.md#read_repository) | **GET** /api/v1/repositories/{name} | +*RepositoryApi* | [**replace_repository**](docs/RepositoryApi.md#replace_repository) | **PUT** /api/v1/repositories/{name} | +*ResourcesyncApi* | [**create_resource_sync**](docs/ResourcesyncApi.md#create_resource_sync) | **POST** /api/v1/resourcesyncs | +*ResourcesyncApi* | [**delete_resource_sync**](docs/ResourcesyncApi.md#delete_resource_sync) | **DELETE** /api/v1/resourcesyncs/{name} | +*ResourcesyncApi* | [**delete_resource_syncs**](docs/ResourcesyncApi.md#delete_resource_syncs) | **DELETE** /api/v1/resourcesyncs | +*ResourcesyncApi* | [**list_resource_sync**](docs/ResourcesyncApi.md#list_resource_sync) | **GET** /api/v1/resourcesyncs | +*ResourcesyncApi* | [**patch_resource_sync**](docs/ResourcesyncApi.md#patch_resource_sync) | **PATCH** /api/v1/resourcesyncs/{name} | +*ResourcesyncApi* | [**read_resource_sync**](docs/ResourcesyncApi.md#read_resource_sync) | **GET** /api/v1/resourcesyncs/{name} | +*ResourcesyncApi* | [**replace_resource_sync**](docs/ResourcesyncApi.md#replace_resource_sync) | **PUT** /api/v1/resourcesyncs/{name} | +*TemplateversionApi* | [**delete_template_version**](docs/TemplateversionApi.md#delete_template_version) | **DELETE** /api/v1/fleets/{fleet}/templateversions/{name} | +*TemplateversionApi* | [**delete_template_versions**](docs/TemplateversionApi.md#delete_template_versions) | **DELETE** /api/v1/fleets/{fleet}/templateversions | +*TemplateversionApi* | [**list_template_versions**](docs/TemplateversionApi.md#list_template_versions) | **GET** /api/v1/fleets/{fleet}/templateversions | +*TemplateversionApi* | [**read_template_version**](docs/TemplateversionApi.md#read_template_version) | **GET** /api/v1/fleets/{fleet}/templateversions/{name} | ## Documentation For Models diff --git a/openapi_client/__init__.py b/openapi_client/__init__.py deleted file mode 100644 index d69b1df..0000000 --- a/openapi_client/__init__.py +++ /dev/null @@ -1,155 +0,0 @@ -# coding: utf-8 - -# flake8: noqa - -""" - Open Device Management API - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: undefined - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -__version__ = "1.0.0" - -# import apis into sdk package -from openapi_client.api.certificatesigningrequest_api import CertificatesigningrequestApi -from openapi_client.api.default_api import DefaultApi -from openapi_client.api.device_api import DeviceApi -from openapi_client.api.enrollmentconfig_api import EnrollmentconfigApi -from openapi_client.api.enrollmentrequest_api import EnrollmentrequestApi -from openapi_client.api.fleet_api import FleetApi -from openapi_client.api.repository_api import RepositoryApi -from openapi_client.api.resourcesync_api import ResourcesyncApi -from openapi_client.api.templateversion_api import TemplateversionApi - -# import ApiClient -from openapi_client.api_response import ApiResponse -from openapi_client.api_client import ApiClient -from openapi_client.configuration import Configuration -from openapi_client.exceptions import OpenApiException -from openapi_client.exceptions import ApiTypeError -from openapi_client.exceptions import ApiValueError -from openapi_client.exceptions import ApiKeyError -from openapi_client.exceptions import ApiAttributeError -from openapi_client.exceptions import ApiException - -# import models into sdk package -from openapi_client.models.application_env_vars import ApplicationEnvVars -from openapi_client.models.application_spec import ApplicationSpec -from openapi_client.models.application_status_type import ApplicationStatusType -from openapi_client.models.applications_summary_status_type import ApplicationsSummaryStatusType -from openapi_client.models.auth_config import AuthConfig -from openapi_client.models.batch import Batch -from openapi_client.models.batch_limit import BatchLimit -from openapi_client.models.batch_sequence import BatchSequence -from openapi_client.models.cpu_resource_monitor_spec import CPUResourceMonitorSpec -from openapi_client.models.certificate_signing_request import CertificateSigningRequest -from openapi_client.models.certificate_signing_request_list import CertificateSigningRequestList -from openapi_client.models.certificate_signing_request_spec import CertificateSigningRequestSpec -from openapi_client.models.certificate_signing_request_status import CertificateSigningRequestStatus -from openapi_client.models.condition import Condition -from openapi_client.models.condition_status import ConditionStatus -from openapi_client.models.condition_type import ConditionType -from openapi_client.models.config_provider_spec import ConfigProviderSpec -from openapi_client.models.custom_resource_monitor_spec import CustomResourceMonitorSpec -from openapi_client.models.device import Device -from openapi_client.models.device_application_status import DeviceApplicationStatus -from openapi_client.models.device_applications_summary_status import DeviceApplicationsSummaryStatus -from openapi_client.models.device_config_status import DeviceConfigStatus -from openapi_client.models.device_console import DeviceConsole -from openapi_client.models.device_hooks_spec import DeviceHooksSpec -from openapi_client.models.device_integrity_status import DeviceIntegrityStatus -from openapi_client.models.device_integrity_status_summary import DeviceIntegrityStatusSummary -from openapi_client.models.device_integrity_status_summary_type import DeviceIntegrityStatusSummaryType -from openapi_client.models.device_list import DeviceList -from openapi_client.models.device_os_spec import DeviceOSSpec -from openapi_client.models.device_os_status import DeviceOSStatus -from openapi_client.models.device_reboot_hook_spec import DeviceRebootHookSpec -from openapi_client.models.device_resource_status import DeviceResourceStatus -from openapi_client.models.device_resource_status_type import DeviceResourceStatusType -from openapi_client.models.device_spec import DeviceSpec -from openapi_client.models.device_spec_systemd import DeviceSpecSystemd -from openapi_client.models.device_status import DeviceStatus -from openapi_client.models.device_summary_status import DeviceSummaryStatus -from openapi_client.models.device_summary_status_type import DeviceSummaryStatusType -from openapi_client.models.device_system_info import DeviceSystemInfo -from openapi_client.models.device_update_hook_spec import DeviceUpdateHookSpec -from openapi_client.models.device_updated_status import DeviceUpdatedStatus -from openapi_client.models.device_updated_status_type import DeviceUpdatedStatusType -from openapi_client.models.devices_summary import DevicesSummary -from openapi_client.models.disk_resource_monitor_spec import DiskResourceMonitorSpec -from openapi_client.models.disruption_allowance import DisruptionAllowance -from openapi_client.models.enrollment_config import EnrollmentConfig -from openapi_client.models.enrollment_request import EnrollmentRequest -from openapi_client.models.enrollment_request_approval import EnrollmentRequestApproval -from openapi_client.models.enrollment_request_list import EnrollmentRequestList -from openapi_client.models.enrollment_request_spec import EnrollmentRequestSpec -from openapi_client.models.enrollment_request_status import EnrollmentRequestStatus -from openapi_client.models.enrollment_service import EnrollmentService -from openapi_client.models.enrollment_service_auth import EnrollmentServiceAuth -from openapi_client.models.enrollment_service_service import EnrollmentServiceService -from openapi_client.models.error import Error -from openapi_client.models.file_operation import FileOperation -from openapi_client.models.file_spec import FileSpec -from openapi_client.models.fleet import Fleet -from openapi_client.models.fleet_list import FleetList -from openapi_client.models.fleet_rollout_status import FleetRolloutStatus -from openapi_client.models.fleet_spec import FleetSpec -from openapi_client.models.fleet_spec_template import FleetSpecTemplate -from openapi_client.models.fleet_status import FleetStatus -from openapi_client.models.generic_repo_spec import GenericRepoSpec -from openapi_client.models.git_config_provider_spec import GitConfigProviderSpec -from openapi_client.models.git_config_provider_spec_git_ref import GitConfigProviderSpecGitRef -from openapi_client.models.hook_action import HookAction -from openapi_client.models.hook_action_executable import HookActionExecutable -from openapi_client.models.hook_action_executable_spec import HookActionExecutableSpec -from openapi_client.models.hook_action_one_of import HookActionOneOf -from openapi_client.models.hook_action_one_of1 import HookActionOneOf1 -from openapi_client.models.hook_action_spec import HookActionSpec -from openapi_client.models.hook_action_systemd_spec import HookActionSystemdSpec -from openapi_client.models.hook_action_systemd_unit import HookActionSystemdUnit -from openapi_client.models.http_config import HttpConfig -from openapi_client.models.http_config_provider_spec import HttpConfigProviderSpec -from openapi_client.models.http_config_provider_spec_http_ref import HttpConfigProviderSpecHttpRef -from openapi_client.models.http_repo_spec import HttpRepoSpec -from openapi_client.models.image_application_provider import ImageApplicationProvider -from openapi_client.models.inline_config_provider_spec import InlineConfigProviderSpec -from openapi_client.models.kubernetes_secret_provider_spec import KubernetesSecretProviderSpec -from openapi_client.models.kubernetes_secret_provider_spec_secret_ref import KubernetesSecretProviderSpecSecretRef -from openapi_client.models.label_selector import LabelSelector -from openapi_client.models.list_meta import ListMeta -from openapi_client.models.match_expression import MatchExpression -from openapi_client.models.memory_resource_monitor_spec import MemoryResourceMonitorSpec -from openapi_client.models.object_meta import ObjectMeta -from openapi_client.models.patch_request_inner import PatchRequestInner -from openapi_client.models.rendered_application_spec import RenderedApplicationSpec -from openapi_client.models.rendered_device_spec import RenderedDeviceSpec -from openapi_client.models.rendered_device_spec_systemd import RenderedDeviceSpecSystemd -from openapi_client.models.repo_spec_type import RepoSpecType -from openapi_client.models.repository import Repository -from openapi_client.models.repository_list import RepositoryList -from openapi_client.models.repository_spec import RepositorySpec -from openapi_client.models.repository_status import RepositoryStatus -from openapi_client.models.resource_alert_rule import ResourceAlertRule -from openapi_client.models.resource_alert_severity_type import ResourceAlertSeverityType -from openapi_client.models.resource_monitor import ResourceMonitor -from openapi_client.models.resource_monitor_spec import ResourceMonitorSpec -from openapi_client.models.resource_sync import ResourceSync -from openapi_client.models.resource_sync_list import ResourceSyncList -from openapi_client.models.resource_sync_spec import ResourceSyncSpec -from openapi_client.models.resource_sync_status import ResourceSyncStatus -from openapi_client.models.rollout_device_selection import RolloutDeviceSelection -from openapi_client.models.rollout_policy import RolloutPolicy -from openapi_client.models.sort_order import SortOrder -from openapi_client.models.ssh_config import SshConfig -from openapi_client.models.ssh_repo_spec import SshRepoSpec -from openapi_client.models.status import Status -from openapi_client.models.template_version import TemplateVersion -from openapi_client.models.template_version_list import TemplateVersionList -from openapi_client.models.template_version_spec import TemplateVersionSpec -from openapi_client.models.template_version_status import TemplateVersionStatus diff --git a/openapi_client/api/__init__.py b/openapi_client/api/__init__.py deleted file mode 100644 index 75c1fee..0000000 --- a/openapi_client/api/__init__.py +++ /dev/null @@ -1,13 +0,0 @@ -# flake8: noqa - -# import apis into api package -from openapi_client.api.certificatesigningrequest_api import CertificatesigningrequestApi -from openapi_client.api.default_api import DefaultApi -from openapi_client.api.device_api import DeviceApi -from openapi_client.api.enrollmentconfig_api import EnrollmentconfigApi -from openapi_client.api.enrollmentrequest_api import EnrollmentrequestApi -from openapi_client.api.fleet_api import FleetApi -from openapi_client.api.repository_api import RepositoryApi -from openapi_client.api.resourcesync_api import ResourcesyncApi -from openapi_client.api.templateversion_api import TemplateversionApi - diff --git a/openapi_client/api/certificatesigningrequest_api.py b/openapi_client/api/certificatesigningrequest_api.py deleted file mode 100644 index a7a03ea..0000000 --- a/openapi_client/api/certificatesigningrequest_api.py +++ /dev/null @@ -1,2071 +0,0 @@ -# coding: utf-8 - -""" - Open Device Management API - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: undefined - 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, StrictInt, StrictStr -from typing import List, Optional -from typing_extensions import Annotated -from openapi_client.models.certificate_signing_request import CertificateSigningRequest -from openapi_client.models.certificate_signing_request_list import CertificateSigningRequestList -from openapi_client.models.patch_request_inner import PatchRequestInner -from openapi_client.models.sort_order import SortOrder -from openapi_client.models.status import Status - -from openapi_client.api_client import ApiClient, RequestSerialized -from openapi_client.api_response import ApiResponse -from openapi_client.rest import RESTResponseType - - -class CertificatesigningrequestApi: - """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_certificate_signing_request( - self, - certificate_signing_request: CertificateSigningRequest, - _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, - ) -> CertificateSigningRequest: - """create_certificate_signing_request - - request Certificate Signing - - :param certificate_signing_request: (required) - :type certificate_signing_request: CertificateSigningRequest - :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_certificate_signing_request_serialize( - certificate_signing_request=certificate_signing_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "CertificateSigningRequest", - '201': "CertificateSigningRequest", - '202': "CertificateSigningRequest", - '208': "EnrollmentRequest", - '400': "Error", - '401': "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_certificate_signing_request_with_http_info( - self, - certificate_signing_request: CertificateSigningRequest, - _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[CertificateSigningRequest]: - """create_certificate_signing_request - - request Certificate Signing - - :param certificate_signing_request: (required) - :type certificate_signing_request: CertificateSigningRequest - :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_certificate_signing_request_serialize( - certificate_signing_request=certificate_signing_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "CertificateSigningRequest", - '201': "CertificateSigningRequest", - '202': "CertificateSigningRequest", - '208': "EnrollmentRequest", - '400': "Error", - '401': "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_certificate_signing_request_without_preload_content( - self, - certificate_signing_request: CertificateSigningRequest, - _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_certificate_signing_request - - request Certificate Signing - - :param certificate_signing_request: (required) - :type certificate_signing_request: CertificateSigningRequest - :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_certificate_signing_request_serialize( - certificate_signing_request=certificate_signing_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "CertificateSigningRequest", - '201': "CertificateSigningRequest", - '202': "CertificateSigningRequest", - '208': "EnrollmentRequest", - '400': "Error", - '401': "Error", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _create_certificate_signing_request_serialize( - self, - certificate_signing_request, - _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 certificate_signing_request is not None: - _body_params = certificate_signing_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) - - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/api/v1/certificatesigningrequests', - 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_certificate_signing_request( - self, - name: Annotated[StrictStr, Field(description="name of the Certificate Signing Request")], - _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, - ) -> CertificateSigningRequest: - """delete_certificate_signing_request - - delete a Certificate Signing Request - - :param name: name of the Certificate Signing Request (required) - :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._delete_certificate_signing_request_serialize( - name=name, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "CertificateSigningRequest", - '401': "Error", - '404': "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_certificate_signing_request_with_http_info( - self, - name: Annotated[StrictStr, Field(description="name of the Certificate Signing Request")], - _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[CertificateSigningRequest]: - """delete_certificate_signing_request - - delete a Certificate Signing Request - - :param name: name of the Certificate Signing Request (required) - :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._delete_certificate_signing_request_serialize( - name=name, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "CertificateSigningRequest", - '401': "Error", - '404': "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_certificate_signing_request_without_preload_content( - self, - name: Annotated[StrictStr, Field(description="name of the Certificate Signing Request")], - _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_certificate_signing_request - - delete a Certificate Signing Request - - :param name: name of the Certificate Signing Request (required) - :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._delete_certificate_signing_request_serialize( - name=name, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "CertificateSigningRequest", - '401': "Error", - '404': "Error", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _delete_certificate_signing_request_serialize( - self, - 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 - if name is not None: - _path_params['name'] = name - # 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( - [ - 'application/json' - ] - ) - - - # authentication setting - _auth_settings: List[str] = [ - ] - - return self.api_client.param_serialize( - method='DELETE', - resource_path='/api/v1/certificatesigningrequests/{name}', - 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_certificate_signing_requests( - self, - _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, - ) -> Status: - """delete_certificate_signing_requests - - delete a collection of CertificateSigningRequest - - :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_certificate_signing_requests_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "Status", - '401': "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_certificate_signing_requests_with_http_info( - self, - _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[Status]: - """delete_certificate_signing_requests - - delete a collection of CertificateSigningRequest - - :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_certificate_signing_requests_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "Status", - '401': "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_certificate_signing_requests_without_preload_content( - self, - _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_certificate_signing_requests - - delete a collection of CertificateSigningRequest - - :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_certificate_signing_requests_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "Status", - '401': "Error", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _delete_certificate_signing_requests_serialize( - self, - _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 - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) - - - # authentication setting - _auth_settings: List[str] = [ - ] - - return self.api_client.param_serialize( - method='DELETE', - resource_path='/api/v1/certificatesigningrequests', - 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_certificate_signing_requests( - self, - var_continue: Annotated[Optional[StrictStr], Field(description="An optional parameter to query more results from the server. The value of the paramter must match the value of the 'continue' field in the previous list response.")] = None, - label_selector: Annotated[Optional[StrictStr], Field(description="A selector to restrict the list of returned objects by their labels. Defaults to everything.")] = None, - field_selector: Annotated[Optional[StrictStr], Field(description="A selector to restrict the list of returned objects by their fields, supports '=', '==', and '!='.(e.g. key1=value1,key2!=value2).")] = None, - limit: Annotated[Optional[StrictInt], Field(description="The maximum number of results returned in the list response. The server will set the 'continue' field in the list response if more results exist. The continue value may then be specified as parameter in a subsequent query.")] = None, - sort_by: Annotated[Optional[StrictStr], Field(description="Specifies the field to sort by.")] = None, - sort_order: Annotated[Optional[SortOrder], Field(description="Specifies the sort 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, - ) -> CertificateSigningRequestList: - """list_certificate_signing_requests - - list CertificateSigningRequests - - :param var_continue: An optional parameter to query more results from the server. The value of the paramter must match the value of the 'continue' field in the previous list response. - :type var_continue: str - :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. - :type label_selector: str - :param field_selector: A selector to restrict the list of returned objects by their fields, supports '=', '==', and '!='.(e.g. key1=value1,key2!=value2). - :type field_selector: str - :param limit: The maximum number of results returned in the list response. The server will set the 'continue' field in the list response if more results exist. The continue value may then be specified as parameter in a subsequent query. - :type limit: int - :param sort_by: Specifies the field to sort by. - :type sort_by: str - :param sort_order: Specifies the sort order. - :type sort_order: SortOrder - :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_certificate_signing_requests_serialize( - var_continue=var_continue, - label_selector=label_selector, - field_selector=field_selector, - limit=limit, - sort_by=sort_by, - sort_order=sort_order, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "CertificateSigningRequestList", - '400': "Error", - '401': "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_certificate_signing_requests_with_http_info( - self, - var_continue: Annotated[Optional[StrictStr], Field(description="An optional parameter to query more results from the server. The value of the paramter must match the value of the 'continue' field in the previous list response.")] = None, - label_selector: Annotated[Optional[StrictStr], Field(description="A selector to restrict the list of returned objects by their labels. Defaults to everything.")] = None, - field_selector: Annotated[Optional[StrictStr], Field(description="A selector to restrict the list of returned objects by their fields, supports '=', '==', and '!='.(e.g. key1=value1,key2!=value2).")] = None, - limit: Annotated[Optional[StrictInt], Field(description="The maximum number of results returned in the list response. The server will set the 'continue' field in the list response if more results exist. The continue value may then be specified as parameter in a subsequent query.")] = None, - sort_by: Annotated[Optional[StrictStr], Field(description="Specifies the field to sort by.")] = None, - sort_order: Annotated[Optional[SortOrder], Field(description="Specifies the sort 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[CertificateSigningRequestList]: - """list_certificate_signing_requests - - list CertificateSigningRequests - - :param var_continue: An optional parameter to query more results from the server. The value of the paramter must match the value of the 'continue' field in the previous list response. - :type var_continue: str - :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. - :type label_selector: str - :param field_selector: A selector to restrict the list of returned objects by their fields, supports '=', '==', and '!='.(e.g. key1=value1,key2!=value2). - :type field_selector: str - :param limit: The maximum number of results returned in the list response. The server will set the 'continue' field in the list response if more results exist. The continue value may then be specified as parameter in a subsequent query. - :type limit: int - :param sort_by: Specifies the field to sort by. - :type sort_by: str - :param sort_order: Specifies the sort order. - :type sort_order: SortOrder - :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_certificate_signing_requests_serialize( - var_continue=var_continue, - label_selector=label_selector, - field_selector=field_selector, - limit=limit, - sort_by=sort_by, - sort_order=sort_order, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "CertificateSigningRequestList", - '400': "Error", - '401': "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_certificate_signing_requests_without_preload_content( - self, - var_continue: Annotated[Optional[StrictStr], Field(description="An optional parameter to query more results from the server. The value of the paramter must match the value of the 'continue' field in the previous list response.")] = None, - label_selector: Annotated[Optional[StrictStr], Field(description="A selector to restrict the list of returned objects by their labels. Defaults to everything.")] = None, - field_selector: Annotated[Optional[StrictStr], Field(description="A selector to restrict the list of returned objects by their fields, supports '=', '==', and '!='.(e.g. key1=value1,key2!=value2).")] = None, - limit: Annotated[Optional[StrictInt], Field(description="The maximum number of results returned in the list response. The server will set the 'continue' field in the list response if more results exist. The continue value may then be specified as parameter in a subsequent query.")] = None, - sort_by: Annotated[Optional[StrictStr], Field(description="Specifies the field to sort by.")] = None, - sort_order: Annotated[Optional[SortOrder], Field(description="Specifies the sort 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_certificate_signing_requests - - list CertificateSigningRequests - - :param var_continue: An optional parameter to query more results from the server. The value of the paramter must match the value of the 'continue' field in the previous list response. - :type var_continue: str - :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. - :type label_selector: str - :param field_selector: A selector to restrict the list of returned objects by their fields, supports '=', '==', and '!='.(e.g. key1=value1,key2!=value2). - :type field_selector: str - :param limit: The maximum number of results returned in the list response. The server will set the 'continue' field in the list response if more results exist. The continue value may then be specified as parameter in a subsequent query. - :type limit: int - :param sort_by: Specifies the field to sort by. - :type sort_by: str - :param sort_order: Specifies the sort order. - :type sort_order: SortOrder - :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_certificate_signing_requests_serialize( - var_continue=var_continue, - label_selector=label_selector, - field_selector=field_selector, - limit=limit, - sort_by=sort_by, - sort_order=sort_order, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "CertificateSigningRequestList", - '400': "Error", - '401': "Error", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _list_certificate_signing_requests_serialize( - self, - var_continue, - label_selector, - field_selector, - limit, - sort_by, - sort_order, - _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 var_continue is not None: - - _query_params.append(('continue', var_continue)) - - if label_selector is not None: - - _query_params.append(('labelSelector', label_selector)) - - if field_selector is not None: - - _query_params.append(('fieldSelector', field_selector)) - - if limit is not None: - - _query_params.append(('limit', limit)) - - if sort_by is not None: - - _query_params.append(('sortBy', sort_by)) - - if sort_order is not None: - - _query_params.append(('sortOrder', sort_order.value)) - - # 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( - [ - 'application/json' - ] - ) - - - # authentication setting - _auth_settings: List[str] = [ - ] - - return self.api_client.param_serialize( - method='GET', - resource_path='/api/v1/certificatesigningrequests', - 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 patch_certificate_signing_request( - self, - name: Annotated[StrictStr, Field(description="name of the certificatesigningrequest")], - patch_request_inner: Optional[List[PatchRequestInner]] = 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, - ) -> CertificateSigningRequest: - """patch_certificate_signing_request - - partially update the specified CertificateSigningRequest - - :param name: name of the certificatesigningrequest (required) - :type name: str - :param patch_request_inner: - :type patch_request_inner: List[PatchRequestInner] - :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._patch_certificate_signing_request_serialize( - name=name, - patch_request_inner=patch_request_inner, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "CertificateSigningRequest", - '201': "CertificateSigningRequest", - '400': "Error", - '401': "Error", - '404': "Error", - '409': "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 patch_certificate_signing_request_with_http_info( - self, - name: Annotated[StrictStr, Field(description="name of the certificatesigningrequest")], - patch_request_inner: Optional[List[PatchRequestInner]] = 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[CertificateSigningRequest]: - """patch_certificate_signing_request - - partially update the specified CertificateSigningRequest - - :param name: name of the certificatesigningrequest (required) - :type name: str - :param patch_request_inner: - :type patch_request_inner: List[PatchRequestInner] - :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._patch_certificate_signing_request_serialize( - name=name, - patch_request_inner=patch_request_inner, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "CertificateSigningRequest", - '201': "CertificateSigningRequest", - '400': "Error", - '401': "Error", - '404': "Error", - '409': "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 patch_certificate_signing_request_without_preload_content( - self, - name: Annotated[StrictStr, Field(description="name of the certificatesigningrequest")], - patch_request_inner: Optional[List[PatchRequestInner]] = 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: - """patch_certificate_signing_request - - partially update the specified CertificateSigningRequest - - :param name: name of the certificatesigningrequest (required) - :type name: str - :param patch_request_inner: - :type patch_request_inner: List[PatchRequestInner] - :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._patch_certificate_signing_request_serialize( - name=name, - patch_request_inner=patch_request_inner, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "CertificateSigningRequest", - '201': "CertificateSigningRequest", - '400': "Error", - '401': "Error", - '404': "Error", - '409': "Error", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _patch_certificate_signing_request_serialize( - self, - name, - patch_request_inner, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - 'PatchRequestInner': '', - } - - _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 name is not None: - _path_params['name'] = name - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if patch_request_inner is not None: - _body_params = patch_request_inner - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) - - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json-patch+json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - ] - - return self.api_client.param_serialize( - method='PATCH', - resource_path='/api/v1/certificatesigningrequests/{name}', - 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 read_certificate_signing_request( - self, - name: Annotated[str, Field(strict=True, description="the device identifier of the CertificateSigningRequest")], - _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, - ) -> CertificateSigningRequest: - """read_certificate_signing_request - - read the specified certificateSigningRequest - - :param name: the device identifier of the CertificateSigningRequest (required) - :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._read_certificate_signing_request_serialize( - name=name, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "CertificateSigningRequest", - '401': "Error", - '404': "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 read_certificate_signing_request_with_http_info( - self, - name: Annotated[str, Field(strict=True, description="the device identifier of the CertificateSigningRequest")], - _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[CertificateSigningRequest]: - """read_certificate_signing_request - - read the specified certificateSigningRequest - - :param name: the device identifier of the CertificateSigningRequest (required) - :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._read_certificate_signing_request_serialize( - name=name, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "CertificateSigningRequest", - '401': "Error", - '404': "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 read_certificate_signing_request_without_preload_content( - self, - name: Annotated[str, Field(strict=True, description="the device identifier of the CertificateSigningRequest")], - _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: - """read_certificate_signing_request - - read the specified certificateSigningRequest - - :param name: the device identifier of the CertificateSigningRequest (required) - :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._read_certificate_signing_request_serialize( - name=name, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "CertificateSigningRequest", - '401': "Error", - '404': "Error", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _read_certificate_signing_request_serialize( - self, - 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 - if name is not None: - _path_params['name'] = name - # 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( - [ - 'application/json' - ] - ) - - - # authentication setting - _auth_settings: List[str] = [ - ] - - return self.api_client.param_serialize( - method='GET', - resource_path='/api/v1/certificatesigningrequests/{name}', - 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 replace_certificate_signing_request( - self, - name: Annotated[StrictStr, Field(description="name of the CertificateSigningRequest")], - certificate_signing_request: CertificateSigningRequest, - _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, - ) -> CertificateSigningRequest: - """replace_certificate_signing_request - - replace the specified CertificateSigningRequest - - :param name: name of the CertificateSigningRequest (required) - :type name: str - :param certificate_signing_request: (required) - :type certificate_signing_request: CertificateSigningRequest - :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._replace_certificate_signing_request_serialize( - name=name, - certificate_signing_request=certificate_signing_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "CertificateSigningRequest", - '201': "CertificateSigningRequest", - '400': "Error", - '401': "Error", - '404': "Error", - '409': "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 replace_certificate_signing_request_with_http_info( - self, - name: Annotated[StrictStr, Field(description="name of the CertificateSigningRequest")], - certificate_signing_request: CertificateSigningRequest, - _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[CertificateSigningRequest]: - """replace_certificate_signing_request - - replace the specified CertificateSigningRequest - - :param name: name of the CertificateSigningRequest (required) - :type name: str - :param certificate_signing_request: (required) - :type certificate_signing_request: CertificateSigningRequest - :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._replace_certificate_signing_request_serialize( - name=name, - certificate_signing_request=certificate_signing_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "CertificateSigningRequest", - '201': "CertificateSigningRequest", - '400': "Error", - '401': "Error", - '404': "Error", - '409': "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 replace_certificate_signing_request_without_preload_content( - self, - name: Annotated[StrictStr, Field(description="name of the CertificateSigningRequest")], - certificate_signing_request: CertificateSigningRequest, - _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: - """replace_certificate_signing_request - - replace the specified CertificateSigningRequest - - :param name: name of the CertificateSigningRequest (required) - :type name: str - :param certificate_signing_request: (required) - :type certificate_signing_request: CertificateSigningRequest - :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._replace_certificate_signing_request_serialize( - name=name, - certificate_signing_request=certificate_signing_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "CertificateSigningRequest", - '201': "CertificateSigningRequest", - '400': "Error", - '401': "Error", - '404': "Error", - '409': "Error", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _replace_certificate_signing_request_serialize( - self, - name, - certificate_signing_request, - _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 name is not None: - _path_params['name'] = name - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if certificate_signing_request is not None: - _body_params = certificate_signing_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) - - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - ] - - return self.api_client.param_serialize( - method='PUT', - resource_path='/api/v1/certificatesigningrequests/{name}', - 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/openapi_client/api/default_api.py b/openapi_client/api/default_api.py deleted file mode 100644 index 9458ac6..0000000 --- a/openapi_client/api/default_api.py +++ /dev/null @@ -1,1101 +0,0 @@ -# coding: utf-8 - -""" - Open Device Management API - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: undefined - 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 Optional -from typing_extensions import Annotated -from openapi_client.models.auth_config import AuthConfig -from openapi_client.models.certificate_signing_request import CertificateSigningRequest - -from openapi_client.api_client import ApiClient, RequestSerialized -from openapi_client.api_response import ApiResponse -from openapi_client.rest import RESTResponseType - - -class DefaultApi: - """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 approve_certificate_signing_request( - self, - name: Annotated[StrictStr, Field(description="name of the CertificateSigningRequest")], - _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, - ) -> CertificateSigningRequest: - """approve_certificate_signing_request - - approve the specified CertificateSigningRequest - - :param name: name of the CertificateSigningRequest (required) - :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._approve_certificate_signing_request_serialize( - name=name, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "CertificateSigningRequest", - '400': "Error", - '401': "Error", - '404': "Error", - '409': "Error", - '500': "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 approve_certificate_signing_request_with_http_info( - self, - name: Annotated[StrictStr, Field(description="name of the CertificateSigningRequest")], - _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[CertificateSigningRequest]: - """approve_certificate_signing_request - - approve the specified CertificateSigningRequest - - :param name: name of the CertificateSigningRequest (required) - :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._approve_certificate_signing_request_serialize( - name=name, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "CertificateSigningRequest", - '400': "Error", - '401': "Error", - '404': "Error", - '409': "Error", - '500': "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 approve_certificate_signing_request_without_preload_content( - self, - name: Annotated[StrictStr, Field(description="name of the CertificateSigningRequest")], - _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: - """approve_certificate_signing_request - - approve the specified CertificateSigningRequest - - :param name: name of the CertificateSigningRequest (required) - :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._approve_certificate_signing_request_serialize( - name=name, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "CertificateSigningRequest", - '400': "Error", - '401': "Error", - '404': "Error", - '409': "Error", - '500': "Error", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _approve_certificate_signing_request_serialize( - self, - 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 - if name is not None: - _path_params['name'] = name - # 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( - [ - 'application/json' - ] - ) - - - # authentication setting - _auth_settings: List[str] = [ - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/api/v1/certificatesigningrequests/{name}/approval', - 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 auth_config( - self, - _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, - ) -> AuthConfig: - """auth_config - - Get auth configuration - - :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._auth_config_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "AuthConfig", - '418': None, - } - 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 auth_config_with_http_info( - self, - _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[AuthConfig]: - """auth_config - - Get auth configuration - - :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._auth_config_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "AuthConfig", - '418': None, - } - 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 auth_config_without_preload_content( - self, - _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: - """auth_config - - Get auth configuration - - :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._auth_config_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "AuthConfig", - '418': None, - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _auth_config_serialize( - self, - _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 - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) - - - # authentication setting - _auth_settings: List[str] = [ - ] - - return self.api_client.param_serialize( - method='GET', - resource_path='/api/v1/auth/config', - 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 auth_validate( - self, - authentication: 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, - ) -> None: - """auth_validate - - Validate auth token - - :param authentication: - :type authentication: 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._auth_validate_serialize( - authentication=authentication, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': None, - '401': None, - '418': None, - '500': "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 auth_validate_with_http_info( - self, - authentication: 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[None]: - """auth_validate - - Validate auth token - - :param authentication: - :type authentication: 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._auth_validate_serialize( - authentication=authentication, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': None, - '401': None, - '418': None, - '500': "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 auth_validate_without_preload_content( - self, - authentication: 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: - """auth_validate - - Validate auth token - - :param authentication: - :type authentication: 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._auth_validate_serialize( - authentication=authentication, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': None, - '401': None, - '418': None, - '500': "Error", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _auth_validate_serialize( - self, - authentication, - _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 - if authentication is not None: - _header_params['Authentication'] = authentication - # 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( - [ - 'application/json' - ] - ) - - - # authentication setting - _auth_settings: List[str] = [ - ] - - return self.api_client.param_serialize( - method='GET', - resource_path='/api/v1/auth/validate', - 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 deny_certificate_signing_request( - self, - name: Annotated[str, Field(strict=True, description="name of the CertificateSigningRequest")], - _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, - ) -> CertificateSigningRequest: - """deny_certificate_signing_request - - deny the specified CertificateSigningRequest - - :param name: name of the CertificateSigningRequest (required) - :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._deny_certificate_signing_request_serialize( - name=name, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "CertificateSigningRequest", - '401': "Error", - '404': "Error", - '409': "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 deny_certificate_signing_request_with_http_info( - self, - name: Annotated[str, Field(strict=True, description="name of the CertificateSigningRequest")], - _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[CertificateSigningRequest]: - """deny_certificate_signing_request - - deny the specified CertificateSigningRequest - - :param name: name of the CertificateSigningRequest (required) - :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._deny_certificate_signing_request_serialize( - name=name, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "CertificateSigningRequest", - '401': "Error", - '404': "Error", - '409': "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 deny_certificate_signing_request_without_preload_content( - self, - name: Annotated[str, Field(strict=True, description="name of the CertificateSigningRequest")], - _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: - """deny_certificate_signing_request - - deny the specified CertificateSigningRequest - - :param name: name of the CertificateSigningRequest (required) - :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._deny_certificate_signing_request_serialize( - name=name, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "CertificateSigningRequest", - '401': "Error", - '404': "Error", - '409': "Error", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _deny_certificate_signing_request_serialize( - self, - 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 - if name is not None: - _path_params['name'] = name - # 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( - [ - 'application/json' - ] - ) - - - # authentication setting - _auth_settings: List[str] = [ - ] - - return self.api_client.param_serialize( - method='DELETE', - resource_path='/api/v1/certificatesigningrequests/{name}/approval', - 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/openapi_client/api/device_api.py b/openapi_client/api/device_api.py deleted file mode 100644 index 7e8cba4..0000000 --- a/openapi_client/api/device_api.py +++ /dev/null @@ -1,3240 +0,0 @@ -# coding: utf-8 - -""" - Open Device Management API - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: undefined - 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, StrictBool, StrictInt, StrictStr -from typing import List, Optional -from typing_extensions import Annotated -from openapi_client.models.device import Device -from openapi_client.models.device_console import DeviceConsole -from openapi_client.models.device_list import DeviceList -from openapi_client.models.patch_request_inner import PatchRequestInner -from openapi_client.models.rendered_device_spec import RenderedDeviceSpec -from openapi_client.models.sort_order import SortOrder -from openapi_client.models.status import Status - -from openapi_client.api_client import ApiClient, RequestSerialized -from openapi_client.api_response import ApiResponse -from openapi_client.rest import RESTResponseType - - -class DeviceApi: - """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_device( - self, - device: Device, - _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, - ) -> Device: - """create_device - - create a Device - - :param device: (required) - :type device: Device - :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_device_serialize( - device=device, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '201': "Device", - '400': "Error", - '401': "Error", - '409': "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_device_with_http_info( - self, - device: Device, - _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[Device]: - """create_device - - create a Device - - :param device: (required) - :type device: Device - :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_device_serialize( - device=device, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '201': "Device", - '400': "Error", - '401': "Error", - '409': "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_device_without_preload_content( - self, - device: Device, - _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_device - - create a Device - - :param device: (required) - :type device: Device - :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_device_serialize( - device=device, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '201': "Device", - '400': "Error", - '401': "Error", - '409': "Error", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _create_device_serialize( - self, - device, - _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 device is not None: - _body_params = device - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) - - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/api/v1/devices', - 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_device( - self, - name: Annotated[StrictStr, Field(description="name of the Device")], - _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, - ) -> Device: - """delete_device - - delete a Device - - :param name: name of the Device (required) - :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._delete_device_serialize( - name=name, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "Device", - '401': "Error", - '404': "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_device_with_http_info( - self, - name: Annotated[StrictStr, Field(description="name of the Device")], - _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[Device]: - """delete_device - - delete a Device - - :param name: name of the Device (required) - :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._delete_device_serialize( - name=name, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "Device", - '401': "Error", - '404': "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_device_without_preload_content( - self, - name: Annotated[StrictStr, Field(description="name of the Device")], - _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_device - - delete a Device - - :param name: name of the Device (required) - :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._delete_device_serialize( - name=name, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "Device", - '401': "Error", - '404': "Error", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _delete_device_serialize( - self, - 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 - if name is not None: - _path_params['name'] = name - # 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( - [ - 'application/json' - ] - ) - - - # authentication setting - _auth_settings: List[str] = [ - ] - - return self.api_client.param_serialize( - method='DELETE', - resource_path='/api/v1/devices/{name}', - 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_devices( - self, - _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, - ) -> Status: - """delete_devices - - delete a collection of Devices - - :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_devices_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "Status", - '401': "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_devices_with_http_info( - self, - _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[Status]: - """delete_devices - - delete a collection of Devices - - :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_devices_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "Status", - '401': "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_devices_without_preload_content( - self, - _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_devices - - delete a collection of Devices - - :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_devices_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "Status", - '401': "Error", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _delete_devices_serialize( - self, - _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 - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) - - - # authentication setting - _auth_settings: List[str] = [ - ] - - return self.api_client.param_serialize( - method='DELETE', - resource_path='/api/v1/devices', - 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_rendered_device_spec( - self, - name: Annotated[StrictStr, Field(description="Name of the device")], - known_rendered_version: Annotated[Optional[StrictStr], Field(description="The last known renderedVersion")] = 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, - ) -> RenderedDeviceSpec: - """get_rendered_device_spec - - get the full specification for the specified device - - :param name: Name of the device (required) - :type name: str - :param known_rendered_version: The last known renderedVersion - :type known_rendered_version: 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_rendered_device_spec_serialize( - name=name, - known_rendered_version=known_rendered_version, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "RenderedDeviceSpec", - '204': None, - '401': "Error", - '404': "Error", - '409': "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_rendered_device_spec_with_http_info( - self, - name: Annotated[StrictStr, Field(description="Name of the device")], - known_rendered_version: Annotated[Optional[StrictStr], Field(description="The last known renderedVersion")] = 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[RenderedDeviceSpec]: - """get_rendered_device_spec - - get the full specification for the specified device - - :param name: Name of the device (required) - :type name: str - :param known_rendered_version: The last known renderedVersion - :type known_rendered_version: 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_rendered_device_spec_serialize( - name=name, - known_rendered_version=known_rendered_version, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "RenderedDeviceSpec", - '204': None, - '401': "Error", - '404': "Error", - '409': "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_rendered_device_spec_without_preload_content( - self, - name: Annotated[StrictStr, Field(description="Name of the device")], - known_rendered_version: Annotated[Optional[StrictStr], Field(description="The last known renderedVersion")] = 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: - """get_rendered_device_spec - - get the full specification for the specified device - - :param name: Name of the device (required) - :type name: str - :param known_rendered_version: The last known renderedVersion - :type known_rendered_version: 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_rendered_device_spec_serialize( - name=name, - known_rendered_version=known_rendered_version, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "RenderedDeviceSpec", - '204': None, - '401': "Error", - '404': "Error", - '409': "Error", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _get_rendered_device_spec_serialize( - self, - name, - known_rendered_version, - _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 name is not None: - _path_params['name'] = name - # process the query parameters - if known_rendered_version is not None: - - _query_params.append(('knownRenderedVersion', known_rendered_version)) - - # 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( - [ - 'application/json' - ] - ) - - - # authentication setting - _auth_settings: List[str] = [ - ] - - return self.api_client.param_serialize( - method='GET', - resource_path='/api/v1/devices/{name}/rendered', - 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_devices( - self, - var_continue: Annotated[Optional[StrictStr], Field(description="An optional parameter to query more results from the server. The value of the paramter must match the value of the 'continue' field in the previous list response.")] = None, - label_selector: Annotated[Optional[StrictStr], Field(description="A selector to restrict the list of returned objects by their labels. Defaults to everything.")] = None, - field_selector: Annotated[Optional[StrictStr], Field(description="A selector to restrict the list of returned objects by their fields, supports '=', '==', and '!='.(e.g. key1=value1,key2!=value2).")] = None, - status_filter: Annotated[Optional[List[StrictStr]], Field(description="A filter to restrict the list of devices by the value of the filtered status key. Defaults to everything.")] = None, - limit: Annotated[Optional[StrictInt], Field(description="The maximum number of results returned in the list response. The server will set the 'continue' field in the list response if more results exist. The continue value may then be specified as parameter in a subsequent query.")] = None, - owner: Annotated[Optional[StrictStr], Field(description="A selector to restrict the list of returned objects by their owner. Defaults to everything.")] = None, - summary_only: Annotated[Optional[StrictBool], Field(description="A boolean flag to include only a summary of the devices. When set to true, the response will contain only the summary information. Only the 'owner' and 'labelSelector' parameters are supported when 'summaryOnly' is true.")] = None, - sort_by: Annotated[Optional[StrictStr], Field(description="Specifies the field to sort by.")] = None, - sort_order: Annotated[Optional[SortOrder], Field(description="Specifies the sort 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, - ) -> DeviceList: - """list_devices - - list Devices - - :param var_continue: An optional parameter to query more results from the server. The value of the paramter must match the value of the 'continue' field in the previous list response. - :type var_continue: str - :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. - :type label_selector: str - :param field_selector: A selector to restrict the list of returned objects by their fields, supports '=', '==', and '!='.(e.g. key1=value1,key2!=value2). - :type field_selector: str - :param status_filter: A filter to restrict the list of devices by the value of the filtered status key. Defaults to everything. - :type status_filter: List[str] - :param limit: The maximum number of results returned in the list response. The server will set the 'continue' field in the list response if more results exist. The continue value may then be specified as parameter in a subsequent query. - :type limit: int - :param owner: A selector to restrict the list of returned objects by their owner. Defaults to everything. - :type owner: str - :param summary_only: A boolean flag to include only a summary of the devices. When set to true, the response will contain only the summary information. Only the 'owner' and 'labelSelector' parameters are supported when 'summaryOnly' is true. - :type summary_only: bool - :param sort_by: Specifies the field to sort by. - :type sort_by: str - :param sort_order: Specifies the sort order. - :type sort_order: SortOrder - :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_devices_serialize( - var_continue=var_continue, - label_selector=label_selector, - field_selector=field_selector, - status_filter=status_filter, - limit=limit, - owner=owner, - summary_only=summary_only, - sort_by=sort_by, - sort_order=sort_order, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "DeviceList", - '400': "Error", - '401': "Error", - '403': "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_devices_with_http_info( - self, - var_continue: Annotated[Optional[StrictStr], Field(description="An optional parameter to query more results from the server. The value of the paramter must match the value of the 'continue' field in the previous list response.")] = None, - label_selector: Annotated[Optional[StrictStr], Field(description="A selector to restrict the list of returned objects by their labels. Defaults to everything.")] = None, - field_selector: Annotated[Optional[StrictStr], Field(description="A selector to restrict the list of returned objects by their fields, supports '=', '==', and '!='.(e.g. key1=value1,key2!=value2).")] = None, - status_filter: Annotated[Optional[List[StrictStr]], Field(description="A filter to restrict the list of devices by the value of the filtered status key. Defaults to everything.")] = None, - limit: Annotated[Optional[StrictInt], Field(description="The maximum number of results returned in the list response. The server will set the 'continue' field in the list response if more results exist. The continue value may then be specified as parameter in a subsequent query.")] = None, - owner: Annotated[Optional[StrictStr], Field(description="A selector to restrict the list of returned objects by their owner. Defaults to everything.")] = None, - summary_only: Annotated[Optional[StrictBool], Field(description="A boolean flag to include only a summary of the devices. When set to true, the response will contain only the summary information. Only the 'owner' and 'labelSelector' parameters are supported when 'summaryOnly' is true.")] = None, - sort_by: Annotated[Optional[StrictStr], Field(description="Specifies the field to sort by.")] = None, - sort_order: Annotated[Optional[SortOrder], Field(description="Specifies the sort 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[DeviceList]: - """list_devices - - list Devices - - :param var_continue: An optional parameter to query more results from the server. The value of the paramter must match the value of the 'continue' field in the previous list response. - :type var_continue: str - :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. - :type label_selector: str - :param field_selector: A selector to restrict the list of returned objects by their fields, supports '=', '==', and '!='.(e.g. key1=value1,key2!=value2). - :type field_selector: str - :param status_filter: A filter to restrict the list of devices by the value of the filtered status key. Defaults to everything. - :type status_filter: List[str] - :param limit: The maximum number of results returned in the list response. The server will set the 'continue' field in the list response if more results exist. The continue value may then be specified as parameter in a subsequent query. - :type limit: int - :param owner: A selector to restrict the list of returned objects by their owner. Defaults to everything. - :type owner: str - :param summary_only: A boolean flag to include only a summary of the devices. When set to true, the response will contain only the summary information. Only the 'owner' and 'labelSelector' parameters are supported when 'summaryOnly' is true. - :type summary_only: bool - :param sort_by: Specifies the field to sort by. - :type sort_by: str - :param sort_order: Specifies the sort order. - :type sort_order: SortOrder - :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_devices_serialize( - var_continue=var_continue, - label_selector=label_selector, - field_selector=field_selector, - status_filter=status_filter, - limit=limit, - owner=owner, - summary_only=summary_only, - sort_by=sort_by, - sort_order=sort_order, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "DeviceList", - '400': "Error", - '401': "Error", - '403': "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_devices_without_preload_content( - self, - var_continue: Annotated[Optional[StrictStr], Field(description="An optional parameter to query more results from the server. The value of the paramter must match the value of the 'continue' field in the previous list response.")] = None, - label_selector: Annotated[Optional[StrictStr], Field(description="A selector to restrict the list of returned objects by their labels. Defaults to everything.")] = None, - field_selector: Annotated[Optional[StrictStr], Field(description="A selector to restrict the list of returned objects by their fields, supports '=', '==', and '!='.(e.g. key1=value1,key2!=value2).")] = None, - status_filter: Annotated[Optional[List[StrictStr]], Field(description="A filter to restrict the list of devices by the value of the filtered status key. Defaults to everything.")] = None, - limit: Annotated[Optional[StrictInt], Field(description="The maximum number of results returned in the list response. The server will set the 'continue' field in the list response if more results exist. The continue value may then be specified as parameter in a subsequent query.")] = None, - owner: Annotated[Optional[StrictStr], Field(description="A selector to restrict the list of returned objects by their owner. Defaults to everything.")] = None, - summary_only: Annotated[Optional[StrictBool], Field(description="A boolean flag to include only a summary of the devices. When set to true, the response will contain only the summary information. Only the 'owner' and 'labelSelector' parameters are supported when 'summaryOnly' is true.")] = None, - sort_by: Annotated[Optional[StrictStr], Field(description="Specifies the field to sort by.")] = None, - sort_order: Annotated[Optional[SortOrder], Field(description="Specifies the sort 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_devices - - list Devices - - :param var_continue: An optional parameter to query more results from the server. The value of the paramter must match the value of the 'continue' field in the previous list response. - :type var_continue: str - :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. - :type label_selector: str - :param field_selector: A selector to restrict the list of returned objects by their fields, supports '=', '==', and '!='.(e.g. key1=value1,key2!=value2). - :type field_selector: str - :param status_filter: A filter to restrict the list of devices by the value of the filtered status key. Defaults to everything. - :type status_filter: List[str] - :param limit: The maximum number of results returned in the list response. The server will set the 'continue' field in the list response if more results exist. The continue value may then be specified as parameter in a subsequent query. - :type limit: int - :param owner: A selector to restrict the list of returned objects by their owner. Defaults to everything. - :type owner: str - :param summary_only: A boolean flag to include only a summary of the devices. When set to true, the response will contain only the summary information. Only the 'owner' and 'labelSelector' parameters are supported when 'summaryOnly' is true. - :type summary_only: bool - :param sort_by: Specifies the field to sort by. - :type sort_by: str - :param sort_order: Specifies the sort order. - :type sort_order: SortOrder - :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_devices_serialize( - var_continue=var_continue, - label_selector=label_selector, - field_selector=field_selector, - status_filter=status_filter, - limit=limit, - owner=owner, - summary_only=summary_only, - sort_by=sort_by, - sort_order=sort_order, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "DeviceList", - '400': "Error", - '401': "Error", - '403': "Error", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _list_devices_serialize( - self, - var_continue, - label_selector, - field_selector, - status_filter, - limit, - owner, - summary_only, - sort_by, - sort_order, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - 'statusFilter': '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 var_continue is not None: - - _query_params.append(('continue', var_continue)) - - if label_selector is not None: - - _query_params.append(('labelSelector', label_selector)) - - if field_selector is not None: - - _query_params.append(('fieldSelector', field_selector)) - - if status_filter is not None: - - _query_params.append(('statusFilter', status_filter)) - - if limit is not None: - - _query_params.append(('limit', limit)) - - if owner is not None: - - _query_params.append(('owner', owner)) - - if summary_only is not None: - - _query_params.append(('summaryOnly', summary_only)) - - if sort_by is not None: - - _query_params.append(('sortBy', sort_by)) - - if sort_order is not None: - - _query_params.append(('sortOrder', sort_order.value)) - - # 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( - [ - 'application/json' - ] - ) - - - # authentication setting - _auth_settings: List[str] = [ - ] - - return self.api_client.param_serialize( - method='GET', - resource_path='/api/v1/devices', - 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 patch_device( - self, - name: Annotated[StrictStr, Field(description="name of the device")], - patch_request_inner: Optional[List[PatchRequestInner]] = 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, - ) -> Device: - """patch_device - - Patches the specified device - - :param name: name of the device (required) - :type name: str - :param patch_request_inner: - :type patch_request_inner: List[PatchRequestInner] - :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._patch_device_serialize( - name=name, - patch_request_inner=patch_request_inner, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "Device", - '400': "Error", - '401': "Error", - '404': "Error", - '409': "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 patch_device_with_http_info( - self, - name: Annotated[StrictStr, Field(description="name of the device")], - patch_request_inner: Optional[List[PatchRequestInner]] = 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[Device]: - """patch_device - - Patches the specified device - - :param name: name of the device (required) - :type name: str - :param patch_request_inner: - :type patch_request_inner: List[PatchRequestInner] - :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._patch_device_serialize( - name=name, - patch_request_inner=patch_request_inner, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "Device", - '400': "Error", - '401': "Error", - '404': "Error", - '409': "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 patch_device_without_preload_content( - self, - name: Annotated[StrictStr, Field(description="name of the device")], - patch_request_inner: Optional[List[PatchRequestInner]] = 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: - """patch_device - - Patches the specified device - - :param name: name of the device (required) - :type name: str - :param patch_request_inner: - :type patch_request_inner: List[PatchRequestInner] - :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._patch_device_serialize( - name=name, - patch_request_inner=patch_request_inner, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "Device", - '400': "Error", - '401': "Error", - '404': "Error", - '409': "Error", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _patch_device_serialize( - self, - name, - patch_request_inner, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - 'PatchRequestInner': '', - } - - _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 name is not None: - _path_params['name'] = name - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if patch_request_inner is not None: - _body_params = patch_request_inner - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) - - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json-patch+json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - ] - - return self.api_client.param_serialize( - method='PATCH', - resource_path='/api/v1/devices/{name}', - 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 read_device( - self, - name: Annotated[StrictStr, Field(description="unique name of the Device")], - _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, - ) -> Device: - """read_device - - read the specified Device - - :param name: unique name of the Device (required) - :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._read_device_serialize( - name=name, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "Device", - '401': "Error", - '404': "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 read_device_with_http_info( - self, - name: Annotated[StrictStr, Field(description="unique name of the Device")], - _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[Device]: - """read_device - - read the specified Device - - :param name: unique name of the Device (required) - :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._read_device_serialize( - name=name, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "Device", - '401': "Error", - '404': "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 read_device_without_preload_content( - self, - name: Annotated[StrictStr, Field(description="unique name of the Device")], - _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: - """read_device - - read the specified Device - - :param name: unique name of the Device (required) - :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._read_device_serialize( - name=name, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "Device", - '401': "Error", - '404': "Error", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _read_device_serialize( - self, - 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 - if name is not None: - _path_params['name'] = name - # 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( - [ - 'application/json' - ] - ) - - - # authentication setting - _auth_settings: List[str] = [ - ] - - return self.api_client.param_serialize( - method='GET', - resource_path='/api/v1/devices/{name}', - 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 read_device_status( - self, - name: Annotated[StrictStr, Field(description="name of the Device")], - _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, - ) -> Device: - """read_device_status - - read status of the specified Device - - :param name: name of the Device (required) - :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._read_device_status_serialize( - name=name, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "Device", - '401': "Error", - '404': "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 read_device_status_with_http_info( - self, - name: Annotated[StrictStr, Field(description="name of the Device")], - _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[Device]: - """read_device_status - - read status of the specified Device - - :param name: name of the Device (required) - :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._read_device_status_serialize( - name=name, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "Device", - '401': "Error", - '404': "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 read_device_status_without_preload_content( - self, - name: Annotated[StrictStr, Field(description="name of the Device")], - _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: - """read_device_status - - read status of the specified Device - - :param name: name of the Device (required) - :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._read_device_status_serialize( - name=name, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "Device", - '401': "Error", - '404': "Error", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _read_device_status_serialize( - self, - 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 - if name is not None: - _path_params['name'] = name - # 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( - [ - 'application/json' - ] - ) - - - # authentication setting - _auth_settings: List[str] = [ - ] - - return self.api_client.param_serialize( - method='GET', - resource_path='/api/v1/devices/{name}/status', - 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 replace_device( - self, - name: Annotated[StrictStr, Field(description="name of the Device")], - device: Device, - _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, - ) -> Device: - """replace_device - - replace the specified Device - - :param name: name of the Device (required) - :type name: str - :param device: (required) - :type device: Device - :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._replace_device_serialize( - name=name, - device=device, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "Device", - '201': "Device", - '400': "Error", - '401': "Error", - '404': "Error", - '409': "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 replace_device_with_http_info( - self, - name: Annotated[StrictStr, Field(description="name of the Device")], - device: Device, - _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[Device]: - """replace_device - - replace the specified Device - - :param name: name of the Device (required) - :type name: str - :param device: (required) - :type device: Device - :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._replace_device_serialize( - name=name, - device=device, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "Device", - '201': "Device", - '400': "Error", - '401': "Error", - '404': "Error", - '409': "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 replace_device_without_preload_content( - self, - name: Annotated[StrictStr, Field(description="name of the Device")], - device: Device, - _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: - """replace_device - - replace the specified Device - - :param name: name of the Device (required) - :type name: str - :param device: (required) - :type device: Device - :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._replace_device_serialize( - name=name, - device=device, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "Device", - '201': "Device", - '400': "Error", - '401': "Error", - '404': "Error", - '409': "Error", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _replace_device_serialize( - self, - name, - device, - _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 name is not None: - _path_params['name'] = name - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if device is not None: - _body_params = device - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) - - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - ] - - return self.api_client.param_serialize( - method='PUT', - resource_path='/api/v1/devices/{name}', - 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 replace_device_status( - self, - name: Annotated[StrictStr, Field(description="name of the Device")], - device: Device, - _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, - ) -> Device: - """replace_device_status - - replace status of the specified Device - - :param name: name of the Device (required) - :type name: str - :param device: (required) - :type device: Device - :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._replace_device_status_serialize( - name=name, - device=device, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "Device", - '400': "Error", - '401': "Error", - '404': "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 replace_device_status_with_http_info( - self, - name: Annotated[StrictStr, Field(description="name of the Device")], - device: Device, - _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[Device]: - """replace_device_status - - replace status of the specified Device - - :param name: name of the Device (required) - :type name: str - :param device: (required) - :type device: Device - :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._replace_device_status_serialize( - name=name, - device=device, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "Device", - '400': "Error", - '401': "Error", - '404': "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 replace_device_status_without_preload_content( - self, - name: Annotated[StrictStr, Field(description="name of the Device")], - device: Device, - _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: - """replace_device_status - - replace status of the specified Device - - :param name: name of the Device (required) - :type name: str - :param device: (required) - :type device: Device - :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._replace_device_status_serialize( - name=name, - device=device, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "Device", - '400': "Error", - '401': "Error", - '404': "Error", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _replace_device_status_serialize( - self, - name, - device, - _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 name is not None: - _path_params['name'] = name - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if device is not None: - _body_params = device - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) - - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - ] - - return self.api_client.param_serialize( - method='PUT', - resource_path='/api/v1/devices/{name}/status', - 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 request_console( - self, - name: Annotated[StrictStr, Field(description="unique name of the Device")], - _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, - ) -> DeviceConsole: - """request_console - - Request a console connection - - :param name: unique name of the Device (required) - :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._request_console_serialize( - name=name, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "DeviceConsole", - '401': "Error", - '404': "Error", - '409': "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 request_console_with_http_info( - self, - name: Annotated[StrictStr, Field(description="unique name of the Device")], - _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[DeviceConsole]: - """request_console - - Request a console connection - - :param name: unique name of the Device (required) - :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._request_console_serialize( - name=name, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "DeviceConsole", - '401': "Error", - '404': "Error", - '409': "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 request_console_without_preload_content( - self, - name: Annotated[StrictStr, Field(description="unique name of the Device")], - _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: - """request_console - - Request a console connection - - :param name: unique name of the Device (required) - :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._request_console_serialize( - name=name, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "DeviceConsole", - '401': "Error", - '404': "Error", - '409': "Error", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _request_console_serialize( - self, - 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 - if name is not None: - _path_params['name'] = name - # 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( - [ - 'application/json' - ] - ) - - - # authentication setting - _auth_settings: List[str] = [ - ] - - return self.api_client.param_serialize( - method='GET', - resource_path='/api/v1/devices/{name}/console', - 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/openapi_client/api/enrollmentconfig_api.py b/openapi_client/api/enrollmentconfig_api.py deleted file mode 100644 index 2545589..0000000 --- a/openapi_client/api/enrollmentconfig_api.py +++ /dev/null @@ -1,307 +0,0 @@ -# coding: utf-8 - -""" - Open Device Management API - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: undefined - 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_extensions import Annotated -from openapi_client.models.enrollment_config import EnrollmentConfig - -from openapi_client.api_client import ApiClient, RequestSerialized -from openapi_client.api_response import ApiResponse -from openapi_client.rest import RESTResponseType - - -class EnrollmentconfigApi: - """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 enrollment_config( - self, - name: Annotated[StrictStr, Field(description="the name of approved CSR")], - _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, - ) -> EnrollmentConfig: - """enrollment_config - - Get config for enrolling devices - - :param name: the name of approved CSR (required) - :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._enrollment_config_serialize( - name=name, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "EnrollmentConfig", - '400': "Error", - '404': "Error", - '401': "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 enrollment_config_with_http_info( - self, - name: Annotated[StrictStr, Field(description="the name of approved CSR")], - _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[EnrollmentConfig]: - """enrollment_config - - Get config for enrolling devices - - :param name: the name of approved CSR (required) - :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._enrollment_config_serialize( - name=name, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "EnrollmentConfig", - '400': "Error", - '404': "Error", - '401': "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 enrollment_config_without_preload_content( - self, - name: Annotated[StrictStr, Field(description="the name of approved CSR")], - _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: - """enrollment_config - - Get config for enrolling devices - - :param name: the name of approved CSR (required) - :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._enrollment_config_serialize( - name=name, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "EnrollmentConfig", - '400': "Error", - '404': "Error", - '401': "Error", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _enrollment_config_serialize( - self, - 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 - if name is not None: - _path_params['name'] = name - # 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( - [ - 'application/json' - ] - ) - - - # authentication setting - _auth_settings: List[str] = [ - ] - - return self.api_client.param_serialize( - method='GET', - resource_path='/api/v1/enrollmentconfig/{name}', - 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/openapi_client/api/enrollmentrequest_api.py b/openapi_client/api/enrollmentrequest_api.py deleted file mode 100644 index 70f6abc..0000000 --- a/openapi_client/api/enrollmentrequest_api.py +++ /dev/null @@ -1,2627 +0,0 @@ -# coding: utf-8 - -""" - Open Device Management API - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: undefined - 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, StrictInt, StrictStr -from typing import Optional -from typing_extensions import Annotated -from openapi_client.models.enrollment_request import EnrollmentRequest -from openapi_client.models.enrollment_request_approval import EnrollmentRequestApproval -from openapi_client.models.enrollment_request_list import EnrollmentRequestList -from openapi_client.models.sort_order import SortOrder -from openapi_client.models.status import Status - -from openapi_client.api_client import ApiClient, RequestSerialized -from openapi_client.api_response import ApiResponse -from openapi_client.rest import RESTResponseType - - -class EnrollmentrequestApi: - """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 approve_enrollment_request( - self, - name: Annotated[StrictStr, Field(description="name of the EnrollmentRequest")], - enrollment_request_approval: EnrollmentRequestApproval, - _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, - ) -> EnrollmentRequestApproval: - """approve_enrollment_request - - create approval of the specified EnrollmentRequest - - :param name: name of the EnrollmentRequest (required) - :type name: str - :param enrollment_request_approval: (required) - :type enrollment_request_approval: EnrollmentRequestApproval - :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._approve_enrollment_request_serialize( - name=name, - enrollment_request_approval=enrollment_request_approval, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "EnrollmentRequestApproval", - '422': "Error", - '400': "Error", - '401': "Error", - '404': "Error", - '500': "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 approve_enrollment_request_with_http_info( - self, - name: Annotated[StrictStr, Field(description="name of the EnrollmentRequest")], - enrollment_request_approval: EnrollmentRequestApproval, - _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[EnrollmentRequestApproval]: - """approve_enrollment_request - - create approval of the specified EnrollmentRequest - - :param name: name of the EnrollmentRequest (required) - :type name: str - :param enrollment_request_approval: (required) - :type enrollment_request_approval: EnrollmentRequestApproval - :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._approve_enrollment_request_serialize( - name=name, - enrollment_request_approval=enrollment_request_approval, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "EnrollmentRequestApproval", - '422': "Error", - '400': "Error", - '401': "Error", - '404': "Error", - '500': "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 approve_enrollment_request_without_preload_content( - self, - name: Annotated[StrictStr, Field(description="name of the EnrollmentRequest")], - enrollment_request_approval: EnrollmentRequestApproval, - _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: - """approve_enrollment_request - - create approval of the specified EnrollmentRequest - - :param name: name of the EnrollmentRequest (required) - :type name: str - :param enrollment_request_approval: (required) - :type enrollment_request_approval: EnrollmentRequestApproval - :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._approve_enrollment_request_serialize( - name=name, - enrollment_request_approval=enrollment_request_approval, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "EnrollmentRequestApproval", - '422': "Error", - '400': "Error", - '401': "Error", - '404': "Error", - '500': "Error", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _approve_enrollment_request_serialize( - self, - name, - enrollment_request_approval, - _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 name is not None: - _path_params['name'] = name - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if enrollment_request_approval is not None: - _body_params = enrollment_request_approval - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) - - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/api/v1/enrollmentrequests/{name}/approval', - 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 create_enrollment_request( - self, - enrollment_request: EnrollmentRequest, - _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, - ) -> EnrollmentRequest: - """create_enrollment_request - - request enrollment of a Device - - :param enrollment_request: (required) - :type enrollment_request: EnrollmentRequest - :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_enrollment_request_serialize( - enrollment_request=enrollment_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '201': "EnrollmentRequest", - '208': "EnrollmentRequest", - '400': "Error", - '401': "Error", - '409': "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_enrollment_request_with_http_info( - self, - enrollment_request: EnrollmentRequest, - _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[EnrollmentRequest]: - """create_enrollment_request - - request enrollment of a Device - - :param enrollment_request: (required) - :type enrollment_request: EnrollmentRequest - :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_enrollment_request_serialize( - enrollment_request=enrollment_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '201': "EnrollmentRequest", - '208': "EnrollmentRequest", - '400': "Error", - '401': "Error", - '409': "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_enrollment_request_without_preload_content( - self, - enrollment_request: EnrollmentRequest, - _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_enrollment_request - - request enrollment of a Device - - :param enrollment_request: (required) - :type enrollment_request: EnrollmentRequest - :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_enrollment_request_serialize( - enrollment_request=enrollment_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '201': "EnrollmentRequest", - '208': "EnrollmentRequest", - '400': "Error", - '401': "Error", - '409': "Error", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _create_enrollment_request_serialize( - self, - enrollment_request, - _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 enrollment_request is not None: - _body_params = enrollment_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) - - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/api/v1/enrollmentrequests', - 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_enrollment_request( - self, - name: Annotated[StrictStr, Field(description="name of the Enrollment Request")], - _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, - ) -> EnrollmentRequest: - """delete_enrollment_request - - delete a Enrollment Request - - :param name: name of the Enrollment Request (required) - :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._delete_enrollment_request_serialize( - name=name, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "EnrollmentRequest", - '401': "Error", - '404': "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_enrollment_request_with_http_info( - self, - name: Annotated[StrictStr, Field(description="name of the Enrollment Request")], - _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[EnrollmentRequest]: - """delete_enrollment_request - - delete a Enrollment Request - - :param name: name of the Enrollment Request (required) - :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._delete_enrollment_request_serialize( - name=name, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "EnrollmentRequest", - '401': "Error", - '404': "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_enrollment_request_without_preload_content( - self, - name: Annotated[StrictStr, Field(description="name of the Enrollment Request")], - _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_enrollment_request - - delete a Enrollment Request - - :param name: name of the Enrollment Request (required) - :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._delete_enrollment_request_serialize( - name=name, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "EnrollmentRequest", - '401': "Error", - '404': "Error", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _delete_enrollment_request_serialize( - self, - 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 - if name is not None: - _path_params['name'] = name - # 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( - [ - 'application/json' - ] - ) - - - # authentication setting - _auth_settings: List[str] = [ - ] - - return self.api_client.param_serialize( - method='DELETE', - resource_path='/api/v1/enrollmentrequests/{name}', - 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_enrollment_requests( - self, - _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, - ) -> Status: - """delete_enrollment_requests - - delete a collection of Enrollments - - :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_enrollment_requests_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "Status", - '401': "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_enrollment_requests_with_http_info( - self, - _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[Status]: - """delete_enrollment_requests - - delete a collection of Enrollments - - :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_enrollment_requests_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "Status", - '401': "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_enrollment_requests_without_preload_content( - self, - _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_enrollment_requests - - delete a collection of Enrollments - - :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_enrollment_requests_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "Status", - '401': "Error", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _delete_enrollment_requests_serialize( - self, - _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 - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) - - - # authentication setting - _auth_settings: List[str] = [ - ] - - return self.api_client.param_serialize( - method='DELETE', - resource_path='/api/v1/enrollmentrequests', - 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_enrollment_requests( - self, - var_continue: Annotated[Optional[StrictStr], Field(description="An optional parameter to query more results from the server. The value of the paramter must match the value of the 'continue' field in the previous list response.")] = None, - label_selector: Annotated[Optional[StrictStr], Field(description="A selector to restrict the list of returned objects by their labels. Defaults to everything.")] = None, - field_selector: Annotated[Optional[StrictStr], Field(description="A selector to restrict the list of returned objects by their fields, supports '=', '==', and '!='.(e.g. key1=value1,key2!=value2).")] = None, - limit: Annotated[Optional[StrictInt], Field(description="The maximum number of results returned in the list response. The server will set the 'continue' field in the list response if more results exist. The continue value may then be specified as parameter in a subsequent query.")] = None, - sort_by: Annotated[Optional[StrictStr], Field(description="Specifies the field to sort by.")] = None, - sort_order: Annotated[Optional[SortOrder], Field(description="Specifies the sort 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, - ) -> EnrollmentRequestList: - """list_enrollment_requests - - list Enrollment Requests - - :param var_continue: An optional parameter to query more results from the server. The value of the paramter must match the value of the 'continue' field in the previous list response. - :type var_continue: str - :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. - :type label_selector: str - :param field_selector: A selector to restrict the list of returned objects by their fields, supports '=', '==', and '!='.(e.g. key1=value1,key2!=value2). - :type field_selector: str - :param limit: The maximum number of results returned in the list response. The server will set the 'continue' field in the list response if more results exist. The continue value may then be specified as parameter in a subsequent query. - :type limit: int - :param sort_by: Specifies the field to sort by. - :type sort_by: str - :param sort_order: Specifies the sort order. - :type sort_order: SortOrder - :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_enrollment_requests_serialize( - var_continue=var_continue, - label_selector=label_selector, - field_selector=field_selector, - limit=limit, - sort_by=sort_by, - sort_order=sort_order, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "EnrollmentRequestList", - '400': "Error", - '401': "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_enrollment_requests_with_http_info( - self, - var_continue: Annotated[Optional[StrictStr], Field(description="An optional parameter to query more results from the server. The value of the paramter must match the value of the 'continue' field in the previous list response.")] = None, - label_selector: Annotated[Optional[StrictStr], Field(description="A selector to restrict the list of returned objects by their labels. Defaults to everything.")] = None, - field_selector: Annotated[Optional[StrictStr], Field(description="A selector to restrict the list of returned objects by their fields, supports '=', '==', and '!='.(e.g. key1=value1,key2!=value2).")] = None, - limit: Annotated[Optional[StrictInt], Field(description="The maximum number of results returned in the list response. The server will set the 'continue' field in the list response if more results exist. The continue value may then be specified as parameter in a subsequent query.")] = None, - sort_by: Annotated[Optional[StrictStr], Field(description="Specifies the field to sort by.")] = None, - sort_order: Annotated[Optional[SortOrder], Field(description="Specifies the sort 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[EnrollmentRequestList]: - """list_enrollment_requests - - list Enrollment Requests - - :param var_continue: An optional parameter to query more results from the server. The value of the paramter must match the value of the 'continue' field in the previous list response. - :type var_continue: str - :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. - :type label_selector: str - :param field_selector: A selector to restrict the list of returned objects by their fields, supports '=', '==', and '!='.(e.g. key1=value1,key2!=value2). - :type field_selector: str - :param limit: The maximum number of results returned in the list response. The server will set the 'continue' field in the list response if more results exist. The continue value may then be specified as parameter in a subsequent query. - :type limit: int - :param sort_by: Specifies the field to sort by. - :type sort_by: str - :param sort_order: Specifies the sort order. - :type sort_order: SortOrder - :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_enrollment_requests_serialize( - var_continue=var_continue, - label_selector=label_selector, - field_selector=field_selector, - limit=limit, - sort_by=sort_by, - sort_order=sort_order, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "EnrollmentRequestList", - '400': "Error", - '401': "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_enrollment_requests_without_preload_content( - self, - var_continue: Annotated[Optional[StrictStr], Field(description="An optional parameter to query more results from the server. The value of the paramter must match the value of the 'continue' field in the previous list response.")] = None, - label_selector: Annotated[Optional[StrictStr], Field(description="A selector to restrict the list of returned objects by their labels. Defaults to everything.")] = None, - field_selector: Annotated[Optional[StrictStr], Field(description="A selector to restrict the list of returned objects by their fields, supports '=', '==', and '!='.(e.g. key1=value1,key2!=value2).")] = None, - limit: Annotated[Optional[StrictInt], Field(description="The maximum number of results returned in the list response. The server will set the 'continue' field in the list response if more results exist. The continue value may then be specified as parameter in a subsequent query.")] = None, - sort_by: Annotated[Optional[StrictStr], Field(description="Specifies the field to sort by.")] = None, - sort_order: Annotated[Optional[SortOrder], Field(description="Specifies the sort 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_enrollment_requests - - list Enrollment Requests - - :param var_continue: An optional parameter to query more results from the server. The value of the paramter must match the value of the 'continue' field in the previous list response. - :type var_continue: str - :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. - :type label_selector: str - :param field_selector: A selector to restrict the list of returned objects by their fields, supports '=', '==', and '!='.(e.g. key1=value1,key2!=value2). - :type field_selector: str - :param limit: The maximum number of results returned in the list response. The server will set the 'continue' field in the list response if more results exist. The continue value may then be specified as parameter in a subsequent query. - :type limit: int - :param sort_by: Specifies the field to sort by. - :type sort_by: str - :param sort_order: Specifies the sort order. - :type sort_order: SortOrder - :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_enrollment_requests_serialize( - var_continue=var_continue, - label_selector=label_selector, - field_selector=field_selector, - limit=limit, - sort_by=sort_by, - sort_order=sort_order, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "EnrollmentRequestList", - '400': "Error", - '401': "Error", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _list_enrollment_requests_serialize( - self, - var_continue, - label_selector, - field_selector, - limit, - sort_by, - sort_order, - _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 var_continue is not None: - - _query_params.append(('continue', var_continue)) - - if label_selector is not None: - - _query_params.append(('labelSelector', label_selector)) - - if field_selector is not None: - - _query_params.append(('fieldSelector', field_selector)) - - if limit is not None: - - _query_params.append(('limit', limit)) - - if sort_by is not None: - - _query_params.append(('sortBy', sort_by)) - - if sort_order is not None: - - _query_params.append(('sortOrder', sort_order.value)) - - # 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( - [ - 'application/json' - ] - ) - - - # authentication setting - _auth_settings: List[str] = [ - ] - - return self.api_client.param_serialize( - method='GET', - resource_path='/api/v1/enrollmentrequests', - 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 read_enrollment_request( - self, - name: Annotated[StrictStr, Field(description="the fingerprint of the EnrollmentRequest")], - _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, - ) -> EnrollmentRequest: - """read_enrollment_request - - read the specified Enrollment - - :param name: the fingerprint of the EnrollmentRequest (required) - :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._read_enrollment_request_serialize( - name=name, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "EnrollmentRequest", - '401': "Error", - '404': "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 read_enrollment_request_with_http_info( - self, - name: Annotated[StrictStr, Field(description="the fingerprint of the EnrollmentRequest")], - _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[EnrollmentRequest]: - """read_enrollment_request - - read the specified Enrollment - - :param name: the fingerprint of the EnrollmentRequest (required) - :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._read_enrollment_request_serialize( - name=name, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "EnrollmentRequest", - '401': "Error", - '404': "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 read_enrollment_request_without_preload_content( - self, - name: Annotated[StrictStr, Field(description="the fingerprint of the EnrollmentRequest")], - _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: - """read_enrollment_request - - read the specified Enrollment - - :param name: the fingerprint of the EnrollmentRequest (required) - :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._read_enrollment_request_serialize( - name=name, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "EnrollmentRequest", - '401': "Error", - '404': "Error", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _read_enrollment_request_serialize( - self, - 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 - if name is not None: - _path_params['name'] = name - # 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( - [ - 'application/json' - ] - ) - - - # authentication setting - _auth_settings: List[str] = [ - ] - - return self.api_client.param_serialize( - method='GET', - resource_path='/api/v1/enrollmentrequests/{name}', - 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 read_enrollment_request_status( - self, - name: Annotated[StrictStr, Field(description="name of the EnrollmentRequest")], - _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, - ) -> EnrollmentRequest: - """read_enrollment_request_status - - read status of the specified EnrollmentRequest - - :param name: name of the EnrollmentRequest (required) - :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._read_enrollment_request_status_serialize( - name=name, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "EnrollmentRequest", - '401': "Error", - '404': "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 read_enrollment_request_status_with_http_info( - self, - name: Annotated[StrictStr, Field(description="name of the EnrollmentRequest")], - _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[EnrollmentRequest]: - """read_enrollment_request_status - - read status of the specified EnrollmentRequest - - :param name: name of the EnrollmentRequest (required) - :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._read_enrollment_request_status_serialize( - name=name, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "EnrollmentRequest", - '401': "Error", - '404': "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 read_enrollment_request_status_without_preload_content( - self, - name: Annotated[StrictStr, Field(description="name of the EnrollmentRequest")], - _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: - """read_enrollment_request_status - - read status of the specified EnrollmentRequest - - :param name: name of the EnrollmentRequest (required) - :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._read_enrollment_request_status_serialize( - name=name, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "EnrollmentRequest", - '401': "Error", - '404': "Error", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _read_enrollment_request_status_serialize( - self, - 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 - if name is not None: - _path_params['name'] = name - # 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( - [ - 'application/json' - ] - ) - - - # authentication setting - _auth_settings: List[str] = [ - ] - - return self.api_client.param_serialize( - method='GET', - resource_path='/api/v1/enrollmentrequests/{name}/status', - 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 replace_enrollment_request( - self, - name: Annotated[StrictStr, Field(description="name of the EnrollmentRequest")], - enrollment_request: EnrollmentRequest, - _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, - ) -> EnrollmentRequest: - """replace_enrollment_request - - replace the specified Enrollment Request - - :param name: name of the EnrollmentRequest (required) - :type name: str - :param enrollment_request: (required) - :type enrollment_request: EnrollmentRequest - :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._replace_enrollment_request_serialize( - name=name, - enrollment_request=enrollment_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "EnrollmentRequest", - '201': "EnrollmentRequest", - '400': "Error", - '401': "Error", - '404': "Error", - '409': "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 replace_enrollment_request_with_http_info( - self, - name: Annotated[StrictStr, Field(description="name of the EnrollmentRequest")], - enrollment_request: EnrollmentRequest, - _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[EnrollmentRequest]: - """replace_enrollment_request - - replace the specified Enrollment Request - - :param name: name of the EnrollmentRequest (required) - :type name: str - :param enrollment_request: (required) - :type enrollment_request: EnrollmentRequest - :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._replace_enrollment_request_serialize( - name=name, - enrollment_request=enrollment_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "EnrollmentRequest", - '201': "EnrollmentRequest", - '400': "Error", - '401': "Error", - '404': "Error", - '409': "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 replace_enrollment_request_without_preload_content( - self, - name: Annotated[StrictStr, Field(description="name of the EnrollmentRequest")], - enrollment_request: EnrollmentRequest, - _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: - """replace_enrollment_request - - replace the specified Enrollment Request - - :param name: name of the EnrollmentRequest (required) - :type name: str - :param enrollment_request: (required) - :type enrollment_request: EnrollmentRequest - :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._replace_enrollment_request_serialize( - name=name, - enrollment_request=enrollment_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "EnrollmentRequest", - '201': "EnrollmentRequest", - '400': "Error", - '401': "Error", - '404': "Error", - '409': "Error", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _replace_enrollment_request_serialize( - self, - name, - enrollment_request, - _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 name is not None: - _path_params['name'] = name - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if enrollment_request is not None: - _body_params = enrollment_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) - - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - ] - - return self.api_client.param_serialize( - method='PUT', - resource_path='/api/v1/enrollmentrequests/{name}', - 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 replace_enrollment_request_status( - self, - name: Annotated[StrictStr, Field(description="name of the EnrollmentRequest")], - enrollment_request: EnrollmentRequest, - _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, - ) -> EnrollmentRequest: - """replace_enrollment_request_status - - replace status of the specified EnrollmentRequest - - :param name: name of the EnrollmentRequest (required) - :type name: str - :param enrollment_request: (required) - :type enrollment_request: EnrollmentRequest - :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._replace_enrollment_request_status_serialize( - name=name, - enrollment_request=enrollment_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "EnrollmentRequest", - '401': "Error", - '404': "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 replace_enrollment_request_status_with_http_info( - self, - name: Annotated[StrictStr, Field(description="name of the EnrollmentRequest")], - enrollment_request: EnrollmentRequest, - _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[EnrollmentRequest]: - """replace_enrollment_request_status - - replace status of the specified EnrollmentRequest - - :param name: name of the EnrollmentRequest (required) - :type name: str - :param enrollment_request: (required) - :type enrollment_request: EnrollmentRequest - :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._replace_enrollment_request_status_serialize( - name=name, - enrollment_request=enrollment_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "EnrollmentRequest", - '401': "Error", - '404': "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 replace_enrollment_request_status_without_preload_content( - self, - name: Annotated[StrictStr, Field(description="name of the EnrollmentRequest")], - enrollment_request: EnrollmentRequest, - _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: - """replace_enrollment_request_status - - replace status of the specified EnrollmentRequest - - :param name: name of the EnrollmentRequest (required) - :type name: str - :param enrollment_request: (required) - :type enrollment_request: EnrollmentRequest - :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._replace_enrollment_request_status_serialize( - name=name, - enrollment_request=enrollment_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "EnrollmentRequest", - '401': "Error", - '404': "Error", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _replace_enrollment_request_status_serialize( - self, - name, - enrollment_request, - _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 name is not None: - _path_params['name'] = name - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if enrollment_request is not None: - _body_params = enrollment_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) - - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - ] - - return self.api_client.param_serialize( - method='PUT', - resource_path='/api/v1/enrollmentrequests/{name}/status', - 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/openapi_client/api/fleet_api.py b/openapi_client/api/fleet_api.py deleted file mode 100644 index 9fe2179..0000000 --- a/openapi_client/api/fleet_api.py +++ /dev/null @@ -1,2676 +0,0 @@ -# coding: utf-8 - -""" - Open Device Management API - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: undefined - 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, StrictBool, StrictInt, StrictStr -from typing import List, Optional -from typing_extensions import Annotated -from openapi_client.models.fleet import Fleet -from openapi_client.models.fleet_list import FleetList -from openapi_client.models.patch_request_inner import PatchRequestInner -from openapi_client.models.sort_order import SortOrder -from openapi_client.models.status import Status - -from openapi_client.api_client import ApiClient, RequestSerialized -from openapi_client.api_response import ApiResponse -from openapi_client.rest import RESTResponseType - - -class FleetApi: - """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_fleet( - self, - fleet: Fleet, - _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, - ) -> Fleet: - """create_fleet - - create a Fleet - - :param fleet: (required) - :type fleet: Fleet - :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_fleet_serialize( - fleet=fleet, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '201': "Fleet", - '400': "Error", - '401': "Error", - '409': "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_fleet_with_http_info( - self, - fleet: Fleet, - _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[Fleet]: - """create_fleet - - create a Fleet - - :param fleet: (required) - :type fleet: Fleet - :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_fleet_serialize( - fleet=fleet, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '201': "Fleet", - '400': "Error", - '401': "Error", - '409': "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_fleet_without_preload_content( - self, - fleet: Fleet, - _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_fleet - - create a Fleet - - :param fleet: (required) - :type fleet: Fleet - :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_fleet_serialize( - fleet=fleet, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '201': "Fleet", - '400': "Error", - '401': "Error", - '409': "Error", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _create_fleet_serialize( - self, - fleet, - _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 fleet is not None: - _body_params = fleet - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) - - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/api/v1/fleets', - 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_fleet( - self, - name: Annotated[StrictStr, Field(description="name of the Fleet")], - _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, - ) -> Fleet: - """delete_fleet - - delete a Fleet - - :param name: name of the Fleet (required) - :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._delete_fleet_serialize( - name=name, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "Fleet", - '401': "Error", - '404': "Error", - '409': "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_fleet_with_http_info( - self, - name: Annotated[StrictStr, Field(description="name of the Fleet")], - _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[Fleet]: - """delete_fleet - - delete a Fleet - - :param name: name of the Fleet (required) - :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._delete_fleet_serialize( - name=name, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "Fleet", - '401': "Error", - '404': "Error", - '409': "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_fleet_without_preload_content( - self, - name: Annotated[StrictStr, Field(description="name of the Fleet")], - _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_fleet - - delete a Fleet - - :param name: name of the Fleet (required) - :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._delete_fleet_serialize( - name=name, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "Fleet", - '401': "Error", - '404': "Error", - '409': "Error", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _delete_fleet_serialize( - self, - 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 - if name is not None: - _path_params['name'] = name - # 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( - [ - 'application/json' - ] - ) - - - # authentication setting - _auth_settings: List[str] = [ - ] - - return self.api_client.param_serialize( - method='DELETE', - resource_path='/api/v1/fleets/{name}', - 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_fleets( - self, - _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, - ) -> Status: - """delete_fleets - - delete a collection of Fleets - - :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_fleets_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "Status", - '401': "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_fleets_with_http_info( - self, - _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[Status]: - """delete_fleets - - delete a collection of Fleets - - :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_fleets_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "Status", - '401': "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_fleets_without_preload_content( - self, - _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_fleets - - delete a collection of Fleets - - :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_fleets_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "Status", - '401': "Error", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _delete_fleets_serialize( - self, - _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 - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) - - - # authentication setting - _auth_settings: List[str] = [ - ] - - return self.api_client.param_serialize( - method='DELETE', - resource_path='/api/v1/fleets', - 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_fleets( - self, - var_continue: Annotated[Optional[StrictStr], Field(description="An optional parameter to query more results from the server. The value of the paramter must match the value of the 'continue' field in the previous list response.")] = None, - label_selector: Annotated[Optional[StrictStr], Field(description="A selector to restrict the list of returned objects by their labels. Defaults to everything.")] = None, - field_selector: Annotated[Optional[StrictStr], Field(description="A selector to restrict the list of returned objects by their fields, supports '=', '==', and '!='.(e.g. key1=value1,key2!=value2).")] = None, - limit: Annotated[Optional[StrictInt], Field(description="The maximum number of results returned in the list response. The server will set the 'continue' field in the list response if more results exist. The continue value may then be specified as parameter in a subsequent query.")] = None, - owner: Annotated[Optional[StrictStr], Field(description="A selector to restrict the list of returned objects by their owner. Defaults to everything.")] = None, - add_devices_count: Annotated[Optional[StrictBool], Field(description="include the number of devices in each fleet")] = None, - sort_by: Annotated[Optional[StrictStr], Field(description="Specifies the field to sort by.")] = None, - sort_order: Annotated[Optional[SortOrder], Field(description="Specifies the sort 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, - ) -> FleetList: - """list_fleets - - list Fleets - - :param var_continue: An optional parameter to query more results from the server. The value of the paramter must match the value of the 'continue' field in the previous list response. - :type var_continue: str - :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. - :type label_selector: str - :param field_selector: A selector to restrict the list of returned objects by their fields, supports '=', '==', and '!='.(e.g. key1=value1,key2!=value2). - :type field_selector: str - :param limit: The maximum number of results returned in the list response. The server will set the 'continue' field in the list response if more results exist. The continue value may then be specified as parameter in a subsequent query. - :type limit: int - :param owner: A selector to restrict the list of returned objects by their owner. Defaults to everything. - :type owner: str - :param add_devices_count: include the number of devices in each fleet - :type add_devices_count: bool - :param sort_by: Specifies the field to sort by. - :type sort_by: str - :param sort_order: Specifies the sort order. - :type sort_order: SortOrder - :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_fleets_serialize( - var_continue=var_continue, - label_selector=label_selector, - field_selector=field_selector, - limit=limit, - owner=owner, - add_devices_count=add_devices_count, - sort_by=sort_by, - sort_order=sort_order, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "FleetList", - '400': "Error", - '401': "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_fleets_with_http_info( - self, - var_continue: Annotated[Optional[StrictStr], Field(description="An optional parameter to query more results from the server. The value of the paramter must match the value of the 'continue' field in the previous list response.")] = None, - label_selector: Annotated[Optional[StrictStr], Field(description="A selector to restrict the list of returned objects by their labels. Defaults to everything.")] = None, - field_selector: Annotated[Optional[StrictStr], Field(description="A selector to restrict the list of returned objects by their fields, supports '=', '==', and '!='.(e.g. key1=value1,key2!=value2).")] = None, - limit: Annotated[Optional[StrictInt], Field(description="The maximum number of results returned in the list response. The server will set the 'continue' field in the list response if more results exist. The continue value may then be specified as parameter in a subsequent query.")] = None, - owner: Annotated[Optional[StrictStr], Field(description="A selector to restrict the list of returned objects by their owner. Defaults to everything.")] = None, - add_devices_count: Annotated[Optional[StrictBool], Field(description="include the number of devices in each fleet")] = None, - sort_by: Annotated[Optional[StrictStr], Field(description="Specifies the field to sort by.")] = None, - sort_order: Annotated[Optional[SortOrder], Field(description="Specifies the sort 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[FleetList]: - """list_fleets - - list Fleets - - :param var_continue: An optional parameter to query more results from the server. The value of the paramter must match the value of the 'continue' field in the previous list response. - :type var_continue: str - :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. - :type label_selector: str - :param field_selector: A selector to restrict the list of returned objects by their fields, supports '=', '==', and '!='.(e.g. key1=value1,key2!=value2). - :type field_selector: str - :param limit: The maximum number of results returned in the list response. The server will set the 'continue' field in the list response if more results exist. The continue value may then be specified as parameter in a subsequent query. - :type limit: int - :param owner: A selector to restrict the list of returned objects by their owner. Defaults to everything. - :type owner: str - :param add_devices_count: include the number of devices in each fleet - :type add_devices_count: bool - :param sort_by: Specifies the field to sort by. - :type sort_by: str - :param sort_order: Specifies the sort order. - :type sort_order: SortOrder - :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_fleets_serialize( - var_continue=var_continue, - label_selector=label_selector, - field_selector=field_selector, - limit=limit, - owner=owner, - add_devices_count=add_devices_count, - sort_by=sort_by, - sort_order=sort_order, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "FleetList", - '400': "Error", - '401': "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_fleets_without_preload_content( - self, - var_continue: Annotated[Optional[StrictStr], Field(description="An optional parameter to query more results from the server. The value of the paramter must match the value of the 'continue' field in the previous list response.")] = None, - label_selector: Annotated[Optional[StrictStr], Field(description="A selector to restrict the list of returned objects by their labels. Defaults to everything.")] = None, - field_selector: Annotated[Optional[StrictStr], Field(description="A selector to restrict the list of returned objects by their fields, supports '=', '==', and '!='.(e.g. key1=value1,key2!=value2).")] = None, - limit: Annotated[Optional[StrictInt], Field(description="The maximum number of results returned in the list response. The server will set the 'continue' field in the list response if more results exist. The continue value may then be specified as parameter in a subsequent query.")] = None, - owner: Annotated[Optional[StrictStr], Field(description="A selector to restrict the list of returned objects by their owner. Defaults to everything.")] = None, - add_devices_count: Annotated[Optional[StrictBool], Field(description="include the number of devices in each fleet")] = None, - sort_by: Annotated[Optional[StrictStr], Field(description="Specifies the field to sort by.")] = None, - sort_order: Annotated[Optional[SortOrder], Field(description="Specifies the sort 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_fleets - - list Fleets - - :param var_continue: An optional parameter to query more results from the server. The value of the paramter must match the value of the 'continue' field in the previous list response. - :type var_continue: str - :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. - :type label_selector: str - :param field_selector: A selector to restrict the list of returned objects by their fields, supports '=', '==', and '!='.(e.g. key1=value1,key2!=value2). - :type field_selector: str - :param limit: The maximum number of results returned in the list response. The server will set the 'continue' field in the list response if more results exist. The continue value may then be specified as parameter in a subsequent query. - :type limit: int - :param owner: A selector to restrict the list of returned objects by their owner. Defaults to everything. - :type owner: str - :param add_devices_count: include the number of devices in each fleet - :type add_devices_count: bool - :param sort_by: Specifies the field to sort by. - :type sort_by: str - :param sort_order: Specifies the sort order. - :type sort_order: SortOrder - :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_fleets_serialize( - var_continue=var_continue, - label_selector=label_selector, - field_selector=field_selector, - limit=limit, - owner=owner, - add_devices_count=add_devices_count, - sort_by=sort_by, - sort_order=sort_order, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "FleetList", - '400': "Error", - '401': "Error", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _list_fleets_serialize( - self, - var_continue, - label_selector, - field_selector, - limit, - owner, - add_devices_count, - sort_by, - sort_order, - _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 var_continue is not None: - - _query_params.append(('continue', var_continue)) - - if label_selector is not None: - - _query_params.append(('labelSelector', label_selector)) - - if field_selector is not None: - - _query_params.append(('fieldSelector', field_selector)) - - if limit is not None: - - _query_params.append(('limit', limit)) - - if owner is not None: - - _query_params.append(('owner', owner)) - - if add_devices_count is not None: - - _query_params.append(('addDevicesCount', add_devices_count)) - - if sort_by is not None: - - _query_params.append(('sortBy', sort_by)) - - if sort_order is not None: - - _query_params.append(('sortOrder', sort_order.value)) - - # 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( - [ - 'application/json' - ] - ) - - - # authentication setting - _auth_settings: List[str] = [ - ] - - return self.api_client.param_serialize( - method='GET', - resource_path='/api/v1/fleets', - 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 patch_fleet( - self, - name: Annotated[StrictStr, Field(description="name of the fleet")], - patch_request_inner: Optional[List[PatchRequestInner]] = 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, - ) -> Fleet: - """patch_fleet - - Patches the specified fleet - - :param name: name of the fleet (required) - :type name: str - :param patch_request_inner: - :type patch_request_inner: List[PatchRequestInner] - :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._patch_fleet_serialize( - name=name, - patch_request_inner=patch_request_inner, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "Fleet", - '400': "Error", - '401': "Error", - '404': "Error", - '409': "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 patch_fleet_with_http_info( - self, - name: Annotated[StrictStr, Field(description="name of the fleet")], - patch_request_inner: Optional[List[PatchRequestInner]] = 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[Fleet]: - """patch_fleet - - Patches the specified fleet - - :param name: name of the fleet (required) - :type name: str - :param patch_request_inner: - :type patch_request_inner: List[PatchRequestInner] - :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._patch_fleet_serialize( - name=name, - patch_request_inner=patch_request_inner, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "Fleet", - '400': "Error", - '401': "Error", - '404': "Error", - '409': "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 patch_fleet_without_preload_content( - self, - name: Annotated[StrictStr, Field(description="name of the fleet")], - patch_request_inner: Optional[List[PatchRequestInner]] = 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: - """patch_fleet - - Patches the specified fleet - - :param name: name of the fleet (required) - :type name: str - :param patch_request_inner: - :type patch_request_inner: List[PatchRequestInner] - :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._patch_fleet_serialize( - name=name, - patch_request_inner=patch_request_inner, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "Fleet", - '400': "Error", - '401': "Error", - '404': "Error", - '409': "Error", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _patch_fleet_serialize( - self, - name, - patch_request_inner, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - 'PatchRequestInner': '', - } - - _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 name is not None: - _path_params['name'] = name - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if patch_request_inner is not None: - _body_params = patch_request_inner - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) - - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json-patch+json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - ] - - return self.api_client.param_serialize( - method='PATCH', - resource_path='/api/v1/fleets/{name}', - 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 read_fleet( - self, - name: Annotated[StrictStr, Field(description="unique name of the Fleet")], - add_devices_summary: Annotated[Optional[StrictBool], Field(description="include a summary of the devices in the fleet")] = 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, - ) -> Fleet: - """read_fleet - - read the specified Fleet - - :param name: unique name of the Fleet (required) - :type name: str - :param add_devices_summary: include a summary of the devices in the fleet - :type add_devices_summary: 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 - (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._read_fleet_serialize( - name=name, - add_devices_summary=add_devices_summary, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "Fleet", - '401': "Error", - '404': "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 read_fleet_with_http_info( - self, - name: Annotated[StrictStr, Field(description="unique name of the Fleet")], - add_devices_summary: Annotated[Optional[StrictBool], Field(description="include a summary of the devices in the fleet")] = 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[Fleet]: - """read_fleet - - read the specified Fleet - - :param name: unique name of the Fleet (required) - :type name: str - :param add_devices_summary: include a summary of the devices in the fleet - :type add_devices_summary: 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 - (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._read_fleet_serialize( - name=name, - add_devices_summary=add_devices_summary, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "Fleet", - '401': "Error", - '404': "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 read_fleet_without_preload_content( - self, - name: Annotated[StrictStr, Field(description="unique name of the Fleet")], - add_devices_summary: Annotated[Optional[StrictBool], Field(description="include a summary of the devices in the fleet")] = 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: - """read_fleet - - read the specified Fleet - - :param name: unique name of the Fleet (required) - :type name: str - :param add_devices_summary: include a summary of the devices in the fleet - :type add_devices_summary: 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 - (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._read_fleet_serialize( - name=name, - add_devices_summary=add_devices_summary, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "Fleet", - '401': "Error", - '404': "Error", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _read_fleet_serialize( - self, - name, - add_devices_summary, - _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 name is not None: - _path_params['name'] = name - # process the query parameters - if add_devices_summary is not None: - - _query_params.append(('addDevicesSummary', add_devices_summary)) - - # 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( - [ - 'application/json' - ] - ) - - - # authentication setting - _auth_settings: List[str] = [ - ] - - return self.api_client.param_serialize( - method='GET', - resource_path='/api/v1/fleets/{name}', - 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 read_fleet_status( - self, - name: Annotated[StrictStr, Field(description="name of the Fleet")], - _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, - ) -> Fleet: - """read_fleet_status - - read status of the specified Fleet - - :param name: name of the Fleet (required) - :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._read_fleet_status_serialize( - name=name, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "Fleet", - '401': "Error", - '404': "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 read_fleet_status_with_http_info( - self, - name: Annotated[StrictStr, Field(description="name of the Fleet")], - _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[Fleet]: - """read_fleet_status - - read status of the specified Fleet - - :param name: name of the Fleet (required) - :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._read_fleet_status_serialize( - name=name, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "Fleet", - '401': "Error", - '404': "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 read_fleet_status_without_preload_content( - self, - name: Annotated[StrictStr, Field(description="name of the Fleet")], - _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: - """read_fleet_status - - read status of the specified Fleet - - :param name: name of the Fleet (required) - :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._read_fleet_status_serialize( - name=name, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "Fleet", - '401': "Error", - '404': "Error", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _read_fleet_status_serialize( - self, - 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 - if name is not None: - _path_params['name'] = name - # 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( - [ - 'application/json' - ] - ) - - - # authentication setting - _auth_settings: List[str] = [ - ] - - return self.api_client.param_serialize( - method='GET', - resource_path='/api/v1/fleets/{name}/status', - 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 replace_fleet( - self, - name: Annotated[StrictStr, Field(description="name of the Fleet")], - fleet: Fleet, - _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, - ) -> Fleet: - """replace_fleet - - replace the specified Fleet - - :param name: name of the Fleet (required) - :type name: str - :param fleet: (required) - :type fleet: Fleet - :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._replace_fleet_serialize( - name=name, - fleet=fleet, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "Fleet", - '201': "Fleet", - '400': "Error", - '401': "Error", - '404': "Error", - '409': "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 replace_fleet_with_http_info( - self, - name: Annotated[StrictStr, Field(description="name of the Fleet")], - fleet: Fleet, - _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[Fleet]: - """replace_fleet - - replace the specified Fleet - - :param name: name of the Fleet (required) - :type name: str - :param fleet: (required) - :type fleet: Fleet - :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._replace_fleet_serialize( - name=name, - fleet=fleet, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "Fleet", - '201': "Fleet", - '400': "Error", - '401': "Error", - '404': "Error", - '409': "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 replace_fleet_without_preload_content( - self, - name: Annotated[StrictStr, Field(description="name of the Fleet")], - fleet: Fleet, - _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: - """replace_fleet - - replace the specified Fleet - - :param name: name of the Fleet (required) - :type name: str - :param fleet: (required) - :type fleet: Fleet - :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._replace_fleet_serialize( - name=name, - fleet=fleet, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "Fleet", - '201': "Fleet", - '400': "Error", - '401': "Error", - '404': "Error", - '409': "Error", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _replace_fleet_serialize( - self, - name, - fleet, - _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 name is not None: - _path_params['name'] = name - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if fleet is not None: - _body_params = fleet - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) - - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - ] - - return self.api_client.param_serialize( - method='PUT', - resource_path='/api/v1/fleets/{name}', - 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 replace_fleet_status( - self, - name: Annotated[StrictStr, Field(description="name of the Fleet")], - fleet: Fleet, - _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, - ) -> Fleet: - """replace_fleet_status - - replace status of the specified Fleet - - :param name: name of the Fleet (required) - :type name: str - :param fleet: (required) - :type fleet: Fleet - :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._replace_fleet_status_serialize( - name=name, - fleet=fleet, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "Fleet", - '401': "Error", - '404': "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 replace_fleet_status_with_http_info( - self, - name: Annotated[StrictStr, Field(description="name of the Fleet")], - fleet: Fleet, - _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[Fleet]: - """replace_fleet_status - - replace status of the specified Fleet - - :param name: name of the Fleet (required) - :type name: str - :param fleet: (required) - :type fleet: Fleet - :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._replace_fleet_status_serialize( - name=name, - fleet=fleet, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "Fleet", - '401': "Error", - '404': "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 replace_fleet_status_without_preload_content( - self, - name: Annotated[StrictStr, Field(description="name of the Fleet")], - fleet: Fleet, - _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: - """replace_fleet_status - - replace status of the specified Fleet - - :param name: name of the Fleet (required) - :type name: str - :param fleet: (required) - :type fleet: Fleet - :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._replace_fleet_status_serialize( - name=name, - fleet=fleet, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "Fleet", - '401': "Error", - '404': "Error", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _replace_fleet_status_serialize( - self, - name, - fleet, - _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 name is not None: - _path_params['name'] = name - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if fleet is not None: - _body_params = fleet - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) - - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - ] - - return self.api_client.param_serialize( - method='PUT', - resource_path='/api/v1/fleets/{name}/status', - 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/openapi_client/api/repository_api.py b/openapi_client/api/repository_api.py deleted file mode 100644 index 42cea12..0000000 --- a/openapi_client/api/repository_api.py +++ /dev/null @@ -1,2062 +0,0 @@ -# coding: utf-8 - -""" - Open Device Management API - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: undefined - 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, StrictInt, StrictStr -from typing import List, Optional -from typing_extensions import Annotated -from openapi_client.models.patch_request_inner import PatchRequestInner -from openapi_client.models.repository import Repository -from openapi_client.models.repository_list import RepositoryList -from openapi_client.models.sort_order import SortOrder -from openapi_client.models.status import Status - -from openapi_client.api_client import ApiClient, RequestSerialized -from openapi_client.api_response import ApiResponse -from openapi_client.rest import RESTResponseType - - -class RepositoryApi: - """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_repository( - self, - repository: Repository, - _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, - ) -> Repository: - """create_repository - - create a repository - - :param repository: (required) - :type repository: Repository - :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_repository_serialize( - repository=repository, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '201': "Repository", - '400': "Error", - '401': "Error", - '409': "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_repository_with_http_info( - self, - repository: Repository, - _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[Repository]: - """create_repository - - create a repository - - :param repository: (required) - :type repository: Repository - :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_repository_serialize( - repository=repository, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '201': "Repository", - '400': "Error", - '401': "Error", - '409': "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_repository_without_preload_content( - self, - repository: Repository, - _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_repository - - create a repository - - :param repository: (required) - :type repository: Repository - :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_repository_serialize( - repository=repository, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '201': "Repository", - '400': "Error", - '401': "Error", - '409': "Error", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _create_repository_serialize( - self, - repository, - _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 repository is not None: - _body_params = repository - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) - - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/api/v1/repositories', - 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_repositories( - self, - _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, - ) -> Status: - """delete_repositories - - delete a collection of Repositories - - :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_repositories_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "Status", - '401': "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_repositories_with_http_info( - self, - _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[Status]: - """delete_repositories - - delete a collection of Repositories - - :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_repositories_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "Status", - '401': "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_repositories_without_preload_content( - self, - _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_repositories - - delete a collection of Repositories - - :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_repositories_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "Status", - '401': "Error", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _delete_repositories_serialize( - self, - _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 - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) - - - # authentication setting - _auth_settings: List[str] = [ - ] - - return self.api_client.param_serialize( - method='DELETE', - resource_path='/api/v1/repositories', - 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_repository( - self, - name: Annotated[StrictStr, Field(description="name of the repository")], - _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, - ) -> Repository: - """delete_repository - - delete a repository - - :param name: name of the repository (required) - :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._delete_repository_serialize( - name=name, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "Repository", - '401': "Error", - '404': "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_repository_with_http_info( - self, - name: Annotated[StrictStr, Field(description="name of the repository")], - _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[Repository]: - """delete_repository - - delete a repository - - :param name: name of the repository (required) - :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._delete_repository_serialize( - name=name, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "Repository", - '401': "Error", - '404': "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_repository_without_preload_content( - self, - name: Annotated[StrictStr, Field(description="name of the repository")], - _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_repository - - delete a repository - - :param name: name of the repository (required) - :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._delete_repository_serialize( - name=name, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "Repository", - '401': "Error", - '404': "Error", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _delete_repository_serialize( - self, - 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 - if name is not None: - _path_params['name'] = name - # 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( - [ - 'application/json' - ] - ) - - - # authentication setting - _auth_settings: List[str] = [ - ] - - return self.api_client.param_serialize( - method='DELETE', - resource_path='/api/v1/repositories/{name}', - 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_repositories( - self, - var_continue: Annotated[Optional[StrictStr], Field(description="An optional parameter to query more results from the server. The value of the paramter must match the value of the 'continue' field in the previous list response.")] = None, - label_selector: Annotated[Optional[StrictStr], Field(description="A selector to restrict the list of returned objects by their labels. Defaults to everything.")] = None, - field_selector: Annotated[Optional[StrictStr], Field(description="A selector to restrict the list of returned objects by their fields, supports '=', '==', and '!='.(e.g. key1=value1,key2!=value2).")] = None, - limit: Annotated[Optional[StrictInt], Field(description="The maximum number of results returned in the list response. The server will set the 'continue' field in the list response if more results exist. The continue value may then be specified as parameter in a subsequent query.")] = None, - sort_by: Annotated[Optional[StrictStr], Field(description="Specifies the field to sort by.")] = None, - sort_order: Annotated[Optional[SortOrder], Field(description="Specifies the sort 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, - ) -> RepositoryList: - """list_repositories - - list repositories - - :param var_continue: An optional parameter to query more results from the server. The value of the paramter must match the value of the 'continue' field in the previous list response. - :type var_continue: str - :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. - :type label_selector: str - :param field_selector: A selector to restrict the list of returned objects by their fields, supports '=', '==', and '!='.(e.g. key1=value1,key2!=value2). - :type field_selector: str - :param limit: The maximum number of results returned in the list response. The server will set the 'continue' field in the list response if more results exist. The continue value may then be specified as parameter in a subsequent query. - :type limit: int - :param sort_by: Specifies the field to sort by. - :type sort_by: str - :param sort_order: Specifies the sort order. - :type sort_order: SortOrder - :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_repositories_serialize( - var_continue=var_continue, - label_selector=label_selector, - field_selector=field_selector, - limit=limit, - sort_by=sort_by, - sort_order=sort_order, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "RepositoryList", - '400': "Error", - '401': "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_repositories_with_http_info( - self, - var_continue: Annotated[Optional[StrictStr], Field(description="An optional parameter to query more results from the server. The value of the paramter must match the value of the 'continue' field in the previous list response.")] = None, - label_selector: Annotated[Optional[StrictStr], Field(description="A selector to restrict the list of returned objects by their labels. Defaults to everything.")] = None, - field_selector: Annotated[Optional[StrictStr], Field(description="A selector to restrict the list of returned objects by their fields, supports '=', '==', and '!='.(e.g. key1=value1,key2!=value2).")] = None, - limit: Annotated[Optional[StrictInt], Field(description="The maximum number of results returned in the list response. The server will set the 'continue' field in the list response if more results exist. The continue value may then be specified as parameter in a subsequent query.")] = None, - sort_by: Annotated[Optional[StrictStr], Field(description="Specifies the field to sort by.")] = None, - sort_order: Annotated[Optional[SortOrder], Field(description="Specifies the sort 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[RepositoryList]: - """list_repositories - - list repositories - - :param var_continue: An optional parameter to query more results from the server. The value of the paramter must match the value of the 'continue' field in the previous list response. - :type var_continue: str - :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. - :type label_selector: str - :param field_selector: A selector to restrict the list of returned objects by their fields, supports '=', '==', and '!='.(e.g. key1=value1,key2!=value2). - :type field_selector: str - :param limit: The maximum number of results returned in the list response. The server will set the 'continue' field in the list response if more results exist. The continue value may then be specified as parameter in a subsequent query. - :type limit: int - :param sort_by: Specifies the field to sort by. - :type sort_by: str - :param sort_order: Specifies the sort order. - :type sort_order: SortOrder - :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_repositories_serialize( - var_continue=var_continue, - label_selector=label_selector, - field_selector=field_selector, - limit=limit, - sort_by=sort_by, - sort_order=sort_order, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "RepositoryList", - '400': "Error", - '401': "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_repositories_without_preload_content( - self, - var_continue: Annotated[Optional[StrictStr], Field(description="An optional parameter to query more results from the server. The value of the paramter must match the value of the 'continue' field in the previous list response.")] = None, - label_selector: Annotated[Optional[StrictStr], Field(description="A selector to restrict the list of returned objects by their labels. Defaults to everything.")] = None, - field_selector: Annotated[Optional[StrictStr], Field(description="A selector to restrict the list of returned objects by their fields, supports '=', '==', and '!='.(e.g. key1=value1,key2!=value2).")] = None, - limit: Annotated[Optional[StrictInt], Field(description="The maximum number of results returned in the list response. The server will set the 'continue' field in the list response if more results exist. The continue value may then be specified as parameter in a subsequent query.")] = None, - sort_by: Annotated[Optional[StrictStr], Field(description="Specifies the field to sort by.")] = None, - sort_order: Annotated[Optional[SortOrder], Field(description="Specifies the sort 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_repositories - - list repositories - - :param var_continue: An optional parameter to query more results from the server. The value of the paramter must match the value of the 'continue' field in the previous list response. - :type var_continue: str - :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. - :type label_selector: str - :param field_selector: A selector to restrict the list of returned objects by their fields, supports '=', '==', and '!='.(e.g. key1=value1,key2!=value2). - :type field_selector: str - :param limit: The maximum number of results returned in the list response. The server will set the 'continue' field in the list response if more results exist. The continue value may then be specified as parameter in a subsequent query. - :type limit: int - :param sort_by: Specifies the field to sort by. - :type sort_by: str - :param sort_order: Specifies the sort order. - :type sort_order: SortOrder - :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_repositories_serialize( - var_continue=var_continue, - label_selector=label_selector, - field_selector=field_selector, - limit=limit, - sort_by=sort_by, - sort_order=sort_order, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "RepositoryList", - '400': "Error", - '401': "Error", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _list_repositories_serialize( - self, - var_continue, - label_selector, - field_selector, - limit, - sort_by, - sort_order, - _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 var_continue is not None: - - _query_params.append(('continue', var_continue)) - - if label_selector is not None: - - _query_params.append(('labelSelector', label_selector)) - - if field_selector is not None: - - _query_params.append(('fieldSelector', field_selector)) - - if limit is not None: - - _query_params.append(('limit', limit)) - - if sort_by is not None: - - _query_params.append(('sortBy', sort_by)) - - if sort_order is not None: - - _query_params.append(('sortOrder', sort_order.value)) - - # 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( - [ - 'application/json' - ] - ) - - - # authentication setting - _auth_settings: List[str] = [ - ] - - return self.api_client.param_serialize( - method='GET', - resource_path='/api/v1/repositories', - 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 patch_repository( - self, - name: Annotated[StrictStr, Field(description="name of the repository")], - patch_request_inner: Optional[List[PatchRequestInner]] = 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, - ) -> Repository: - """patch_repository - - Patches the specified repository - - :param name: name of the repository (required) - :type name: str - :param patch_request_inner: - :type patch_request_inner: List[PatchRequestInner] - :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._patch_repository_serialize( - name=name, - patch_request_inner=patch_request_inner, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "Repository", - '400': "Error", - '401': "Error", - '404': "Error", - '409': "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 patch_repository_with_http_info( - self, - name: Annotated[StrictStr, Field(description="name of the repository")], - patch_request_inner: Optional[List[PatchRequestInner]] = 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[Repository]: - """patch_repository - - Patches the specified repository - - :param name: name of the repository (required) - :type name: str - :param patch_request_inner: - :type patch_request_inner: List[PatchRequestInner] - :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._patch_repository_serialize( - name=name, - patch_request_inner=patch_request_inner, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "Repository", - '400': "Error", - '401': "Error", - '404': "Error", - '409': "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 patch_repository_without_preload_content( - self, - name: Annotated[StrictStr, Field(description="name of the repository")], - patch_request_inner: Optional[List[PatchRequestInner]] = 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: - """patch_repository - - Patches the specified repository - - :param name: name of the repository (required) - :type name: str - :param patch_request_inner: - :type patch_request_inner: List[PatchRequestInner] - :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._patch_repository_serialize( - name=name, - patch_request_inner=patch_request_inner, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "Repository", - '400': "Error", - '401': "Error", - '404': "Error", - '409': "Error", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _patch_repository_serialize( - self, - name, - patch_request_inner, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - 'PatchRequestInner': '', - } - - _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 name is not None: - _path_params['name'] = name - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if patch_request_inner is not None: - _body_params = patch_request_inner - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) - - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json-patch+json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - ] - - return self.api_client.param_serialize( - method='PATCH', - resource_path='/api/v1/repositories/{name}', - 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 read_repository( - self, - name: Annotated[StrictStr, Field(description="name of the repository")], - _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, - ) -> Repository: - """read_repository - - read the specified repository - - :param name: name of the repository (required) - :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._read_repository_serialize( - name=name, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "Repository", - '401': "Error", - '404': "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 read_repository_with_http_info( - self, - name: Annotated[StrictStr, Field(description="name of the repository")], - _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[Repository]: - """read_repository - - read the specified repository - - :param name: name of the repository (required) - :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._read_repository_serialize( - name=name, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "Repository", - '401': "Error", - '404': "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 read_repository_without_preload_content( - self, - name: Annotated[StrictStr, Field(description="name of the repository")], - _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: - """read_repository - - read the specified repository - - :param name: name of the repository (required) - :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._read_repository_serialize( - name=name, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "Repository", - '401': "Error", - '404': "Error", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _read_repository_serialize( - self, - 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 - if name is not None: - _path_params['name'] = name - # 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( - [ - 'application/json' - ] - ) - - - # authentication setting - _auth_settings: List[str] = [ - ] - - return self.api_client.param_serialize( - method='GET', - resource_path='/api/v1/repositories/{name}', - 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 replace_repository( - self, - name: Annotated[StrictStr, Field(description="name of the repository")], - repository: Repository, - _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, - ) -> Repository: - """replace_repository - - replace the specified repository - - :param name: name of the repository (required) - :type name: str - :param repository: (required) - :type repository: Repository - :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._replace_repository_serialize( - name=name, - repository=repository, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "Repository", - '201': "Repository", - '400': "Error", - '401': "Error", - '404': "Error", - '409': "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 replace_repository_with_http_info( - self, - name: Annotated[StrictStr, Field(description="name of the repository")], - repository: Repository, - _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[Repository]: - """replace_repository - - replace the specified repository - - :param name: name of the repository (required) - :type name: str - :param repository: (required) - :type repository: Repository - :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._replace_repository_serialize( - name=name, - repository=repository, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "Repository", - '201': "Repository", - '400': "Error", - '401': "Error", - '404': "Error", - '409': "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 replace_repository_without_preload_content( - self, - name: Annotated[StrictStr, Field(description="name of the repository")], - repository: Repository, - _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: - """replace_repository - - replace the specified repository - - :param name: name of the repository (required) - :type name: str - :param repository: (required) - :type repository: Repository - :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._replace_repository_serialize( - name=name, - repository=repository, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "Repository", - '201': "Repository", - '400': "Error", - '401': "Error", - '404': "Error", - '409': "Error", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _replace_repository_serialize( - self, - name, - repository, - _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 name is not None: - _path_params['name'] = name - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if repository is not None: - _body_params = repository - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) - - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - ] - - return self.api_client.param_serialize( - method='PUT', - resource_path='/api/v1/repositories/{name}', - 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/openapi_client/api/resourcesync_api.py b/openapi_client/api/resourcesync_api.py deleted file mode 100644 index 81bfe9a..0000000 --- a/openapi_client/api/resourcesync_api.py +++ /dev/null @@ -1,2079 +0,0 @@ -# coding: utf-8 - -""" - Open Device Management API - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: undefined - 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, StrictInt, StrictStr -from typing import List, Optional -from typing_extensions import Annotated -from openapi_client.models.patch_request_inner import PatchRequestInner -from openapi_client.models.resource_sync import ResourceSync -from openapi_client.models.resource_sync_list import ResourceSyncList -from openapi_client.models.sort_order import SortOrder -from openapi_client.models.status import Status - -from openapi_client.api_client import ApiClient, RequestSerialized -from openapi_client.api_response import ApiResponse -from openapi_client.rest import RESTResponseType - - -class ResourcesyncApi: - """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_resource_sync( - self, - resource_sync: ResourceSync, - _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, - ) -> ResourceSync: - """create_resource_sync - - create a resourcesync - - :param resource_sync: (required) - :type resource_sync: ResourceSync - :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_resource_sync_serialize( - resource_sync=resource_sync, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '201': "ResourceSync", - '400': "Error", - '401': "Error", - '409': "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_resource_sync_with_http_info( - self, - resource_sync: ResourceSync, - _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[ResourceSync]: - """create_resource_sync - - create a resourcesync - - :param resource_sync: (required) - :type resource_sync: ResourceSync - :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_resource_sync_serialize( - resource_sync=resource_sync, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '201': "ResourceSync", - '400': "Error", - '401': "Error", - '409': "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_resource_sync_without_preload_content( - self, - resource_sync: ResourceSync, - _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_resource_sync - - create a resourcesync - - :param resource_sync: (required) - :type resource_sync: ResourceSync - :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_resource_sync_serialize( - resource_sync=resource_sync, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '201': "ResourceSync", - '400': "Error", - '401': "Error", - '409': "Error", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _create_resource_sync_serialize( - self, - resource_sync, - _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 resource_sync is not None: - _body_params = resource_sync - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) - - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/api/v1/resourcesyncs', - 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_resource_sync( - self, - name: Annotated[StrictStr, Field(description="name of the resourcesync")], - _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, - ) -> ResourceSync: - """delete_resource_sync - - delete a resourcesync - - :param name: name of the resourcesync (required) - :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._delete_resource_sync_serialize( - name=name, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "ResourceSync", - '401': "Error", - '404': "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_resource_sync_with_http_info( - self, - name: Annotated[StrictStr, Field(description="name of the resourcesync")], - _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[ResourceSync]: - """delete_resource_sync - - delete a resourcesync - - :param name: name of the resourcesync (required) - :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._delete_resource_sync_serialize( - name=name, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "ResourceSync", - '401': "Error", - '404': "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_resource_sync_without_preload_content( - self, - name: Annotated[StrictStr, Field(description="name of the resourcesync")], - _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_resource_sync - - delete a resourcesync - - :param name: name of the resourcesync (required) - :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._delete_resource_sync_serialize( - name=name, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "ResourceSync", - '401': "Error", - '404': "Error", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _delete_resource_sync_serialize( - self, - 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 - if name is not None: - _path_params['name'] = name - # 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( - [ - 'application/json' - ] - ) - - - # authentication setting - _auth_settings: List[str] = [ - ] - - return self.api_client.param_serialize( - method='DELETE', - resource_path='/api/v1/resourcesyncs/{name}', - 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_resource_syncs( - self, - _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, - ) -> Status: - """delete_resource_syncs - - delete a collection of ResourceSync - - :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_resource_syncs_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "Status", - '401': "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_resource_syncs_with_http_info( - self, - _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[Status]: - """delete_resource_syncs - - delete a collection of ResourceSync - - :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_resource_syncs_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "Status", - '401': "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_resource_syncs_without_preload_content( - self, - _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_resource_syncs - - delete a collection of ResourceSync - - :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_resource_syncs_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "Status", - '401': "Error", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _delete_resource_syncs_serialize( - self, - _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 - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) - - - # authentication setting - _auth_settings: List[str] = [ - ] - - return self.api_client.param_serialize( - method='DELETE', - resource_path='/api/v1/resourcesyncs', - 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_resource_sync( - self, - var_continue: Annotated[Optional[StrictStr], Field(description="An optional parameter to query more results from the server. The value of the paramter must match the value of the 'continue' field in the previous list response.")] = None, - label_selector: Annotated[Optional[StrictStr], Field(description="A selector to restrict the list of returned objects by their labels. Defaults to everything.")] = None, - field_selector: Annotated[Optional[StrictStr], Field(description="A selector to restrict the list of returned objects by their fields, supporting operators like '=', '==', and '!=' (e.g., \"key1=value1,key2!=value2\"). For a full list of operators and examples, refer to the documentation.")] = None, - limit: Annotated[Optional[StrictInt], Field(description="The maximum number of results returned in the list response. The server will set the 'continue' field in the list response if more results exist. The continue value may then be specified as parameter in a subsequent query.")] = None, - repository: Annotated[Optional[StrictStr], Field(description="The name of the repository to filter results by.")] = None, - sort_by: Annotated[Optional[StrictStr], Field(description="Specifies the field to sort by.")] = None, - sort_order: Annotated[Optional[SortOrder], Field(description="Specifies the sort 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, - ) -> ResourceSyncList: - """list_resource_sync - - list resourcesync - - :param var_continue: An optional parameter to query more results from the server. The value of the paramter must match the value of the 'continue' field in the previous list response. - :type var_continue: str - :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. - :type label_selector: str - :param field_selector: A selector to restrict the list of returned objects by their fields, supporting operators like '=', '==', and '!=' (e.g., \"key1=value1,key2!=value2\"). For a full list of operators and examples, refer to the documentation. - :type field_selector: str - :param limit: The maximum number of results returned in the list response. The server will set the 'continue' field in the list response if more results exist. The continue value may then be specified as parameter in a subsequent query. - :type limit: int - :param repository: The name of the repository to filter results by. - :type repository: str - :param sort_by: Specifies the field to sort by. - :type sort_by: str - :param sort_order: Specifies the sort order. - :type sort_order: SortOrder - :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_resource_sync_serialize( - var_continue=var_continue, - label_selector=label_selector, - field_selector=field_selector, - limit=limit, - repository=repository, - sort_by=sort_by, - sort_order=sort_order, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "ResourceSyncList", - '400': "Error", - '401': "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_resource_sync_with_http_info( - self, - var_continue: Annotated[Optional[StrictStr], Field(description="An optional parameter to query more results from the server. The value of the paramter must match the value of the 'continue' field in the previous list response.")] = None, - label_selector: Annotated[Optional[StrictStr], Field(description="A selector to restrict the list of returned objects by their labels. Defaults to everything.")] = None, - field_selector: Annotated[Optional[StrictStr], Field(description="A selector to restrict the list of returned objects by their fields, supporting operators like '=', '==', and '!=' (e.g., \"key1=value1,key2!=value2\"). For a full list of operators and examples, refer to the documentation.")] = None, - limit: Annotated[Optional[StrictInt], Field(description="The maximum number of results returned in the list response. The server will set the 'continue' field in the list response if more results exist. The continue value may then be specified as parameter in a subsequent query.")] = None, - repository: Annotated[Optional[StrictStr], Field(description="The name of the repository to filter results by.")] = None, - sort_by: Annotated[Optional[StrictStr], Field(description="Specifies the field to sort by.")] = None, - sort_order: Annotated[Optional[SortOrder], Field(description="Specifies the sort 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[ResourceSyncList]: - """list_resource_sync - - list resourcesync - - :param var_continue: An optional parameter to query more results from the server. The value of the paramter must match the value of the 'continue' field in the previous list response. - :type var_continue: str - :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. - :type label_selector: str - :param field_selector: A selector to restrict the list of returned objects by their fields, supporting operators like '=', '==', and '!=' (e.g., \"key1=value1,key2!=value2\"). For a full list of operators and examples, refer to the documentation. - :type field_selector: str - :param limit: The maximum number of results returned in the list response. The server will set the 'continue' field in the list response if more results exist. The continue value may then be specified as parameter in a subsequent query. - :type limit: int - :param repository: The name of the repository to filter results by. - :type repository: str - :param sort_by: Specifies the field to sort by. - :type sort_by: str - :param sort_order: Specifies the sort order. - :type sort_order: SortOrder - :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_resource_sync_serialize( - var_continue=var_continue, - label_selector=label_selector, - field_selector=field_selector, - limit=limit, - repository=repository, - sort_by=sort_by, - sort_order=sort_order, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "ResourceSyncList", - '400': "Error", - '401': "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_resource_sync_without_preload_content( - self, - var_continue: Annotated[Optional[StrictStr], Field(description="An optional parameter to query more results from the server. The value of the paramter must match the value of the 'continue' field in the previous list response.")] = None, - label_selector: Annotated[Optional[StrictStr], Field(description="A selector to restrict the list of returned objects by their labels. Defaults to everything.")] = None, - field_selector: Annotated[Optional[StrictStr], Field(description="A selector to restrict the list of returned objects by their fields, supporting operators like '=', '==', and '!=' (e.g., \"key1=value1,key2!=value2\"). For a full list of operators and examples, refer to the documentation.")] = None, - limit: Annotated[Optional[StrictInt], Field(description="The maximum number of results returned in the list response. The server will set the 'continue' field in the list response if more results exist. The continue value may then be specified as parameter in a subsequent query.")] = None, - repository: Annotated[Optional[StrictStr], Field(description="The name of the repository to filter results by.")] = None, - sort_by: Annotated[Optional[StrictStr], Field(description="Specifies the field to sort by.")] = None, - sort_order: Annotated[Optional[SortOrder], Field(description="Specifies the sort 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_resource_sync - - list resourcesync - - :param var_continue: An optional parameter to query more results from the server. The value of the paramter must match the value of the 'continue' field in the previous list response. - :type var_continue: str - :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. - :type label_selector: str - :param field_selector: A selector to restrict the list of returned objects by their fields, supporting operators like '=', '==', and '!=' (e.g., \"key1=value1,key2!=value2\"). For a full list of operators and examples, refer to the documentation. - :type field_selector: str - :param limit: The maximum number of results returned in the list response. The server will set the 'continue' field in the list response if more results exist. The continue value may then be specified as parameter in a subsequent query. - :type limit: int - :param repository: The name of the repository to filter results by. - :type repository: str - :param sort_by: Specifies the field to sort by. - :type sort_by: str - :param sort_order: Specifies the sort order. - :type sort_order: SortOrder - :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_resource_sync_serialize( - var_continue=var_continue, - label_selector=label_selector, - field_selector=field_selector, - limit=limit, - repository=repository, - sort_by=sort_by, - sort_order=sort_order, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "ResourceSyncList", - '400': "Error", - '401': "Error", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _list_resource_sync_serialize( - self, - var_continue, - label_selector, - field_selector, - limit, - repository, - sort_by, - sort_order, - _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 var_continue is not None: - - _query_params.append(('continue', var_continue)) - - if label_selector is not None: - - _query_params.append(('labelSelector', label_selector)) - - if field_selector is not None: - - _query_params.append(('fieldSelector', field_selector)) - - if limit is not None: - - _query_params.append(('limit', limit)) - - if repository is not None: - - _query_params.append(('repository', repository)) - - if sort_by is not None: - - _query_params.append(('sortBy', sort_by)) - - if sort_order is not None: - - _query_params.append(('sortOrder', sort_order.value)) - - # 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( - [ - 'application/json' - ] - ) - - - # authentication setting - _auth_settings: List[str] = [ - ] - - return self.api_client.param_serialize( - method='GET', - resource_path='/api/v1/resourcesyncs', - 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 patch_resource_sync( - self, - name: Annotated[StrictStr, Field(description="name of the resourcesync")], - patch_request_inner: Optional[List[PatchRequestInner]] = 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, - ) -> ResourceSync: - """patch_resource_sync - - Patches the specified resourcesync - - :param name: name of the resourcesync (required) - :type name: str - :param patch_request_inner: - :type patch_request_inner: List[PatchRequestInner] - :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._patch_resource_sync_serialize( - name=name, - patch_request_inner=patch_request_inner, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "ResourceSync", - '400': "Error", - '401': "Error", - '404': "Error", - '409': "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 patch_resource_sync_with_http_info( - self, - name: Annotated[StrictStr, Field(description="name of the resourcesync")], - patch_request_inner: Optional[List[PatchRequestInner]] = 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[ResourceSync]: - """patch_resource_sync - - Patches the specified resourcesync - - :param name: name of the resourcesync (required) - :type name: str - :param patch_request_inner: - :type patch_request_inner: List[PatchRequestInner] - :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._patch_resource_sync_serialize( - name=name, - patch_request_inner=patch_request_inner, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "ResourceSync", - '400': "Error", - '401': "Error", - '404': "Error", - '409': "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 patch_resource_sync_without_preload_content( - self, - name: Annotated[StrictStr, Field(description="name of the resourcesync")], - patch_request_inner: Optional[List[PatchRequestInner]] = 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: - """patch_resource_sync - - Patches the specified resourcesync - - :param name: name of the resourcesync (required) - :type name: str - :param patch_request_inner: - :type patch_request_inner: List[PatchRequestInner] - :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._patch_resource_sync_serialize( - name=name, - patch_request_inner=patch_request_inner, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "ResourceSync", - '400': "Error", - '401': "Error", - '404': "Error", - '409': "Error", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _patch_resource_sync_serialize( - self, - name, - patch_request_inner, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - 'PatchRequestInner': '', - } - - _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 name is not None: - _path_params['name'] = name - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if patch_request_inner is not None: - _body_params = patch_request_inner - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) - - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json-patch+json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - ] - - return self.api_client.param_serialize( - method='PATCH', - resource_path='/api/v1/resourcesyncs/{name}', - 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 read_resource_sync( - self, - name: Annotated[StrictStr, Field(description="name of the resourcesync")], - _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, - ) -> ResourceSync: - """read_resource_sync - - read the specified resourcesync - - :param name: name of the resourcesync (required) - :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._read_resource_sync_serialize( - name=name, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "ResourceSync", - '401': "Error", - '404': "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 read_resource_sync_with_http_info( - self, - name: Annotated[StrictStr, Field(description="name of the resourcesync")], - _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[ResourceSync]: - """read_resource_sync - - read the specified resourcesync - - :param name: name of the resourcesync (required) - :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._read_resource_sync_serialize( - name=name, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "ResourceSync", - '401': "Error", - '404': "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 read_resource_sync_without_preload_content( - self, - name: Annotated[StrictStr, Field(description="name of the resourcesync")], - _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: - """read_resource_sync - - read the specified resourcesync - - :param name: name of the resourcesync (required) - :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._read_resource_sync_serialize( - name=name, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "ResourceSync", - '401': "Error", - '404': "Error", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _read_resource_sync_serialize( - self, - 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 - if name is not None: - _path_params['name'] = name - # 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( - [ - 'application/json' - ] - ) - - - # authentication setting - _auth_settings: List[str] = [ - ] - - return self.api_client.param_serialize( - method='GET', - resource_path='/api/v1/resourcesyncs/{name}', - 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 replace_resource_sync( - self, - name: Annotated[StrictStr, Field(description="name of the resourcesync")], - resource_sync: ResourceSync, - _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, - ) -> ResourceSync: - """replace_resource_sync - - replace the specified resourcesync - - :param name: name of the resourcesync (required) - :type name: str - :param resource_sync: (required) - :type resource_sync: ResourceSync - :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._replace_resource_sync_serialize( - name=name, - resource_sync=resource_sync, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "ResourceSync", - '201': "ResourceSync", - '400': "Error", - '401': "Error", - '404': "Error", - '409': "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 replace_resource_sync_with_http_info( - self, - name: Annotated[StrictStr, Field(description="name of the resourcesync")], - resource_sync: ResourceSync, - _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[ResourceSync]: - """replace_resource_sync - - replace the specified resourcesync - - :param name: name of the resourcesync (required) - :type name: str - :param resource_sync: (required) - :type resource_sync: ResourceSync - :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._replace_resource_sync_serialize( - name=name, - resource_sync=resource_sync, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "ResourceSync", - '201': "ResourceSync", - '400': "Error", - '401': "Error", - '404': "Error", - '409': "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 replace_resource_sync_without_preload_content( - self, - name: Annotated[StrictStr, Field(description="name of the resourcesync")], - resource_sync: ResourceSync, - _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: - """replace_resource_sync - - replace the specified resourcesync - - :param name: name of the resourcesync (required) - :type name: str - :param resource_sync: (required) - :type resource_sync: ResourceSync - :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._replace_resource_sync_serialize( - name=name, - resource_sync=resource_sync, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "ResourceSync", - '201': "ResourceSync", - '400': "Error", - '401': "Error", - '404': "Error", - '409': "Error", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _replace_resource_sync_serialize( - self, - name, - resource_sync, - _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 name is not None: - _path_params['name'] = name - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if resource_sync is not None: - _body_params = resource_sync - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) - - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - ] - - return self.api_client.param_serialize( - method='PUT', - resource_path='/api/v1/resourcesyncs/{name}', - 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/openapi_client/api/templateversion_api.py b/openapi_client/api/templateversion_api.py deleted file mode 100644 index bb1a732..0000000 --- a/openapi_client/api/templateversion_api.py +++ /dev/null @@ -1,1235 +0,0 @@ -# coding: utf-8 - -""" - Open Device Management API - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: undefined - 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, StrictInt, StrictStr -from typing import Optional -from typing_extensions import Annotated -from openapi_client.models.sort_order import SortOrder -from openapi_client.models.status import Status -from openapi_client.models.template_version import TemplateVersion -from openapi_client.models.template_version_list import TemplateVersionList - -from openapi_client.api_client import ApiClient, RequestSerialized -from openapi_client.api_response import ApiResponse -from openapi_client.rest import RESTResponseType - - -class TemplateversionApi: - """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 delete_template_version( - self, - fleet: Annotated[StrictStr, Field(description="The owner of the template version.")], - name: Annotated[StrictStr, Field(description="name of the template version.")], - _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, - ) -> TemplateVersion: - """delete_template_version - - delete a template version - - :param fleet: The owner of the template version. (required) - :type fleet: str - :param name: name of the template version. (required) - :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._delete_template_version_serialize( - fleet=fleet, - name=name, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "TemplateVersion", - '401': "Error", - '404': "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_template_version_with_http_info( - self, - fleet: Annotated[StrictStr, Field(description="The owner of the template version.")], - name: Annotated[StrictStr, Field(description="name of the template version.")], - _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[TemplateVersion]: - """delete_template_version - - delete a template version - - :param fleet: The owner of the template version. (required) - :type fleet: str - :param name: name of the template version. (required) - :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._delete_template_version_serialize( - fleet=fleet, - name=name, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "TemplateVersion", - '401': "Error", - '404': "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_template_version_without_preload_content( - self, - fleet: Annotated[StrictStr, Field(description="The owner of the template version.")], - name: Annotated[StrictStr, Field(description="name of the template version.")], - _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_template_version - - delete a template version - - :param fleet: The owner of the template version. (required) - :type fleet: str - :param name: name of the template version. (required) - :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._delete_template_version_serialize( - fleet=fleet, - name=name, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "TemplateVersion", - '401': "Error", - '404': "Error", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _delete_template_version_serialize( - self, - fleet, - 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 - if fleet is not None: - _path_params['fleet'] = fleet - if name is not None: - _path_params['name'] = name - # 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( - [ - 'application/json' - ] - ) - - - # authentication setting - _auth_settings: List[str] = [ - ] - - return self.api_client.param_serialize( - method='DELETE', - resource_path='/api/v1/fleets/{fleet}/templateversions/{name}', - 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_template_versions( - self, - fleet: Annotated[StrictStr, Field(description="The owner of the template versions.")], - _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, - ) -> Status: - """delete_template_versions - - delete a collection of template versions - - :param fleet: The owner of the template versions. (required) - :type fleet: 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_template_versions_serialize( - fleet=fleet, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "Status", - '401': "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_template_versions_with_http_info( - self, - fleet: Annotated[StrictStr, Field(description="The owner of the template versions.")], - _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[Status]: - """delete_template_versions - - delete a collection of template versions - - :param fleet: The owner of the template versions. (required) - :type fleet: 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_template_versions_serialize( - fleet=fleet, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "Status", - '401': "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_template_versions_without_preload_content( - self, - fleet: Annotated[StrictStr, Field(description="The owner of the template versions.")], - _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_template_versions - - delete a collection of template versions - - :param fleet: The owner of the template versions. (required) - :type fleet: 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_template_versions_serialize( - fleet=fleet, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "Status", - '401': "Error", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _delete_template_versions_serialize( - self, - fleet, - _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 fleet is not None: - _path_params['fleet'] = fleet - # 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( - [ - 'application/json' - ] - ) - - - # authentication setting - _auth_settings: List[str] = [ - ] - - return self.api_client.param_serialize( - method='DELETE', - resource_path='/api/v1/fleets/{fleet}/templateversions', - 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_template_versions( - self, - fleet: Annotated[StrictStr, Field(description="The owner of the template versions.")], - var_continue: Annotated[Optional[StrictStr], Field(description="An optional parameter to query more results from the server. The value of the paramter must match the value of the 'continue' field in the previous list response.")] = None, - label_selector: Annotated[Optional[StrictStr], Field(description="A selector to restrict the list of returned objects by their labels. Defaults to everything.")] = None, - field_selector: Annotated[Optional[StrictStr], Field(description="A selector to restrict the list of returned objects by their fields, supports '=', '==', and '!='.(e.g. key1=value1,key2!=value2).")] = None, - limit: Annotated[Optional[StrictInt], Field(description="The maximum number of results returned in the list response. The server will set the 'continue' field in the list response if more results exist. The continue value may then be specified as parameter in a subsequent query.")] = None, - sort_by: Annotated[Optional[StrictStr], Field(description="Specifies the field to sort by.")] = None, - sort_order: Annotated[Optional[SortOrder], Field(description="Specifies the sort 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, - ) -> TemplateVersionList: - """list_template_versions - - list template versions - - :param fleet: The owner of the template versions. (required) - :type fleet: str - :param var_continue: An optional parameter to query more results from the server. The value of the paramter must match the value of the 'continue' field in the previous list response. - :type var_continue: str - :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. - :type label_selector: str - :param field_selector: A selector to restrict the list of returned objects by their fields, supports '=', '==', and '!='.(e.g. key1=value1,key2!=value2). - :type field_selector: str - :param limit: The maximum number of results returned in the list response. The server will set the 'continue' field in the list response if more results exist. The continue value may then be specified as parameter in a subsequent query. - :type limit: int - :param sort_by: Specifies the field to sort by. - :type sort_by: str - :param sort_order: Specifies the sort order. - :type sort_order: SortOrder - :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_template_versions_serialize( - fleet=fleet, - var_continue=var_continue, - label_selector=label_selector, - field_selector=field_selector, - limit=limit, - sort_by=sort_by, - sort_order=sort_order, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "TemplateVersionList", - '400': "Error", - '401': "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_template_versions_with_http_info( - self, - fleet: Annotated[StrictStr, Field(description="The owner of the template versions.")], - var_continue: Annotated[Optional[StrictStr], Field(description="An optional parameter to query more results from the server. The value of the paramter must match the value of the 'continue' field in the previous list response.")] = None, - label_selector: Annotated[Optional[StrictStr], Field(description="A selector to restrict the list of returned objects by their labels. Defaults to everything.")] = None, - field_selector: Annotated[Optional[StrictStr], Field(description="A selector to restrict the list of returned objects by their fields, supports '=', '==', and '!='.(e.g. key1=value1,key2!=value2).")] = None, - limit: Annotated[Optional[StrictInt], Field(description="The maximum number of results returned in the list response. The server will set the 'continue' field in the list response if more results exist. The continue value may then be specified as parameter in a subsequent query.")] = None, - sort_by: Annotated[Optional[StrictStr], Field(description="Specifies the field to sort by.")] = None, - sort_order: Annotated[Optional[SortOrder], Field(description="Specifies the sort 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[TemplateVersionList]: - """list_template_versions - - list template versions - - :param fleet: The owner of the template versions. (required) - :type fleet: str - :param var_continue: An optional parameter to query more results from the server. The value of the paramter must match the value of the 'continue' field in the previous list response. - :type var_continue: str - :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. - :type label_selector: str - :param field_selector: A selector to restrict the list of returned objects by their fields, supports '=', '==', and '!='.(e.g. key1=value1,key2!=value2). - :type field_selector: str - :param limit: The maximum number of results returned in the list response. The server will set the 'continue' field in the list response if more results exist. The continue value may then be specified as parameter in a subsequent query. - :type limit: int - :param sort_by: Specifies the field to sort by. - :type sort_by: str - :param sort_order: Specifies the sort order. - :type sort_order: SortOrder - :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_template_versions_serialize( - fleet=fleet, - var_continue=var_continue, - label_selector=label_selector, - field_selector=field_selector, - limit=limit, - sort_by=sort_by, - sort_order=sort_order, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "TemplateVersionList", - '400': "Error", - '401': "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_template_versions_without_preload_content( - self, - fleet: Annotated[StrictStr, Field(description="The owner of the template versions.")], - var_continue: Annotated[Optional[StrictStr], Field(description="An optional parameter to query more results from the server. The value of the paramter must match the value of the 'continue' field in the previous list response.")] = None, - label_selector: Annotated[Optional[StrictStr], Field(description="A selector to restrict the list of returned objects by their labels. Defaults to everything.")] = None, - field_selector: Annotated[Optional[StrictStr], Field(description="A selector to restrict the list of returned objects by their fields, supports '=', '==', and '!='.(e.g. key1=value1,key2!=value2).")] = None, - limit: Annotated[Optional[StrictInt], Field(description="The maximum number of results returned in the list response. The server will set the 'continue' field in the list response if more results exist. The continue value may then be specified as parameter in a subsequent query.")] = None, - sort_by: Annotated[Optional[StrictStr], Field(description="Specifies the field to sort by.")] = None, - sort_order: Annotated[Optional[SortOrder], Field(description="Specifies the sort 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_template_versions - - list template versions - - :param fleet: The owner of the template versions. (required) - :type fleet: str - :param var_continue: An optional parameter to query more results from the server. The value of the paramter must match the value of the 'continue' field in the previous list response. - :type var_continue: str - :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. - :type label_selector: str - :param field_selector: A selector to restrict the list of returned objects by their fields, supports '=', '==', and '!='.(e.g. key1=value1,key2!=value2). - :type field_selector: str - :param limit: The maximum number of results returned in the list response. The server will set the 'continue' field in the list response if more results exist. The continue value may then be specified as parameter in a subsequent query. - :type limit: int - :param sort_by: Specifies the field to sort by. - :type sort_by: str - :param sort_order: Specifies the sort order. - :type sort_order: SortOrder - :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_template_versions_serialize( - fleet=fleet, - var_continue=var_continue, - label_selector=label_selector, - field_selector=field_selector, - limit=limit, - sort_by=sort_by, - sort_order=sort_order, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "TemplateVersionList", - '400': "Error", - '401': "Error", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _list_template_versions_serialize( - self, - fleet, - var_continue, - label_selector, - field_selector, - limit, - sort_by, - sort_order, - _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 fleet is not None: - _path_params['fleet'] = fleet - # process the query parameters - if var_continue is not None: - - _query_params.append(('continue', var_continue)) - - if label_selector is not None: - - _query_params.append(('labelSelector', label_selector)) - - if field_selector is not None: - - _query_params.append(('fieldSelector', field_selector)) - - if limit is not None: - - _query_params.append(('limit', limit)) - - if sort_by is not None: - - _query_params.append(('sortBy', sort_by)) - - if sort_order is not None: - - _query_params.append(('sortOrder', sort_order.value)) - - # 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( - [ - 'application/json' - ] - ) - - - # authentication setting - _auth_settings: List[str] = [ - ] - - return self.api_client.param_serialize( - method='GET', - resource_path='/api/v1/fleets/{fleet}/templateversions', - 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 read_template_version( - self, - fleet: Annotated[StrictStr, Field(description="The owner of the template version.")], - name: Annotated[StrictStr, Field(description="Name of the template version.")], - _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, - ) -> TemplateVersion: - """read_template_version - - read the specified template version - - :param fleet: The owner of the template version. (required) - :type fleet: str - :param name: Name of the template version. (required) - :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._read_template_version_serialize( - fleet=fleet, - name=name, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "TemplateVersion", - '401': "Error", - '404': "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 read_template_version_with_http_info( - self, - fleet: Annotated[StrictStr, Field(description="The owner of the template version.")], - name: Annotated[StrictStr, Field(description="Name of the template version.")], - _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[TemplateVersion]: - """read_template_version - - read the specified template version - - :param fleet: The owner of the template version. (required) - :type fleet: str - :param name: Name of the template version. (required) - :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._read_template_version_serialize( - fleet=fleet, - name=name, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "TemplateVersion", - '401': "Error", - '404': "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 read_template_version_without_preload_content( - self, - fleet: Annotated[StrictStr, Field(description="The owner of the template version.")], - name: Annotated[StrictStr, Field(description="Name of the template version.")], - _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: - """read_template_version - - read the specified template version - - :param fleet: The owner of the template version. (required) - :type fleet: str - :param name: Name of the template version. (required) - :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._read_template_version_serialize( - fleet=fleet, - name=name, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "TemplateVersion", - '401': "Error", - '404': "Error", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _read_template_version_serialize( - self, - fleet, - 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 - if fleet is not None: - _path_params['fleet'] = fleet - if name is not None: - _path_params['name'] = name - # 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( - [ - 'application/json' - ] - ) - - - # authentication setting - _auth_settings: List[str] = [ - ] - - return self.api_client.param_serialize( - method='GET', - resource_path='/api/v1/fleets/{fleet}/templateversions/{name}', - 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/openapi_client/api_client.py b/openapi_client/api_client.py deleted file mode 100644 index 46d19b8..0000000 --- a/openapi_client/api_client.py +++ /dev/null @@ -1,797 +0,0 @@ -# coding: utf-8 - -""" - Open Device Management API - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: undefined - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import datetime -from dateutil.parser import parse -from enum import Enum -import decimal -import json -import mimetypes -import os -import re -import tempfile - -from urllib.parse import quote -from typing import Tuple, Optional, List, Dict, Union -from pydantic import SecretStr - -from openapi_client.configuration import Configuration -from openapi_client.api_response import ApiResponse, T as ApiResponseT -import openapi_client.models -from openapi_client import rest -from openapi_client.exceptions import ( - ApiValueError, - ApiException, - BadRequestException, - UnauthorizedException, - ForbiddenException, - NotFoundException, - ServiceException -) - -RequestSerialized = Tuple[str, str, Dict[str, str], Optional[str], List[str]] - -class ApiClient: - """Generic API client for OpenAPI client library builds. - - OpenAPI generic API client. This client handles the client- - server communication, and is invariant across implementations. Specifics of - the methods and models for each application are generated from the OpenAPI - templates. - - :param configuration: .Configuration object for this client - :param header_name: a header to pass when making calls to the API. - :param header_value: a header value to pass when making calls to - the API. - :param cookie: a cookie to include in the header when making calls - to the API - """ - - 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, - } - _pool = None - - def __init__( - self, - configuration=None, - header_name=None, - header_value=None, - cookie=None - ) -> None: - # use default configuration if none is provided - if configuration is None: - configuration = Configuration.get_default() - self.configuration = configuration - - self.rest_client = rest.RESTClientObject(configuration) - self.default_headers = {} - if header_name is not None: - self.default_headers[header_name] = header_value - self.cookie = cookie - # Set default User-Agent. - self.user_agent = 'OpenAPI-Generator/1.0.0/python' - self.client_side_validation = configuration.client_side_validation - - def __enter__(self): - return self - - def __exit__(self, exc_type, exc_value, traceback): - pass - - @property - def user_agent(self): - """User agent for this API client""" - return self.default_headers['User-Agent'] - - @user_agent.setter - def user_agent(self, 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 - def get_default(cls): - """Return new instance of ApiClient. - - This method returns newly created, based on default constructor, - object of ApiClient class or returns a copy of default - ApiClient. - - :return: The ApiClient object. - """ - if cls._default is None: - cls._default = ApiClient() - return cls._default - - @classmethod - def set_default(cls, default): - """Set default instance of ApiClient. - - It stores default ApiClient. - - :param default: object of ApiClient. - """ - cls._default = default - - def param_serialize( - self, - method, - resource_path, - path_params=None, - query_params=None, - header_params=None, - body=None, - post_params=None, - files=None, auth_settings=None, - collection_formats=None, - _host=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. - :param path_params: Path parameters in the url. - :param query_params: Query parameters in the url. - :param header_params: Header parameters to be - placed in the request header. - :param body: Request body. - :param post_params dict: Request post form parameters, - for `application/x-www-form-urlencoded`, `multipart/form-data`. - :param auth_settings list: Auth Settings names for the request. - :param files dict: key -> filename, value -> filepath, - for `multipart/form-data`. - :param collection_formats: dict of collection formats for path, query, - header, and post parameters. - :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. - :return: tuple of form (path, http_method, query_params, header_params, - body, post_params, files) - """ - - config = self.configuration - - # header parameters - header_params = header_params or {} - header_params.update(self.default_headers) - if 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) - ) - - # path parameters - if path_params: - path_params = self.sanitize_for_serialization(path_params) - 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) - ) - - # 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 - ) - if files: - post_params.extend(self.files_parameters(files)) - - # auth setting - self.update_params_for_auth( - header_params, - query_params, - auth_settings, - resource_path, - method, - body, - request_auth=_request_auth - ) - - # body - if body: - body = self.sanitize_for_serialization(body) - - # request url - if _host is None or self.configuration.ignore_operation_servers: - url = self.configuration.host + resource_path - else: - # use server/host defined in path or operation instead - url = _host + resource_path - - # 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 += "?" + url_query - - return method, url, header_params, body, post_params - - - def call_api( - self, - method, - url, - header_params=None, - body=None, - post_params=None, - _request_timeout=None - ) -> rest.RESTResponse: - """Makes the HTTP request (synchronous) - :param method: Method to call. - :param url: Path to method endpoint. - :param header_params: Header parameters to be - placed in the request header. - :param body: Request body. - :param post_params dict: Request post form parameters, - for `application/x-www-form-urlencoded`, `multipart/form-data`. - :param _request_timeout: timeout setting for this request. - :return: RESTResponse - """ - - try: - # perform request and return response - response_data = self.rest_client.request( - method, url, - headers=header_params, - body=body, post_params=post_params, - _request_timeout=_request_timeout - ) - - except ApiException as e: - raise e - - return response_data - - def response_deserialize( - self, - response_data: rest.RESTResponse, - response_types_map: Optional[Dict[str, ApiResponseT]]=None - ) -> ApiResponse[ApiResponseT]: - """Deserializes response into an object. - :param response_data: RESTResponse object to be deserialized. - :param response_types_map: dict of response types. - :return: ApiResponse - """ - - msg = "RESTResponse.read() must be called before passing it to 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 found, look for '1XX', '2XX', etc. - 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": - 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.getheader('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) - finally: - if not 200 <= response_data.status <= 299: - raise ApiException.from_response( - http_resp=response_data, - body=response_text, - data=return_data, - ) - - return ApiResponse( - status_code = response_data.status, - data = return_data, - headers = response_data.getheaders(), - raw_data = response_data.data - ) - - def sanitize_for_serialization(self, obj): - """Builds a JSON POST object. - - If obj is None, return None. - If obj is SecretStr, return obj.get_secret_value() - If obj is str, int, long, float, bool, return directly. - If obj is datetime.datetime, datetime.date - convert to string in iso8601 format. - If obj is decimal.Decimal return string representation. - If obj is list, sanitize each element in the list. - If obj is dict, return the dict. - If obj is OpenAPI model, return the properties dict. - - :param obj: The data to serialize. - :return: The serialized form of data. - """ - if obj is None: - return None - elif isinstance(obj, Enum): - return obj.value - elif isinstance(obj, SecretStr): - return obj.get_secret_value() - elif isinstance(obj, self.PRIMITIVE_TYPES): - return obj - elif isinstance(obj, list): - 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 - ) - elif isinstance(obj, (datetime.datetime, datetime.date)): - return obj.isoformat() - elif isinstance(obj, decimal.Decimal): - return str(obj) - - elif isinstance(obj, dict): - obj_dict = obj - else: - # Convert model obj to dict except - # attributes `openapi_types`, `attribute_map` - # 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')): - obj_dict = obj.to_dict() - else: - obj_dict = obj.__dict__ - - return { - 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]): - """Deserializes response into an object. - - :param response: RESTResponse object to be deserialized. - :param response_type: class literal for - deserialized object, or string of class name. - :param content_type: content type of response. - - :return: deserialized object. - """ - - # fetch data from response object - if content_type is None: - try: - data = json.loads(response_text) - except ValueError: - data = response_text - 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): - data = response_text - else: - raise ApiException( - status=0, - reason="Unsupported content type: {0}".format(content_type) - ) - - return self.__deserialize(data, response_type) - - def __deserialize(self, data, klass): - """Deserializes dict, list, str into an object. - - :param data: dict, list or str. - :param klass: class literal, or string of class name. - - :return: object. - """ - if data is None: - return None - - if isinstance(klass, str): - 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] - - 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()} - - # convert str to class - if klass in self.NATIVE_TYPES_MAPPING: - klass = self.NATIVE_TYPES_MAPPING[klass] - else: - klass = getattr(openapi_client.models, klass) - - if klass in self.PRIMITIVE_TYPES: - return self.__deserialize_primitive(data, klass) - elif klass == object: - return self.__deserialize_object(data) - elif klass == datetime.date: - return self.__deserialize_date(data) - elif klass == datetime.datetime: - return self.__deserialize_datetime(data) - elif klass == decimal.Decimal: - return decimal.Decimal(data) - elif issubclass(klass, Enum): - return self.__deserialize_enum(data, klass) - else: - return self.__deserialize_model(data, klass) - - def parameters_to_tuples(self, params, collection_formats): - """Get parameters as list of tuples, formatting collections. - - :param params: Parameters as dict or list of two-tuples - :param dict collection_formats: Parameter collection formats - :return: Parameters as list of tuples, collections formatted - """ - new_params: List[Tuple[str, str]] = [] - if collection_formats is None: - 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': - 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 = '|' - else: # csv is the default - delimiter = ',' - new_params.append( - (k, delimiter.join(str(value) for value in v))) - else: - new_params.append((k, v)) - return new_params - - def parameters_to_url_query(self, params, collection_formats): - """Get parameters as list of tuples, formatting collections. - - :param params: Parameters as dict or list of two-tuples - :param dict collection_formats: Parameter collection formats - :return: URL query string (e.g. a=Hello%20World&b=123) - """ - new_params: List[Tuple[str, str]] = [] - if collection_formats is None: - collection_formats = {} - for k, v in params.items() if isinstance(params, dict) else params: - if isinstance(v, bool): - v = str(v).lower() - if isinstance(v, (int, float)): - v = str(v) - if isinstance(v, dict): - v = json.dumps(v) - - if k in collection_formats: - collection_format = collection_formats[k] - if collection_format == 'multi': - new_params.extend((k, str(value)) for value in v) - else: - 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(quote(str(value)) for value in v)) - ) - else: - new_params.append((k, quote(str(v)))) - - return "&".join(["=".join(map(str, item)) for item in new_params]) - - def files_parameters( - self, - files: Dict[str, Union[str, bytes, List[str], List[bytes], Tuple[str, bytes]]], - ): - """Builds form parameters. - - :param files: File parameters. - :return: Form parameters with files. - """ - params = [] - for k, v in files.items(): - if isinstance(v, str): - with open(v, 'rb') as f: - filename = os.path.basename(f.name) - filedata = f.read() - elif isinstance(v, bytes): - filename = k - filedata = v - elif isinstance(v, tuple): - filename, filedata = v - elif isinstance(v, list): - for file_param in v: - params.extend(self.files_parameters({k: file_param})) - 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])]) - ) - return params - - def select_header_accept(self, accepts: List[str]) -> Optional[str]: - """Returns `Accept` based on an array of accepts provided. - - :param accepts: List of headers. - :return: Accept (e.g. application/json). - """ - if not accepts: - return None - - for accept in accepts: - if re.search('json', accept, re.IGNORECASE): - return accept - - return accepts[0] - - def select_header_content_type(self, content_types): - """Returns `Content-Type` based on an array of content_types provided. - - :param content_types: List of content-types. - :return: Content-Type (e.g. application/json). - """ - if not content_types: - return None - - for content_type in content_types: - if re.search('json', content_type, re.IGNORECASE): - return content_type - - return content_types[0] - - def update_params_for_auth( - self, - headers, - queries, - auth_settings, - resource_path, - method, - body, - request_auth=None - ) -> None: - """Updates header and query params based on authentication setting. - - :param headers: Header parameters dict to be updated. - :param queries: Query parameters tuple list to be updated. - :param auth_settings: Authentication setting identifiers list. - :resource_path: A string representation of the HTTP request resource path. - :method: A string representation of the HTTP request method. - :body: A object representing the body of the HTTP request. - The object type is the return value of sanitize_for_serialization(). - :param request_auth: if set, the provided settings will - override the token in the configuration. - """ - if not auth_settings: - return - - if request_auth: - self._apply_auth_params( - 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 - ) - - def _apply_auth_params( - self, - headers, - queries, - resource_path, - method, - body, - auth_setting - ) -> None: - """Updates the request parameters based on a single auth_setting - - :param headers: Header parameters dict to be updated. - :param queries: Query parameters tuple list to be updated. - :resource_path: A string representation of the HTTP request resource path. - :method: A string representation of the HTTP request method. - :body: A object representing the body of the HTTP request. - 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'])) - else: - raise ApiValueError( - 'Authentication token must be in `query` or `header`' - ) - - def __deserialize_file(self, response): - """Deserializes body to file - - Saves response body into a file in a temporary folder, - using the filename from the `Content-Disposition` header if provided. - - handle file downloading - save response body into a tmp file and return the instance - - :param response: RESTResponse. - :return: file path. - """ - fd, path = tempfile.mkstemp(dir=self.configuration.temp_folder_path) - os.close(fd) - os.remove(path) - - content_disposition = response.getheader("Content-Disposition") - if content_disposition: - m = re.search( - r'filename=[\'"]?([^\'"\s]+)[\'"]?', - content_disposition - ) - assert m is not None, "Unexpected 'content-disposition' header value" - filename = m.group(1) - path = os.path.join(os.path.dirname(path), filename) - - with open(path, "wb") as f: - f.write(response.data) - - return path - - def __deserialize_primitive(self, data, klass): - """Deserializes string to primitive type. - - :param data: str. - :param klass: class literal. - - :return: int, long, float, str, bool. - """ - try: - return klass(data) - except UnicodeEncodeError: - return str(data) - except TypeError: - return data - - def __deserialize_object(self, value): - """Return an original value. - - :return: object. - """ - return value - - def __deserialize_date(self, string): - """Deserializes string to date. - - :param string: str. - :return: date. - """ - try: - return parse(string).date() - except ImportError: - return string - except ValueError: - raise rest.ApiException( - status=0, - reason="Failed to parse `{0}` as date object".format(string) - ) - - def __deserialize_datetime(self, string): - """Deserializes string to datetime. - - The string should be in iso8601 datetime format. - - :param string: str. - :return: datetime. - """ - try: - return parse(string) - except ImportError: - return string - except ValueError: - raise rest.ApiException( - status=0, - reason=( - "Failed to parse `{0}` as datetime object" - .format(string) - ) - ) - - def __deserialize_enum(self, data, klass): - """Deserializes primitive type to enum. - - :param data: primitive type. - :param klass: class literal. - :return: enum value. - """ - try: - return klass(data) - except ValueError: - raise rest.ApiException( - status=0, - reason=( - "Failed to parse `{0}` as `{1}`" - .format(data, klass) - ) - ) - - def __deserialize_model(self, data, klass): - """Deserializes list or dict to model. - - :param data: dict, list. - :param klass: class literal. - :return: model object. - """ - - return klass.from_dict(data) diff --git a/openapi_client/api_response.py b/openapi_client/api_response.py deleted file mode 100644 index 9bc7c11..0000000 --- a/openapi_client/api_response.py +++ /dev/null @@ -1,21 +0,0 @@ -"""API response object.""" - -from __future__ import annotations -from typing import Optional, Generic, Mapping, TypeVar -from pydantic import Field, StrictInt, StrictBytes, BaseModel - -T = TypeVar("T") - -class ApiResponse(BaseModel, Generic[T]): - """ - API response object - """ - - status_code: StrictInt = Field(description="HTTP status code") - headers: Optional[Mapping[str, str]] = Field(None, description="HTTP headers") - 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 - } diff --git a/openapi_client/configuration.py b/openapi_client/configuration.py deleted file mode 100644 index 132565f..0000000 --- a/openapi_client/configuration.py +++ /dev/null @@ -1,565 +0,0 @@ -# coding: utf-8 - -""" - Open Device Management API - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: undefined - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import copy -import http.client as httplib -import logging -from logging import FileHandler -import multiprocessing -import sys -from typing import Any, ClassVar, Dict, List, Literal, Optional, TypedDict -from typing_extensions import NotRequired, Self - -import urllib3 - - -JSON_SCHEMA_VALIDATION_KEYWORDS = { - 'multipleOf', 'maximum', 'exclusiveMaximum', - 'minimum', 'exclusiveMinimum', 'maxLength', - 'minLength', 'pattern', 'maxItems', 'minItems' -} - -ServerVariablesT = Dict[str, str] - -GenericAuthSetting = TypedDict( - "GenericAuthSetting", - { - "type": str, - "in": str, - "key": str, - "value": str, - }, -) - - -OAuth2AuthSetting = TypedDict( - "OAuth2AuthSetting", - { - "type": Literal["oauth2"], - "in": Literal["header"], - "key": Literal["Authorization"], - "value": str, - }, -) - - -APIKeyAuthSetting = TypedDict( - "APIKeyAuthSetting", - { - "type": Literal["api_key"], - "in": str, - "key": str, - "value": Optional[str], - }, -) - - -BasicAuthSetting = TypedDict( - "BasicAuthSetting", - { - "type": Literal["basic"], - "in": Literal["header"], - "key": Literal["Authorization"], - "value": Optional[str], - }, -) - - -BearerFormatAuthSetting = TypedDict( - "BearerFormatAuthSetting", - { - "type": Literal["bearer"], - "in": Literal["header"], - "format": Literal["JWT"], - "key": Literal["Authorization"], - "value": str, - }, -) - - -BearerAuthSetting = TypedDict( - "BearerAuthSetting", - { - "type": Literal["bearer"], - "in": Literal["header"], - "key": Literal["Authorization"], - "value": str, - }, -) - - -HTTPSignatureAuthSetting = TypedDict( - "HTTPSignatureAuthSetting", - { - "type": Literal["http-signature"], - "in": Literal["header"], - "key": Literal["Authorization"], - "value": None, - }, -) - - -AuthSettings = TypedDict( - "AuthSettings", - { - }, - total=False, -) - - -class HostSettingVariable(TypedDict): - description: str - default_value: str - enum_values: List[str] - - -class HostSetting(TypedDict): - url: str - description: str - variables: NotRequired[Dict[str, HostSettingVariable]] - - -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. - - """ - - _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, - *, - debug: Optional[bool] = None, - ) -> None: - """Constructor - """ - self._base_path = "http://localhost" if host is None else host - """Default Base url - """ - self.server_index = 0 if server_index is None and host is None else server_index - self.server_operation_index = server_operation_index or {} - """Default server index - """ - self.server_variables = server_variables or {} - self.server_operation_variables = server_operation_variables or {} - """Default server variables - """ - self.ignore_operation_servers = ignore_operation_servers - """Ignore operation servers - """ - self.temp_folder_path = None - """Temp file folder for downloading files - """ - # Authentication Settings - self.api_key = {} - if api_key: - self.api_key = api_key - """dict to store API key(s) - """ - self.api_key_prefix = {} - if api_key_prefix: - self.api_key_prefix = api_key_prefix - """dict to store API prefix (e.g. Bearer) - """ - self.refresh_api_key_hook = None - """function hook to refresh API key if expired - """ - self.username = username - """Username for HTTP basic authentication - """ - self.password = password - """Password for HTTP basic authentication - """ - self.access_token = access_token - """Access token - """ - self.logger = {} - """Logging Settings - """ - self.logger["package_logger"] = logging.getLogger("openapi_client") - self.logger["urllib3_logger"] = logging.getLogger("urllib3") - self.logger_format = '%(asctime)s %(levelname)s %(message)s' - """Log format - """ - self.logger_stream_handler = None - """Log stream handler - """ - self.logger_file_handler: Optional[FileHandler] = None - """Log file handler - """ - self.logger_file = None - """Debug file location - """ - if debug is not None: - self.debug = debug - else: - self.__debug = False - """Debug switch - """ - - self.verify_ssl = True - """SSL/TLS verification - Set this to false to skip verifying SSL certificate when calling API - from https server. - """ - self.ssl_ca_cert = ssl_ca_cert - """Set this to customize the certificate file to verify the peer. - """ - self.cert_file = None - """client certificate file - """ - self.key_file = None - """client key file - """ - self.assert_hostname = None - """Set this to True/False to enable/disable SSL hostname verification. - """ - self.tls_server_name = None - """SSL/TLS Server Name Indication (SNI) - Set this to the SNI value expected by the server. - """ - - self.connection_pool_maxsize = 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. - """ - - self.proxy: Optional[str] = None - """Proxy URL - """ - self.proxy_headers = None - """Proxy headers - """ - self.safe_chars_for_path_param = '' - """Safe chars for path_param - """ - self.retries = retries - """Adding retries to override urllib3 default value 3 - """ - # Enable client side validation - self.client_side_validation = True - - self.socket_options = None - """Options to pass down to the underlying urllib3 socket - """ - - self.datetime_format = "%Y-%m-%dT%H:%M:%S.%f%z" - """datetime format - """ - - self.date_format = "%Y-%m-%d" - """date format - """ - - 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'): - setattr(result, k, copy.deepcopy(v, memo)) - # shallow copy of loggers - result.logger = copy.copy(self.logger) - # use setters to configure loggers - result.logger_file = self.logger_file - result.debug = self.debug - return result - - def __setattr__(self, name: str, value: Any) -> None: - object.__setattr__(self, name, value) - - @classmethod - def set_default(cls, default: Optional[Self]) -> None: - """Set default instance of configuration. - - It stores default configuration, which can be - returned by get_default_copy method. - - :param default: object of Configuration - """ - cls._default = default - - @classmethod - def get_default_copy(cls) -> Self: - """Deprecated. Please use `get_default` instead. - - Deprecated. Please use `get_default` instead. - - :return: The configuration object. - """ - return cls.get_default() - - @classmethod - def get_default(cls) -> Self: - """Return the default configuration. - - This method returns newly created, based on default constructor, - object of Configuration class or returns a copy of default - configuration. - - :return: The configuration object. - """ - if cls._default is None: - cls._default = cls() - return cls._default - - @property - def logger_file(self) -> Optional[str]: - """The logger file. - - If the logger_file is None, then add stream handler and remove file - handler. Otherwise, add file handler and remove stream handler. - - :param value: The logger_file path. - :type: str - """ - return self.__logger_file - - @logger_file.setter - def logger_file(self, value: Optional[str]) -> None: - """The logger file. - - If the logger_file is None, then add stream handler and remove file - handler. Otherwise, add file handler and remove stream handler. - - :param value: The logger_file path. - :type: str - """ - self.__logger_file = value - if self.__logger_file: - # If set logging file, - # then add file handler and remove stream handler. - self.logger_file_handler = logging.FileHandler(self.__logger_file) - self.logger_file_handler.setFormatter(self.logger_formatter) - for _, logger in self.logger.items(): - logger.addHandler(self.logger_file_handler) - - @property - def debug(self) -> bool: - """Debug status - - :param value: The debug status, True or False. - :type: bool - """ - return self.__debug - - @debug.setter - def debug(self, value: bool) -> None: - """Debug status - - :param value: The debug status, True or False. - :type: bool - """ - self.__debug = value - if self.__debug: - # if debug status is True, turn on debug logging - for _, logger in self.logger.items(): - logger.setLevel(logging.DEBUG) - # turn on httplib debug - httplib.HTTPConnection.debuglevel = 1 - else: - # if debug status is False, turn off debug logging, - # setting log level to default `logging.WARNING` - for _, logger in self.logger.items(): - logger.setLevel(logging.WARNING) - # turn off httplib debug - httplib.HTTPConnection.debuglevel = 0 - - @property - def logger_format(self) -> str: - """The logger format. - - The logger_formatter will be updated when sets logger_format. - - :param value: The format string. - :type: str - """ - return self.__logger_format - - @logger_format.setter - def logger_format(self, value: str) -> None: - """The logger format. - - The logger_formatter will be updated when sets logger_format. - - :param value: The format string. - :type: str - """ - 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]: - """Gets API key (with prefix if set). - - :param identifier: The identifier of apiKey. - :param alias: The alternative identifier of apiKey. - :return: The token for api key authentication. - """ - 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) - if key: - prefix = self.api_key_prefix.get(identifier) - if prefix: - return "%s %s" % (prefix, key) - else: - return key - - return None - - def get_basic_auth_token(self) -> Optional[str]: - """Gets HTTP basic authentication header (string). - - :return: The token for basic HTTP authentication. - """ - username = "" - if self.username is not None: - username = self.username - password = "" - if self.password is not None: - password = self.password - return urllib3.util.make_headers( - basic_auth=username + ':' + password - ).get('authorization') - - def auth_settings(self)-> AuthSettings: - """Gets Auth Settings dict for api client. - - :return: The Auth Settings information dict. - """ - auth: AuthSettings = {} - return auth - - def to_debug_report(self) -> str: - """Gets the essential information for debugging. - - :return: The report for debugging. - """ - return "Python SDK Debug Report:\n"\ - "OS: {env}\n"\ - "Python Version: {pyversion}\n"\ - "Version of the API: undefined\n"\ - "SDK Package Version: 1.0.0".\ - format(env=sys.platform, pyversion=sys.version) - - def get_host_settings(self) -> List[HostSetting]: - """Gets an array of host settings - - :return: An array of host settings - """ - return [ - { - 'url': "", - 'description': "No description provided", - } - ] - - def get_host_from_settings( - self, - index: Optional[int], - 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 - :param variables: hash of variable and the corresponding value - :param servers: an array of host settings or None - :return: URL based on host settings - """ - if index is None: - return self._base_path - - variables = {} if variables is None else variables - servers = self.get_host_settings() if servers is None else servers - - try: - server = servers[index] - except IndexError: - raise ValueError( - "Invalid index {0} when selecting the host settings. " - "Must be less than {1}".format(index, len(servers))) - - 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 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'])) - - url = url.replace("{" + variable_name + "}", used_value) - - return url - - @property - def host(self) -> str: - """Return generated host.""" - return self.get_host_from_settings(self.server_index, variables=self.server_variables) - - @host.setter - def host(self, value: str) -> None: - """Fix base path.""" - self._base_path = value - self.server_index = None diff --git a/openapi_client/exceptions.py b/openapi_client/exceptions.py deleted file mode 100644 index 41ec8b9..0000000 --- a/openapi_client/exceptions.py +++ /dev/null @@ -1,199 +0,0 @@ -# coding: utf-8 - -""" - Open Device Management API - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: undefined - Generated by OpenAPI Generator (https://openapi-generator.tech) - - 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 - - Args: - msg (str): the exception message - - Keyword Args: - path_to_item (list): a list of keys an indices to get to the - current_item - None if unset - valid_classes (tuple): the primitive classes that current item - should be an instance of - None if unset - key_type (bool): False if our value is a value in a dict - True if it is a key in a dict - False if our item is an item in a list - None if unset - """ - self.path_to_item = path_to_item - self.valid_classes = valid_classes - self.key_type = key_type - full_msg = msg - if path_to_item: - full_msg = "{0} at {1}".format(msg, render_path(path_to_item)) - super(ApiTypeError, self).__init__(full_msg) - - -class ApiValueError(OpenApiException, ValueError): - def __init__(self, msg, path_to_item=None) -> None: - """ - Args: - msg (str): the exception message - - Keyword Args: - path_to_item (list) the path to the exception in the - received_data dict. None if unset - """ - - self.path_to_item = path_to_item - full_msg = msg - if path_to_item: - full_msg = "{0} at {1}".format(msg, render_path(path_to_item)) - super(ApiValueError, self).__init__(full_msg) - - -class ApiAttributeError(OpenApiException, AttributeError): - def __init__(self, msg, path_to_item=None) -> None: - """ - Raised when an attribute reference or assignment fails. - - Args: - msg (str): the exception message - - Keyword Args: - path_to_item (None/list) the path to the exception in the - received_data dict - """ - self.path_to_item = path_to_item - full_msg = msg - if path_to_item: - full_msg = "{0} at {1}".format(msg, render_path(path_to_item)) - super(ApiAttributeError, self).__init__(full_msg) - - -class ApiKeyError(OpenApiException, KeyError): - def __init__(self, msg, path_to_item=None) -> None: - """ - Args: - msg (str): the exception message - - Keyword Args: - path_to_item (None/list) the path to the exception in the - received_data dict - """ - self.path_to_item = path_to_item - full_msg = msg - if path_to_item: - full_msg = "{0} at {1}".format(msg, render_path(path_to_item)) - super(ApiKeyError, self).__init__(full_msg) - - -class ApiException(OpenApiException): - - def __init__( - self, - status=None, - reason=None, - http_resp=None, - *, - body: Optional[str] = None, - data: Optional[Any] = None, - ) -> None: - self.status = status - self.reason = reason - self.body = body - self.data = data - self.headers = None - - if http_resp: - if self.status is None: - self.status = http_resp.status - if self.reason is None: - self.reason = http_resp.reason - if self.body is None: - try: - self.body = http_resp.data.decode('utf-8') - except Exception: - pass - self.headers = http_resp.getheaders() - - @classmethod - def from_response( - cls, - *, - http_resp, - body: Optional[str], - data: Optional[Any], - ) -> Self: - if http_resp.status == 400: - raise BadRequestException(http_resp=http_resp, body=body, data=data) - - if http_resp.status == 401: - raise UnauthorizedException(http_resp=http_resp, body=body, data=data) - - if http_resp.status == 403: - raise ForbiddenException(http_resp=http_resp, body=body, data=data) - - if http_resp.status == 404: - raise NotFoundException(http_resp=http_resp, body=body, data=data) - - if 500 <= http_resp.status <= 599: - raise ServiceException(http_resp=http_resp, body=body, data=data) - raise ApiException(http_resp=http_resp, body=body, data=data) - - def __str__(self): - """Custom error messages for exception""" - 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) - - if self.data or self.body: - error_message += "HTTP response body: {0}\n".format(self.data or self.body) - - return error_message - - -class BadRequestException(ApiException): - pass - - -class NotFoundException(ApiException): - pass - - -class UnauthorizedException(ApiException): - pass - - -class ForbiddenException(ApiException): - pass - - -class ServiceException(ApiException): - pass - - -def render_path(path_to_item): - """Returns a string representation of a path""" - result = "" - for pth in path_to_item: - if isinstance(pth, int): - result += "[{0}]".format(pth) - else: - result += "['{0}']".format(pth) - return result diff --git a/openapi_client/models/__init__.py b/openapi_client/models/__init__.py deleted file mode 100644 index 83087c6..0000000 --- a/openapi_client/models/__init__.py +++ /dev/null @@ -1,130 +0,0 @@ -# coding: utf-8 - -# flake8: noqa -""" - Open Device Management API - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: undefined - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -# import models into model package -from openapi_client.models.application_env_vars import ApplicationEnvVars -from openapi_client.models.application_spec import ApplicationSpec -from openapi_client.models.application_status_type import ApplicationStatusType -from openapi_client.models.applications_summary_status_type import ApplicationsSummaryStatusType -from openapi_client.models.auth_config import AuthConfig -from openapi_client.models.batch import Batch -from openapi_client.models.batch_limit import BatchLimit -from openapi_client.models.batch_sequence import BatchSequence -from openapi_client.models.cpu_resource_monitor_spec import CPUResourceMonitorSpec -from openapi_client.models.certificate_signing_request import CertificateSigningRequest -from openapi_client.models.certificate_signing_request_list import CertificateSigningRequestList -from openapi_client.models.certificate_signing_request_spec import CertificateSigningRequestSpec -from openapi_client.models.certificate_signing_request_status import CertificateSigningRequestStatus -from openapi_client.models.condition import Condition -from openapi_client.models.condition_status import ConditionStatus -from openapi_client.models.condition_type import ConditionType -from openapi_client.models.config_provider_spec import ConfigProviderSpec -from openapi_client.models.custom_resource_monitor_spec import CustomResourceMonitorSpec -from openapi_client.models.device import Device -from openapi_client.models.device_application_status import DeviceApplicationStatus -from openapi_client.models.device_applications_summary_status import DeviceApplicationsSummaryStatus -from openapi_client.models.device_config_status import DeviceConfigStatus -from openapi_client.models.device_console import DeviceConsole -from openapi_client.models.device_hooks_spec import DeviceHooksSpec -from openapi_client.models.device_integrity_status import DeviceIntegrityStatus -from openapi_client.models.device_integrity_status_summary import DeviceIntegrityStatusSummary -from openapi_client.models.device_integrity_status_summary_type import DeviceIntegrityStatusSummaryType -from openapi_client.models.device_list import DeviceList -from openapi_client.models.device_os_spec import DeviceOSSpec -from openapi_client.models.device_os_status import DeviceOSStatus -from openapi_client.models.device_reboot_hook_spec import DeviceRebootHookSpec -from openapi_client.models.device_resource_status import DeviceResourceStatus -from openapi_client.models.device_resource_status_type import DeviceResourceStatusType -from openapi_client.models.device_spec import DeviceSpec -from openapi_client.models.device_spec_systemd import DeviceSpecSystemd -from openapi_client.models.device_status import DeviceStatus -from openapi_client.models.device_summary_status import DeviceSummaryStatus -from openapi_client.models.device_summary_status_type import DeviceSummaryStatusType -from openapi_client.models.device_system_info import DeviceSystemInfo -from openapi_client.models.device_update_hook_spec import DeviceUpdateHookSpec -from openapi_client.models.device_updated_status import DeviceUpdatedStatus -from openapi_client.models.device_updated_status_type import DeviceUpdatedStatusType -from openapi_client.models.devices_summary import DevicesSummary -from openapi_client.models.disk_resource_monitor_spec import DiskResourceMonitorSpec -from openapi_client.models.disruption_allowance import DisruptionAllowance -from openapi_client.models.enrollment_config import EnrollmentConfig -from openapi_client.models.enrollment_request import EnrollmentRequest -from openapi_client.models.enrollment_request_approval import EnrollmentRequestApproval -from openapi_client.models.enrollment_request_list import EnrollmentRequestList -from openapi_client.models.enrollment_request_spec import EnrollmentRequestSpec -from openapi_client.models.enrollment_request_status import EnrollmentRequestStatus -from openapi_client.models.enrollment_service import EnrollmentService -from openapi_client.models.enrollment_service_auth import EnrollmentServiceAuth -from openapi_client.models.enrollment_service_service import EnrollmentServiceService -from openapi_client.models.error import Error -from openapi_client.models.file_operation import FileOperation -from openapi_client.models.file_spec import FileSpec -from openapi_client.models.fleet import Fleet -from openapi_client.models.fleet_list import FleetList -from openapi_client.models.fleet_rollout_status import FleetRolloutStatus -from openapi_client.models.fleet_spec import FleetSpec -from openapi_client.models.fleet_spec_template import FleetSpecTemplate -from openapi_client.models.fleet_status import FleetStatus -from openapi_client.models.generic_repo_spec import GenericRepoSpec -from openapi_client.models.git_config_provider_spec import GitConfigProviderSpec -from openapi_client.models.git_config_provider_spec_git_ref import GitConfigProviderSpecGitRef -from openapi_client.models.hook_action import HookAction -from openapi_client.models.hook_action_executable import HookActionExecutable -from openapi_client.models.hook_action_executable_spec import HookActionExecutableSpec -from openapi_client.models.hook_action_one_of import HookActionOneOf -from openapi_client.models.hook_action_one_of1 import HookActionOneOf1 -from openapi_client.models.hook_action_spec import HookActionSpec -from openapi_client.models.hook_action_systemd_spec import HookActionSystemdSpec -from openapi_client.models.hook_action_systemd_unit import HookActionSystemdUnit -from openapi_client.models.http_config import HttpConfig -from openapi_client.models.http_config_provider_spec import HttpConfigProviderSpec -from openapi_client.models.http_config_provider_spec_http_ref import HttpConfigProviderSpecHttpRef -from openapi_client.models.http_repo_spec import HttpRepoSpec -from openapi_client.models.image_application_provider import ImageApplicationProvider -from openapi_client.models.inline_config_provider_spec import InlineConfigProviderSpec -from openapi_client.models.kubernetes_secret_provider_spec import KubernetesSecretProviderSpec -from openapi_client.models.kubernetes_secret_provider_spec_secret_ref import KubernetesSecretProviderSpecSecretRef -from openapi_client.models.label_selector import LabelSelector -from openapi_client.models.list_meta import ListMeta -from openapi_client.models.match_expression import MatchExpression -from openapi_client.models.memory_resource_monitor_spec import MemoryResourceMonitorSpec -from openapi_client.models.object_meta import ObjectMeta -from openapi_client.models.patch_request_inner import PatchRequestInner -from openapi_client.models.rendered_application_spec import RenderedApplicationSpec -from openapi_client.models.rendered_device_spec import RenderedDeviceSpec -from openapi_client.models.rendered_device_spec_systemd import RenderedDeviceSpecSystemd -from openapi_client.models.repo_spec_type import RepoSpecType -from openapi_client.models.repository import Repository -from openapi_client.models.repository_list import RepositoryList -from openapi_client.models.repository_spec import RepositorySpec -from openapi_client.models.repository_status import RepositoryStatus -from openapi_client.models.resource_alert_rule import ResourceAlertRule -from openapi_client.models.resource_alert_severity_type import ResourceAlertSeverityType -from openapi_client.models.resource_monitor import ResourceMonitor -from openapi_client.models.resource_monitor_spec import ResourceMonitorSpec -from openapi_client.models.resource_sync import ResourceSync -from openapi_client.models.resource_sync_list import ResourceSyncList -from openapi_client.models.resource_sync_spec import ResourceSyncSpec -from openapi_client.models.resource_sync_status import ResourceSyncStatus -from openapi_client.models.rollout_device_selection import RolloutDeviceSelection -from openapi_client.models.rollout_policy import RolloutPolicy -from openapi_client.models.sort_order import SortOrder -from openapi_client.models.ssh_config import SshConfig -from openapi_client.models.ssh_repo_spec import SshRepoSpec -from openapi_client.models.status import Status -from openapi_client.models.template_version import TemplateVersion -from openapi_client.models.template_version_list import TemplateVersionList -from openapi_client.models.template_version_spec import TemplateVersionSpec -from openapi_client.models.template_version_status import TemplateVersionStatus diff --git a/openapi_client/models/application_env_vars.py b/openapi_client/models/application_env_vars.py deleted file mode 100644 index bc75782..0000000 --- a/openapi_client/models/application_env_vars.py +++ /dev/null @@ -1,87 +0,0 @@ -# coding: utf-8 - -""" - Open Device Management API - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: undefined - 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, Field, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from typing import Optional, Set -from typing_extensions import Self - -class ApplicationEnvVars(BaseModel): - """ - ApplicationEnvVars - """ # noqa: E501 - env_vars: Optional[Dict[str, StrictStr]] = Field(default=None, description="Environment variable key-value pairs, injected during runtime", alias="envVars") - __properties: ClassVar[List[str]] = ["envVars"] - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ApplicationEnvVars 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 ApplicationEnvVars from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "envVars": obj.get("envVars") - }) - return _obj - - diff --git a/openapi_client/models/application_spec.py b/openapi_client/models/application_spec.py deleted file mode 100644 index 29d5dc8..0000000 --- a/openapi_client/models/application_spec.py +++ /dev/null @@ -1,91 +0,0 @@ -# coding: utf-8 - -""" - Open Device Management API - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: undefined - 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, Field, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from typing import Optional, Set -from typing_extensions import Self - -class ApplicationSpec(BaseModel): - """ - ApplicationSpec - """ # noqa: E501 - env_vars: Optional[Dict[str, StrictStr]] = Field(default=None, description="Environment variable key-value pairs, injected during runtime", alias="envVars") - name: Optional[StrictStr] = Field(default=None, description="The name of the application") - image: StrictStr = Field(description="Reference to the container image for the application package") - __properties: ClassVar[List[str]] = ["envVars", "name", "image"] - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ApplicationSpec 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 ApplicationSpec from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "envVars": obj.get("envVars"), - "name": obj.get("name"), - "image": obj.get("image") - }) - return _obj - - diff --git a/openapi_client/models/application_status_type.py b/openapi_client/models/application_status_type.py deleted file mode 100644 index 047712e..0000000 --- a/openapi_client/models/application_status_type.py +++ /dev/null @@ -1,41 +0,0 @@ -# coding: utf-8 - -""" - Open Device Management API - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: undefined - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import json -from enum import Enum -from typing_extensions import Self - - -class ApplicationStatusType(str, Enum): - """ - ApplicationStatusType - """ - - """ - allowed enum values - """ - PREPARING = 'Preparing' - STARTING = 'Starting' - RUNNING = 'Running' - ERROR = 'Error' - UNKNOWN = 'Unknown' - COMPLETED = 'Completed' - - @classmethod - def from_json(cls, json_str: str) -> Self: - """Create an instance of ApplicationStatusType from a JSON string""" - return cls(json.loads(json_str)) - - diff --git a/openapi_client/models/applications_summary_status_type.py b/openapi_client/models/applications_summary_status_type.py deleted file mode 100644 index adbf058..0000000 --- a/openapi_client/models/applications_summary_status_type.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - Open Device Management API - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: undefined - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import json -from enum import Enum -from typing_extensions import Self - - -class ApplicationsSummaryStatusType(str, Enum): - """ - ApplicationsSummaryStatusType - """ - - """ - allowed enum values - """ - HEALTHY = 'Healthy' - DEGRADED = 'Degraded' - ERROR = 'Error' - UNKNOWN = 'Unknown' - - @classmethod - def from_json(cls, json_str: str) -> Self: - """Create an instance of ApplicationsSummaryStatusType from a JSON string""" - return cls(json.loads(json_str)) - - diff --git a/openapi_client/models/auth_config.py b/openapi_client/models/auth_config.py deleted file mode 100644 index 15181b2..0000000 --- a/openapi_client/models/auth_config.py +++ /dev/null @@ -1,89 +0,0 @@ -# coding: utf-8 - -""" - Open Device Management API - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: undefined - 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, Field, StrictStr -from typing import Any, ClassVar, Dict, List -from typing import Optional, Set -from typing_extensions import Self - -class AuthConfig(BaseModel): - """ - Auth config. - """ # noqa: E501 - auth_type: StrictStr = Field(description="Auth type", alias="authType") - auth_url: StrictStr = Field(description="Auth URL", alias="authURL") - __properties: ClassVar[List[str]] = ["authType", "authURL"] - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of AuthConfig 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 AuthConfig from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "authType": obj.get("authType"), - "authURL": obj.get("authURL") - }) - return _obj - - diff --git a/openapi_client/models/batch.py b/openapi_client/models/batch.py deleted file mode 100644 index b377c75..0000000 --- a/openapi_client/models/batch.py +++ /dev/null @@ -1,99 +0,0 @@ -# coding: utf-8 - -""" - Open Device Management API - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: undefined - 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, Field, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from openapi_client.models.batch_limit import BatchLimit -from openapi_client.models.label_selector import LabelSelector -from typing import Optional, Set -from typing_extensions import Self - -class Batch(BaseModel): - """ - Batch is an element in batch sequence. - """ # noqa: E501 - selector: Optional[LabelSelector] = None - success_threshold: Optional[StrictStr] = Field(default=None, description="Percentage is the string format representing percentage string.", alias="successThreshold") - limit: Optional[BatchLimit] = None - __properties: ClassVar[List[str]] = ["selector", "successThreshold", "limit"] - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of Batch 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 selector - if self.selector: - _dict['selector'] = self.selector.to_dict() - # override the default output from pydantic by calling `to_dict()` of limit - if self.limit: - _dict['limit'] = self.limit.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of Batch from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "selector": LabelSelector.from_dict(obj["selector"]) if obj.get("selector") is not None else None, - "successThreshold": obj.get("successThreshold"), - "limit": BatchLimit.from_dict(obj["limit"]) if obj.get("limit") is not None else None - }) - return _obj - - diff --git a/openapi_client/models/batch_limit.py b/openapi_client/models/batch_limit.py deleted file mode 100644 index cd7dba3..0000000 --- a/openapi_client/models/batch_limit.py +++ /dev/null @@ -1,144 +0,0 @@ -# coding: utf-8 - -""" - Open Device Management API - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: undefined - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import json -import pprint -from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator -from typing import Any, List, Optional -from typing_extensions import Annotated -from pydantic import StrictStr, Field -from typing import Union, List, Set, Optional, Dict -from typing_extensions import Literal, Self - -BATCHLIMIT_ONE_OF_SCHEMAS = ["int", "str"] - -class BatchLimit(BaseModel): - """ - BatchLimit - """ - # data type: str - oneof_schema_1_validator: Optional[StrictStr] = Field(default=None, description="Percentage is the string format representing percentage string.") - # data type: int - oneof_schema_2_validator: Optional[Annotated[int, Field(strict=True, ge=1)]] = None - actual_instance: Optional[Union[int, str]] = None - one_of_schemas: Set[str] = { "int", "str" } - - model_config = ConfigDict( - validate_assignment=True, - protected_namespaces=(), - ) - - - def __init__(self, *args, **kwargs) -> None: - if args: - if len(args) > 1: - raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") - if kwargs: - raise ValueError("If a position argument is used, keyword arguments cannot be used.") - super().__init__(actual_instance=args[0]) - else: - super().__init__(**kwargs) - - @field_validator('actual_instance') - def actual_instance_must_validate_oneof(cls, v): - instance = BatchLimit.model_construct() - error_messages = [] - match = 0 - # validate data type: str - try: - instance.oneof_schema_1_validator = v - match += 1 - except (ValidationError, ValueError) as e: - error_messages.append(str(e)) - # validate data type: int - try: - instance.oneof_schema_2_validator = v - match += 1 - except (ValidationError, ValueError) as e: - error_messages.append(str(e)) - if match > 1: - # more than 1 match - raise ValueError("Multiple matches found when setting `actual_instance` in BatchLimit with oneOf schemas: int, str. Details: " + ", ".join(error_messages)) - elif match == 0: - # no match - raise ValueError("No match found when setting `actual_instance` in BatchLimit with oneOf schemas: int, str. Details: " + ", ".join(error_messages)) - else: - return v - - @classmethod - def from_dict(cls, obj: Union[str, Dict[str, Any]]) -> Self: - return cls.from_json(json.dumps(obj)) - - @classmethod - def from_json(cls, json_str: str) -> Self: - """Returns the object represented by the json string""" - instance = cls.model_construct() - error_messages = [] - match = 0 - - # deserialize data into str - try: - # validation - instance.oneof_schema_1_validator = json.loads(json_str) - # assign value to actual_instance - instance.actual_instance = instance.oneof_schema_1_validator - match += 1 - except (ValidationError, ValueError) as e: - error_messages.append(str(e)) - # deserialize data into int - try: - # validation - instance.oneof_schema_2_validator = json.loads(json_str) - # assign value to actual_instance - instance.actual_instance = instance.oneof_schema_2_validator - match += 1 - except (ValidationError, ValueError) as e: - error_messages.append(str(e)) - - if match > 1: - # more than 1 match - raise ValueError("Multiple matches found when deserializing the JSON string into BatchLimit with oneOf schemas: int, str. Details: " + ", ".join(error_messages)) - elif match == 0: - # no match - raise ValueError("No match found when deserializing the JSON string into BatchLimit with oneOf schemas: int, str. Details: " + ", ".join(error_messages)) - else: - return instance - - def to_json(self) -> str: - """Returns the JSON representation of the actual instance""" - if self.actual_instance is None: - return "null" - - if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): - return self.actual_instance.to_json() - else: - return json.dumps(self.actual_instance) - - def to_dict(self) -> Optional[Union[Dict[str, Any], int, str]]: - """Returns the dict representation of the actual instance""" - if self.actual_instance is None: - return None - - if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): - return self.actual_instance.to_dict() - else: - # primitive type - return self.actual_instance - - def to_str(self) -> str: - """Returns the string representation of the actual instance""" - return pprint.pformat(self.model_dump()) - - diff --git a/openapi_client/models/batch_sequence.py b/openapi_client/models/batch_sequence.py deleted file mode 100644 index 37d598c..0000000 --- a/openapi_client/models/batch_sequence.py +++ /dev/null @@ -1,96 +0,0 @@ -# coding: utf-8 - -""" - Open Device Management API - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: undefined - 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, Field -from typing import Any, ClassVar, Dict, List, Optional -from typing_extensions import Annotated -from openapi_client.models.batch import Batch -from typing import Optional, Set -from typing_extensions import Self - -class BatchSequence(BaseModel): - """ - BatchSequence defines the list of batches to be executed in sequence. - """ # noqa: E501 - sequence: Optional[Annotated[List[Batch], Field(min_length=1)]] = None - __properties: ClassVar[List[str]] = ["sequence"] - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BatchSequence 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 sequence (list) - _items = [] - if self.sequence: - for _item_sequence in self.sequence: - if _item_sequence: - _items.append(_item_sequence.to_dict()) - _dict['sequence'] = _items - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BatchSequence from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "sequence": [Batch.from_dict(_item) for _item in obj["sequence"]] if obj.get("sequence") is not None else None - }) - return _obj - - diff --git a/openapi_client/models/certificate_signing_request.py b/openapi_client/models/certificate_signing_request.py deleted file mode 100644 index d1ed851..0000000 --- a/openapi_client/models/certificate_signing_request.py +++ /dev/null @@ -1,107 +0,0 @@ -# coding: utf-8 - -""" - Open Device Management API - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: undefined - 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, Field, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from openapi_client.models.certificate_signing_request_spec import CertificateSigningRequestSpec -from openapi_client.models.certificate_signing_request_status import CertificateSigningRequestStatus -from openapi_client.models.object_meta import ObjectMeta -from typing import Optional, Set -from typing_extensions import Self - -class CertificateSigningRequest(BaseModel): - """ - CertificateSigningRequest represents a request for a signed certificate from the CA - """ # noqa: E501 - api_version: StrictStr = Field(description="APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", alias="apiVersion") - kind: StrictStr = Field(description="Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds") - metadata: ObjectMeta - spec: CertificateSigningRequestSpec - status: Optional[CertificateSigningRequestStatus] = None - __properties: ClassVar[List[str]] = ["apiVersion", "kind", "metadata", "spec", "status"] - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of CertificateSigningRequest 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 metadata - if self.metadata: - _dict['metadata'] = self.metadata.to_dict() - # override the default output from pydantic by calling `to_dict()` of spec - if self.spec: - _dict['spec'] = self.spec.to_dict() - # override the default output from pydantic by calling `to_dict()` of status - if self.status: - _dict['status'] = self.status.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of CertificateSigningRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "apiVersion": obj.get("apiVersion"), - "kind": obj.get("kind"), - "metadata": ObjectMeta.from_dict(obj["metadata"]) if obj.get("metadata") is not None else None, - "spec": CertificateSigningRequestSpec.from_dict(obj["spec"]) if obj.get("spec") is not None else None, - "status": CertificateSigningRequestStatus.from_dict(obj["status"]) if obj.get("status") is not None else None - }) - return _obj - - diff --git a/openapi_client/models/certificate_signing_request_list.py b/openapi_client/models/certificate_signing_request_list.py deleted file mode 100644 index ee8c3a0..0000000 --- a/openapi_client/models/certificate_signing_request_list.py +++ /dev/null @@ -1,105 +0,0 @@ -# coding: utf-8 - -""" - Open Device Management API - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: undefined - 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, Field, StrictStr -from typing import Any, ClassVar, Dict, List -from openapi_client.models.certificate_signing_request import CertificateSigningRequest -from openapi_client.models.list_meta import ListMeta -from typing import Optional, Set -from typing_extensions import Self - -class CertificateSigningRequestList(BaseModel): - """ - CertificateSigningRequestList is a list of CertificateSigningRequest - """ # noqa: E501 - api_version: StrictStr = Field(description="APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", alias="apiVersion") - kind: StrictStr = Field(description="Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds") - metadata: ListMeta - items: List[CertificateSigningRequest] = Field(description="List of CertificateSigningRequest.") - __properties: ClassVar[List[str]] = ["apiVersion", "kind", "metadata", "items"] - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of CertificateSigningRequestList 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 metadata - if self.metadata: - _dict['metadata'] = self.metadata.to_dict() - # override the default output from pydantic by calling `to_dict()` of each item in items (list) - _items = [] - if self.items: - for _item_items in self.items: - if _item_items: - _items.append(_item_items.to_dict()) - _dict['items'] = _items - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of CertificateSigningRequestList from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "apiVersion": obj.get("apiVersion"), - "kind": obj.get("kind"), - "metadata": ListMeta.from_dict(obj["metadata"]) if obj.get("metadata") is not None else None, - "items": [CertificateSigningRequest.from_dict(_item) for _item in obj["items"]] if obj.get("items") is not None else None - }) - return _obj - - diff --git a/openapi_client/models/certificate_signing_request_spec.py b/openapi_client/models/certificate_signing_request_spec.py deleted file mode 100644 index b62c91f..0000000 --- a/openapi_client/models/certificate_signing_request_spec.py +++ /dev/null @@ -1,99 +0,0 @@ -# coding: utf-8 - -""" - Open Device Management API - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: undefined - 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, Field, StrictBytes, StrictInt, StrictStr -from typing import Any, ClassVar, Dict, List, Optional, Union -from typing import Optional, Set -from typing_extensions import Self - -class CertificateSigningRequestSpec(BaseModel): - """ - Wrapper around a user-created CSR, modeled on kubernetes io.k8s.api.certificates.v1.CertificateSigningRequestSpec - """ # noqa: E501 - expiration_seconds: Optional[StrictInt] = Field(default=None, description="Requested duration of validity for the certificate", alias="expirationSeconds") - extra: Optional[Dict[str, List[StrictStr]]] = Field(default=None, description="Extra attributes of the user that created the CSR, populated by the API server on creation and immutable") - request: Optional[Union[StrictBytes, StrictStr]] = Field(default=None, description="The base64-encoded PEM-encoded PKCS#10 CSR. Matches the spec.request field in a kubernetes CertificateSigningRequest resource") - signer_name: StrictStr = Field(description="Indicates the requested signer, and is a qualified name", alias="signerName") - uid: Optional[StrictStr] = Field(default=None, description="UID of the user that created the CSR, populated by the API server on creation and immutable") - usages: Optional[List[StrictStr]] = Field(default=None, description="Usages specifies a set of key usages requested in the issued certificate.") - username: Optional[StrictStr] = Field(default=None, description="Name of the user that created the CSR, populated by the API server on creation and immutable") - __properties: ClassVar[List[str]] = ["expirationSeconds", "extra", "request", "signerName", "uid", "usages", "username"] - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of CertificateSigningRequestSpec 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 CertificateSigningRequestSpec from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "expirationSeconds": obj.get("expirationSeconds"), - "extra": obj.get("extra"), - "request": obj.get("request"), - "signerName": obj.get("signerName"), - "uid": obj.get("uid"), - "usages": obj.get("usages"), - "username": obj.get("username") - }) - return _obj - - diff --git a/openapi_client/models/certificate_signing_request_status.py b/openapi_client/models/certificate_signing_request_status.py deleted file mode 100644 index bd552d2..0000000 --- a/openapi_client/models/certificate_signing_request_status.py +++ /dev/null @@ -1,97 +0,0 @@ -# coding: utf-8 - -""" - Open Device Management API - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: undefined - 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, Field, StrictBytes, StrictStr -from typing import Any, ClassVar, Dict, List, Optional, Union -from openapi_client.models.condition import Condition -from typing import Optional, Set -from typing_extensions import Self - -class CertificateSigningRequestStatus(BaseModel): - """ - Indicates approval/denial/failure status of the CSR, and contains the issued certifiate if any exists - """ # noqa: E501 - certificate: Optional[Union[StrictBytes, StrictStr]] = Field(default=None, description="The issued signed certificate, immutable once populated") - conditions: List[Condition] = Field(description="Conditions applied to the request. Known conditions are Approved, Denied, and Failed") - __properties: ClassVar[List[str]] = ["certificate", "conditions"] - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of CertificateSigningRequestStatus 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 conditions (list) - _items = [] - if self.conditions: - for _item_conditions in self.conditions: - if _item_conditions: - _items.append(_item_conditions.to_dict()) - _dict['conditions'] = _items - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of CertificateSigningRequestStatus from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "certificate": obj.get("certificate"), - "conditions": [Condition.from_dict(_item) for _item in obj["conditions"]] if obj.get("conditions") is not None else None - }) - return _obj - - diff --git a/openapi_client/models/condition.py b/openapi_client/models/condition.py deleted file mode 100644 index 2b6b354..0000000 --- a/openapi_client/models/condition.py +++ /dev/null @@ -1,100 +0,0 @@ -# coding: utf-8 - -""" - Open Device Management API - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: undefined - 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, Field, StrictInt, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from openapi_client.models.condition_status import ConditionStatus -from openapi_client.models.condition_type import ConditionType -from typing import Optional, Set -from typing_extensions import Self - -class Condition(BaseModel): - """ - Condition contains details for one aspect of the current state of this API Resource. - """ # noqa: E501 - type: ConditionType - status: ConditionStatus - observed_generation: Optional[StrictInt] = Field(default=None, description="The .metadata.generation that the condition was set based upon.", alias="observedGeneration") - last_transition_time: datetime = Field(description="The last time the condition transitioned from one status to another.", alias="lastTransitionTime") - message: StrictStr = Field(description="Human readable message indicating details about last transition.") - reason: StrictStr = Field(description="(brief) reason for the condition's last transition.") - __properties: ClassVar[List[str]] = ["type", "status", "observedGeneration", "lastTransitionTime", "message", "reason"] - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of Condition 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 Condition from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "type": obj.get("type"), - "status": obj.get("status"), - "observedGeneration": obj.get("observedGeneration"), - "lastTransitionTime": obj.get("lastTransitionTime"), - "message": obj.get("message"), - "reason": obj.get("reason") - }) - return _obj - - diff --git a/openapi_client/models/condition_status.py b/openapi_client/models/condition_status.py deleted file mode 100644 index e9a309c..0000000 --- a/openapi_client/models/condition_status.py +++ /dev/null @@ -1,38 +0,0 @@ -# coding: utf-8 - -""" - Open Device Management API - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: undefined - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import json -from enum import Enum -from typing_extensions import Self - - -class ConditionStatus(str, Enum): - """ - ConditionStatus - """ - - """ - allowed enum values - """ - TRUE = 'True' - FALSE = 'False' - UNKNOWN = 'Unknown' - - @classmethod - def from_json(cls, json_str: str) -> Self: - """Create an instance of ConditionStatus from a JSON string""" - return cls(json.loads(json_str)) - - diff --git a/openapi_client/models/condition_type.py b/openapi_client/models/condition_type.py deleted file mode 100644 index 9c16587..0000000 --- a/openapi_client/models/condition_type.py +++ /dev/null @@ -1,46 +0,0 @@ -# coding: utf-8 - -""" - Open Device Management API - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: undefined - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import json -from enum import Enum -from typing_extensions import Self - - -class ConditionType(str, Enum): - """ - ConditionType - """ - - """ - allowed enum values - """ - APPROVED = 'Approved' - DENIED = 'Denied' - FAILED = 'Failed' - ACCESSIBLE = 'Accessible' - RESOURCEPARSED = 'ResourceParsed' - SYNCED = 'Synced' - OVERLAPPINGSELECTORS = 'OverlappingSelectors' - VALID = 'Valid' - UPDATING = 'Updating' - SPECVALID = 'SpecValid' - MULTIPLEOWNERS = 'MultipleOwners' - - @classmethod - def from_json(cls, json_str: str) -> Self: - """Create an instance of ConditionType from a JSON string""" - return cls(json.loads(json_str)) - - diff --git a/openapi_client/models/config_provider_spec.py b/openapi_client/models/config_provider_spec.py deleted file mode 100644 index ce97e89..0000000 --- a/openapi_client/models/config_provider_spec.py +++ /dev/null @@ -1,165 +0,0 @@ -# coding: utf-8 - -""" - Open Device Management API - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: undefined - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import json -import pprint -from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator -from typing import Any, List, Optional -from openapi_client.models.git_config_provider_spec import GitConfigProviderSpec -from openapi_client.models.http_config_provider_spec import HttpConfigProviderSpec -from openapi_client.models.inline_config_provider_spec import InlineConfigProviderSpec -from openapi_client.models.kubernetes_secret_provider_spec import KubernetesSecretProviderSpec -from pydantic import StrictStr, Field -from typing import Union, List, Set, Optional, Dict -from typing_extensions import Literal, Self - -CONFIGPROVIDERSPEC_ONE_OF_SCHEMAS = ["GitConfigProviderSpec", "HttpConfigProviderSpec", "InlineConfigProviderSpec", "KubernetesSecretProviderSpec"] - -class ConfigProviderSpec(BaseModel): - """ - ConfigProviderSpec - """ - # data type: GitConfigProviderSpec - oneof_schema_1_validator: Optional[GitConfigProviderSpec] = None - # data type: KubernetesSecretProviderSpec - oneof_schema_2_validator: Optional[KubernetesSecretProviderSpec] = None - # data type: InlineConfigProviderSpec - oneof_schema_3_validator: Optional[InlineConfigProviderSpec] = None - # data type: HttpConfigProviderSpec - oneof_schema_4_validator: Optional[HttpConfigProviderSpec] = None - actual_instance: Optional[Union[GitConfigProviderSpec, HttpConfigProviderSpec, InlineConfigProviderSpec, KubernetesSecretProviderSpec]] = None - one_of_schemas: Set[str] = { "GitConfigProviderSpec", "HttpConfigProviderSpec", "InlineConfigProviderSpec", "KubernetesSecretProviderSpec" } - - model_config = ConfigDict( - validate_assignment=True, - protected_namespaces=(), - ) - - - def __init__(self, *args, **kwargs) -> None: - if args: - if len(args) > 1: - raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") - if kwargs: - raise ValueError("If a position argument is used, keyword arguments cannot be used.") - super().__init__(actual_instance=args[0]) - else: - super().__init__(**kwargs) - - @field_validator('actual_instance') - def actual_instance_must_validate_oneof(cls, v): - instance = ConfigProviderSpec.model_construct() - error_messages = [] - match = 0 - # validate data type: GitConfigProviderSpec - if not isinstance(v, GitConfigProviderSpec): - error_messages.append(f"Error! Input type `{type(v)}` is not `GitConfigProviderSpec`") - else: - match += 1 - # validate data type: KubernetesSecretProviderSpec - if not isinstance(v, KubernetesSecretProviderSpec): - error_messages.append(f"Error! Input type `{type(v)}` is not `KubernetesSecretProviderSpec`") - else: - match += 1 - # validate data type: InlineConfigProviderSpec - if not isinstance(v, InlineConfigProviderSpec): - error_messages.append(f"Error! Input type `{type(v)}` is not `InlineConfigProviderSpec`") - else: - match += 1 - # validate data type: HttpConfigProviderSpec - if not isinstance(v, HttpConfigProviderSpec): - error_messages.append(f"Error! Input type `{type(v)}` is not `HttpConfigProviderSpec`") - else: - match += 1 - if match > 1: - # more than 1 match - raise ValueError("Multiple matches found when setting `actual_instance` in ConfigProviderSpec with oneOf schemas: GitConfigProviderSpec, HttpConfigProviderSpec, InlineConfigProviderSpec, KubernetesSecretProviderSpec. Details: " + ", ".join(error_messages)) - elif match == 0: - # no match - raise ValueError("No match found when setting `actual_instance` in ConfigProviderSpec with oneOf schemas: GitConfigProviderSpec, HttpConfigProviderSpec, InlineConfigProviderSpec, KubernetesSecretProviderSpec. Details: " + ", ".join(error_messages)) - else: - return v - - @classmethod - def from_dict(cls, obj: Union[str, Dict[str, Any]]) -> Self: - return cls.from_json(json.dumps(obj)) - - @classmethod - def from_json(cls, json_str: str) -> Self: - """Returns the object represented by the json string""" - instance = cls.model_construct() - error_messages = [] - match = 0 - - # deserialize data into GitConfigProviderSpec - try: - instance.actual_instance = GitConfigProviderSpec.from_json(json_str) - match += 1 - except (ValidationError, ValueError) as e: - error_messages.append(str(e)) - # deserialize data into KubernetesSecretProviderSpec - try: - instance.actual_instance = KubernetesSecretProviderSpec.from_json(json_str) - match += 1 - except (ValidationError, ValueError) as e: - error_messages.append(str(e)) - # deserialize data into InlineConfigProviderSpec - try: - instance.actual_instance = InlineConfigProviderSpec.from_json(json_str) - match += 1 - except (ValidationError, ValueError) as e: - error_messages.append(str(e)) - # deserialize data into HttpConfigProviderSpec - try: - instance.actual_instance = HttpConfigProviderSpec.from_json(json_str) - match += 1 - except (ValidationError, ValueError) as e: - error_messages.append(str(e)) - - if match > 1: - # more than 1 match - raise ValueError("Multiple matches found when deserializing the JSON string into ConfigProviderSpec with oneOf schemas: GitConfigProviderSpec, HttpConfigProviderSpec, InlineConfigProviderSpec, KubernetesSecretProviderSpec. Details: " + ", ".join(error_messages)) - elif match == 0: - # no match - raise ValueError("No match found when deserializing the JSON string into ConfigProviderSpec with oneOf schemas: GitConfigProviderSpec, HttpConfigProviderSpec, InlineConfigProviderSpec, KubernetesSecretProviderSpec. Details: " + ", ".join(error_messages)) - else: - return instance - - def to_json(self) -> str: - """Returns the JSON representation of the actual instance""" - if self.actual_instance is None: - return "null" - - if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): - return self.actual_instance.to_json() - else: - return json.dumps(self.actual_instance) - - def to_dict(self) -> Optional[Union[Dict[str, Any], GitConfigProviderSpec, HttpConfigProviderSpec, InlineConfigProviderSpec, KubernetesSecretProviderSpec]]: - """Returns the dict representation of the actual instance""" - if self.actual_instance is None: - return None - - if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): - return self.actual_instance.to_dict() - else: - # primitive type - return self.actual_instance - - def to_str(self) -> str: - """Returns the string representation of the actual instance""" - return pprint.pformat(self.model_dump()) - - diff --git a/openapi_client/models/cpu_resource_monitor_spec.py b/openapi_client/models/cpu_resource_monitor_spec.py deleted file mode 100644 index ec61919..0000000 --- a/openapi_client/models/cpu_resource_monitor_spec.py +++ /dev/null @@ -1,107 +0,0 @@ -# coding: utf-8 - -""" - Open Device Management API - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: undefined - 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, Field, StrictStr, field_validator -from typing import Any, ClassVar, Dict, List -from typing_extensions import Annotated -from openapi_client.models.resource_alert_rule import ResourceAlertRule -from typing import Optional, Set -from typing_extensions import Self - -class CPUResourceMonitorSpec(BaseModel): - """ - CPUResourceMonitorSpec - """ # noqa: E501 - monitor_type: StrictStr = Field(alias="monitorType") - alert_rules: List[ResourceAlertRule] = Field(description="Array of alert rules. Only one alert per severity is allowed.", alias="alertRules") - sampling_interval: Annotated[str, Field(strict=True)] = Field(description="Duration between monitor samples. Format: positive integer followed by 's' for seconds, 'm' for minutes, 'h' for hours.", alias="samplingInterval") - __properties: ClassVar[List[str]] = ["monitorType", "alertRules", "samplingInterval"] - - @field_validator('sampling_interval') - def sampling_interval_validate_regular_expression(cls, value): - """Validates the regular expression""" - if not re.match(r"^[1-9]\d*[smh]$", value): - raise ValueError(r"must validate the regular expression /^[1-9]\d*[smh]$/") - return value - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of CPUResourceMonitorSpec 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 alert_rules (list) - _items = [] - if self.alert_rules: - for _item_alert_rules in self.alert_rules: - if _item_alert_rules: - _items.append(_item_alert_rules.to_dict()) - _dict['alertRules'] = _items - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of CPUResourceMonitorSpec from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "monitorType": obj.get("monitorType"), - "alertRules": [ResourceAlertRule.from_dict(_item) for _item in obj["alertRules"]] if obj.get("alertRules") is not None else None, - "samplingInterval": obj.get("samplingInterval") - }) - return _obj - - diff --git a/openapi_client/models/custom_resource_monitor_spec.py b/openapi_client/models/custom_resource_monitor_spec.py deleted file mode 100644 index 0c76b77..0000000 --- a/openapi_client/models/custom_resource_monitor_spec.py +++ /dev/null @@ -1,107 +0,0 @@ -# coding: utf-8 - -""" - Open Device Management API - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: undefined - 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, Field, StrictStr, field_validator -from typing import Any, ClassVar, Dict, List -from typing_extensions import Annotated -from openapi_client.models.resource_alert_rule import ResourceAlertRule -from typing import Optional, Set -from typing_extensions import Self - -class CustomResourceMonitorSpec(BaseModel): - """ - CustomResourceMonitorSpec - """ # noqa: E501 - monitor_type: StrictStr = Field(alias="monitorType") - alert_rules: List[ResourceAlertRule] = Field(description="Array of alert rules. Only one alert per severity is allowed.", alias="alertRules") - sampling_interval: Annotated[str, Field(strict=True)] = Field(description="Duration between monitor samples. Format: positive integer followed by 's' for seconds, 'm' for minutes, 'h' for hours.", alias="samplingInterval") - __properties: ClassVar[List[str]] = ["monitorType", "alertRules", "samplingInterval"] - - @field_validator('sampling_interval') - def sampling_interval_validate_regular_expression(cls, value): - """Validates the regular expression""" - if not re.match(r"^[1-9]\d*[smh]$", value): - raise ValueError(r"must validate the regular expression /^[1-9]\d*[smh]$/") - return value - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of CustomResourceMonitorSpec 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 alert_rules (list) - _items = [] - if self.alert_rules: - for _item_alert_rules in self.alert_rules: - if _item_alert_rules: - _items.append(_item_alert_rules.to_dict()) - _dict['alertRules'] = _items - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of CustomResourceMonitorSpec from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "monitorType": obj.get("monitorType"), - "alertRules": [ResourceAlertRule.from_dict(_item) for _item in obj["alertRules"]] if obj.get("alertRules") is not None else None, - "samplingInterval": obj.get("samplingInterval") - }) - return _obj - - diff --git a/openapi_client/models/device.py b/openapi_client/models/device.py deleted file mode 100644 index 524ac9c..0000000 --- a/openapi_client/models/device.py +++ /dev/null @@ -1,107 +0,0 @@ -# coding: utf-8 - -""" - Open Device Management API - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: undefined - 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, Field, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from openapi_client.models.device_spec import DeviceSpec -from openapi_client.models.device_status import DeviceStatus -from openapi_client.models.object_meta import ObjectMeta -from typing import Optional, Set -from typing_extensions import Self - -class Device(BaseModel): - """ - Device represents a physical device. - """ # noqa: E501 - api_version: StrictStr = Field(description="APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", alias="apiVersion") - kind: StrictStr = Field(description="Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds") - metadata: ObjectMeta - spec: Optional[DeviceSpec] = None - status: Optional[DeviceStatus] = None - __properties: ClassVar[List[str]] = ["apiVersion", "kind", "metadata", "spec", "status"] - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of Device 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 metadata - if self.metadata: - _dict['metadata'] = self.metadata.to_dict() - # override the default output from pydantic by calling `to_dict()` of spec - if self.spec: - _dict['spec'] = self.spec.to_dict() - # override the default output from pydantic by calling `to_dict()` of status - if self.status: - _dict['status'] = self.status.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of Device from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "apiVersion": obj.get("apiVersion"), - "kind": obj.get("kind"), - "metadata": ObjectMeta.from_dict(obj["metadata"]) if obj.get("metadata") is not None else None, - "spec": DeviceSpec.from_dict(obj["spec"]) if obj.get("spec") is not None else None, - "status": DeviceStatus.from_dict(obj["status"]) if obj.get("status") is not None else None - }) - return _obj - - diff --git a/openapi_client/models/device_application_status.py b/openapi_client/models/device_application_status.py deleted file mode 100644 index ff593c1..0000000 --- a/openapi_client/models/device_application_status.py +++ /dev/null @@ -1,94 +0,0 @@ -# coding: utf-8 - -""" - Open Device Management API - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: undefined - 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, Field, StrictInt, StrictStr -from typing import Any, ClassVar, Dict, List -from openapi_client.models.application_status_type import ApplicationStatusType -from typing import Optional, Set -from typing_extensions import Self - -class DeviceApplicationStatus(BaseModel): - """ - DeviceApplicationStatus - """ # noqa: E501 - name: StrictStr = Field(description="Human readable name of the application.") - ready: StrictStr = Field(description="The number of containers which are ready in the application.") - restarts: StrictInt = Field(description="Number of restarts observed for the application.") - status: ApplicationStatusType - __properties: ClassVar[List[str]] = ["name", "ready", "restarts", "status"] - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of DeviceApplicationStatus 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 DeviceApplicationStatus 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"), - "ready": obj.get("ready"), - "restarts": obj.get("restarts"), - "status": obj.get("status") - }) - return _obj - - diff --git a/openapi_client/models/device_applications_summary_status.py b/openapi_client/models/device_applications_summary_status.py deleted file mode 100644 index 17a08bc..0000000 --- a/openapi_client/models/device_applications_summary_status.py +++ /dev/null @@ -1,90 +0,0 @@ -# coding: utf-8 - -""" - Open Device Management API - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: undefined - 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, Field, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from openapi_client.models.applications_summary_status_type import ApplicationsSummaryStatusType -from typing import Optional, Set -from typing_extensions import Self - -class DeviceApplicationsSummaryStatus(BaseModel): - """ - DeviceApplicationsSummaryStatus - """ # noqa: E501 - status: ApplicationsSummaryStatusType - info: Optional[StrictStr] = Field(default=None, description="Human readable information detailing the last system application transition.") - __properties: ClassVar[List[str]] = ["status", "info"] - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of DeviceApplicationsSummaryStatus 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 DeviceApplicationsSummaryStatus from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "status": obj.get("status"), - "info": obj.get("info") - }) - return _obj - - diff --git a/openapi_client/models/device_config_status.py b/openapi_client/models/device_config_status.py deleted file mode 100644 index 864926a..0000000 --- a/openapi_client/models/device_config_status.py +++ /dev/null @@ -1,87 +0,0 @@ -# coding: utf-8 - -""" - Open Device Management API - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: undefined - 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, Field, StrictStr -from typing import Any, ClassVar, Dict, List -from typing import Optional, Set -from typing_extensions import Self - -class DeviceConfigStatus(BaseModel): - """ - DeviceConfigStatus - """ # noqa: E501 - rendered_version: StrictStr = Field(description="Version of the device rendered config.", alias="renderedVersion") - __properties: ClassVar[List[str]] = ["renderedVersion"] - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of DeviceConfigStatus 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 DeviceConfigStatus from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "renderedVersion": obj.get("renderedVersion") - }) - return _obj - - diff --git a/openapi_client/models/device_console.py b/openapi_client/models/device_console.py deleted file mode 100644 index 3c35588..0000000 --- a/openapi_client/models/device_console.py +++ /dev/null @@ -1,89 +0,0 @@ -# coding: utf-8 - -""" - Open Device Management API - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: undefined - 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, Field, StrictStr -from typing import Any, ClassVar, Dict, List -from typing import Optional, Set -from typing_extensions import Self - -class DeviceConsole(BaseModel): - """ - DeviceConsole - """ # noqa: E501 - g_rpc_endpoint: StrictStr = Field(alias="gRPCEndpoint") - session_id: StrictStr = Field(alias="sessionID") - __properties: ClassVar[List[str]] = ["gRPCEndpoint", "sessionID"] - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of DeviceConsole 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 DeviceConsole from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "gRPCEndpoint": obj.get("gRPCEndpoint"), - "sessionID": obj.get("sessionID") - }) - return _obj - - diff --git a/openapi_client/models/device_hooks_spec.py b/openapi_client/models/device_hooks_spec.py deleted file mode 100644 index c4f9032..0000000 --- a/openapi_client/models/device_hooks_spec.py +++ /dev/null @@ -1,123 +0,0 @@ -# coding: utf-8 - -""" - Open Device Management API - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: undefined - 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, Field -from typing import Any, ClassVar, Dict, List, Optional -from openapi_client.models.device_reboot_hook_spec import DeviceRebootHookSpec -from openapi_client.models.device_update_hook_spec import DeviceUpdateHookSpec -from typing import Optional, Set -from typing_extensions import Self - -class DeviceHooksSpec(BaseModel): - """ - DeviceHooksSpec - """ # noqa: E501 - before_updating: Optional[List[DeviceUpdateHookSpec]] = Field(default=None, description="Hooks executed before updating allow for custom actions and integration with other systems or services. These actions occur before configuration changes are applied to the device. ", alias="beforeUpdating") - after_updating: Optional[List[DeviceUpdateHookSpec]] = Field(default=None, description="Hooks executed after updating enable custom actions and integration with other systems or services. These actions occur after configuration changes have been applied to the device. ", alias="afterUpdating") - before_rebooting: Optional[List[DeviceRebootHookSpec]] = Field(default=None, description="Hooks executed before rebooting allow for custom actions and integration with other systems or services. These actions occur before the device is rebooted. ", alias="beforeRebooting") - after_rebooting: Optional[List[DeviceRebootHookSpec]] = Field(default=None, description="Hooks executed after rebooting enable custom actions and integration with other systems or services. These actions occur after the device has rebooted, allowing for post-reboot tasks. ", alias="afterRebooting") - __properties: ClassVar[List[str]] = ["beforeUpdating", "afterUpdating", "beforeRebooting", "afterRebooting"] - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of DeviceHooksSpec 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 before_updating (list) - _items = [] - if self.before_updating: - for _item_before_updating in self.before_updating: - if _item_before_updating: - _items.append(_item_before_updating.to_dict()) - _dict['beforeUpdating'] = _items - # override the default output from pydantic by calling `to_dict()` of each item in after_updating (list) - _items = [] - if self.after_updating: - for _item_after_updating in self.after_updating: - if _item_after_updating: - _items.append(_item_after_updating.to_dict()) - _dict['afterUpdating'] = _items - # override the default output from pydantic by calling `to_dict()` of each item in before_rebooting (list) - _items = [] - if self.before_rebooting: - for _item_before_rebooting in self.before_rebooting: - if _item_before_rebooting: - _items.append(_item_before_rebooting.to_dict()) - _dict['beforeRebooting'] = _items - # override the default output from pydantic by calling `to_dict()` of each item in after_rebooting (list) - _items = [] - if self.after_rebooting: - for _item_after_rebooting in self.after_rebooting: - if _item_after_rebooting: - _items.append(_item_after_rebooting.to_dict()) - _dict['afterRebooting'] = _items - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of DeviceHooksSpec from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "beforeUpdating": [DeviceUpdateHookSpec.from_dict(_item) for _item in obj["beforeUpdating"]] if obj.get("beforeUpdating") is not None else None, - "afterUpdating": [DeviceUpdateHookSpec.from_dict(_item) for _item in obj["afterUpdating"]] if obj.get("afterUpdating") is not None else None, - "beforeRebooting": [DeviceRebootHookSpec.from_dict(_item) for _item in obj["beforeRebooting"]] if obj.get("beforeRebooting") is not None else None, - "afterRebooting": [DeviceRebootHookSpec.from_dict(_item) for _item in obj["afterRebooting"]] if obj.get("afterRebooting") is not None else None - }) - return _obj - - diff --git a/openapi_client/models/device_integrity_status.py b/openapi_client/models/device_integrity_status.py deleted file mode 100644 index 65e9b38..0000000 --- a/openapi_client/models/device_integrity_status.py +++ /dev/null @@ -1,91 +0,0 @@ -# coding: utf-8 - -""" - Open Device Management API - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: undefined - 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 -from openapi_client.models.device_integrity_status_summary import DeviceIntegrityStatusSummary -from typing import Optional, Set -from typing_extensions import Self - -class DeviceIntegrityStatus(BaseModel): - """ - DeviceIntegrityStatus - """ # noqa: E501 - summary: DeviceIntegrityStatusSummary - __properties: ClassVar[List[str]] = ["summary"] - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of DeviceIntegrityStatus 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 summary - if self.summary: - _dict['summary'] = self.summary.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of DeviceIntegrityStatus from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "summary": DeviceIntegrityStatusSummary.from_dict(obj["summary"]) if obj.get("summary") is not None else None - }) - return _obj - - diff --git a/openapi_client/models/device_integrity_status_summary.py b/openapi_client/models/device_integrity_status_summary.py deleted file mode 100644 index 95aeedb..0000000 --- a/openapi_client/models/device_integrity_status_summary.py +++ /dev/null @@ -1,90 +0,0 @@ -# coding: utf-8 - -""" - Open Device Management API - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: undefined - 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, Field, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from openapi_client.models.device_integrity_status_summary_type import DeviceIntegrityStatusSummaryType -from typing import Optional, Set -from typing_extensions import Self - -class DeviceIntegrityStatusSummary(BaseModel): - """ - DeviceIntegrityStatusSummary - """ # noqa: E501 - status: DeviceIntegrityStatusSummaryType - info: Optional[StrictStr] = Field(default=None, description="Human readable information about the last integrity transition.") - __properties: ClassVar[List[str]] = ["status", "info"] - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of DeviceIntegrityStatusSummary 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 DeviceIntegrityStatusSummary from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "status": obj.get("status"), - "info": obj.get("info") - }) - return _obj - - diff --git a/openapi_client/models/device_integrity_status_summary_type.py b/openapi_client/models/device_integrity_status_summary_type.py deleted file mode 100644 index 0f724ab..0000000 --- a/openapi_client/models/device_integrity_status_summary_type.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - Open Device Management API - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: undefined - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import json -from enum import Enum -from typing_extensions import Self - - -class DeviceIntegrityStatusSummaryType(str, Enum): - """ - DeviceIntegrityStatusSummaryType - """ - - """ - allowed enum values - """ - PASSED = 'Passed' - FAILED = 'Failed' - UNKNOWN = 'Unknown' - UNSUPPORTED = 'Unsupported' - - @classmethod - def from_json(cls, json_str: str) -> Self: - """Create an instance of DeviceIntegrityStatusSummaryType from a JSON string""" - return cls(json.loads(json_str)) - - diff --git a/openapi_client/models/device_list.py b/openapi_client/models/device_list.py deleted file mode 100644 index bc0a3b8..0000000 --- a/openapi_client/models/device_list.py +++ /dev/null @@ -1,111 +0,0 @@ -# coding: utf-8 - -""" - Open Device Management API - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: undefined - 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, Field, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from openapi_client.models.device import Device -from openapi_client.models.devices_summary import DevicesSummary -from openapi_client.models.list_meta import ListMeta -from typing import Optional, Set -from typing_extensions import Self - -class DeviceList(BaseModel): - """ - DeviceList is a list of Devices. - """ # noqa: E501 - api_version: StrictStr = Field(description="APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", alias="apiVersion") - kind: StrictStr = Field(description="Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds") - metadata: ListMeta - items: List[Device] = Field(description="List of Devices.") - summary: Optional[DevicesSummary] = None - __properties: ClassVar[List[str]] = ["apiVersion", "kind", "metadata", "items", "summary"] - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of DeviceList 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 metadata - if self.metadata: - _dict['metadata'] = self.metadata.to_dict() - # override the default output from pydantic by calling `to_dict()` of each item in items (list) - _items = [] - if self.items: - for _item_items in self.items: - if _item_items: - _items.append(_item_items.to_dict()) - _dict['items'] = _items - # override the default output from pydantic by calling `to_dict()` of summary - if self.summary: - _dict['summary'] = self.summary.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of DeviceList from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "apiVersion": obj.get("apiVersion"), - "kind": obj.get("kind"), - "metadata": ListMeta.from_dict(obj["metadata"]) if obj.get("metadata") is not None else None, - "items": [Device.from_dict(_item) for _item in obj["items"]] if obj.get("items") is not None else None, - "summary": DevicesSummary.from_dict(obj["summary"]) if obj.get("summary") is not None else None - }) - return _obj - - diff --git a/openapi_client/models/device_os_spec.py b/openapi_client/models/device_os_spec.py deleted file mode 100644 index 1cd05a7..0000000 --- a/openapi_client/models/device_os_spec.py +++ /dev/null @@ -1,87 +0,0 @@ -# coding: utf-8 - -""" - Open Device Management API - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: undefined - 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, Field, StrictStr -from typing import Any, ClassVar, Dict, List -from typing import Optional, Set -from typing_extensions import Self - -class DeviceOSSpec(BaseModel): - """ - DeviceOSSpec - """ # noqa: E501 - image: StrictStr = Field(description="ostree image name or URL.") - __properties: ClassVar[List[str]] = ["image"] - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of DeviceOSSpec 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 DeviceOSSpec from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "image": obj.get("image") - }) - return _obj - - diff --git a/openapi_client/models/device_os_status.py b/openapi_client/models/device_os_status.py deleted file mode 100644 index 8a3b666..0000000 --- a/openapi_client/models/device_os_status.py +++ /dev/null @@ -1,89 +0,0 @@ -# coding: utf-8 - -""" - Open Device Management API - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: undefined - 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, Field, StrictStr -from typing import Any, ClassVar, Dict, List -from typing import Optional, Set -from typing_extensions import Self - -class DeviceOSStatus(BaseModel): - """ - DeviceOSStatus - """ # noqa: E501 - image: StrictStr = Field(description="Version of the OS image.") - image_digest: StrictStr = Field(description="The digest of the OS image (e.g. sha256:a0...)", alias="imageDigest") - __properties: ClassVar[List[str]] = ["image", "imageDigest"] - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of DeviceOSStatus 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 DeviceOSStatus from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "image": obj.get("image"), - "imageDigest": obj.get("imageDigest") - }) - return _obj - - diff --git a/openapi_client/models/device_reboot_hook_spec.py b/openapi_client/models/device_reboot_hook_spec.py deleted file mode 100644 index 9996437..0000000 --- a/openapi_client/models/device_reboot_hook_spec.py +++ /dev/null @@ -1,99 +0,0 @@ -# coding: utf-8 - -""" - Open Device Management API - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: undefined - 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, Field, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from openapi_client.models.hook_action import HookAction -from typing import Optional, Set -from typing_extensions import Self - -class DeviceRebootHookSpec(BaseModel): - """ - DeviceRebootHookSpec - """ # noqa: E501 - name: Optional[StrictStr] = None - description: Optional[StrictStr] = None - actions: List[HookAction] = Field(description="The actions taken before and after system reboots are observed. Each action is executed in the order they are defined.") - __properties: ClassVar[List[str]] = ["name", "description", "actions"] - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of DeviceRebootHookSpec 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 actions (list) - _items = [] - if self.actions: - for _item_actions in self.actions: - if _item_actions: - _items.append(_item_actions.to_dict()) - _dict['actions'] = _items - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of DeviceRebootHookSpec 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"), - "actions": [HookAction.from_dict(_item) for _item in obj["actions"]] if obj.get("actions") is not None else None - }) - return _obj - - diff --git a/openapi_client/models/device_resource_status.py b/openapi_client/models/device_resource_status.py deleted file mode 100644 index 30a20b5..0000000 --- a/openapi_client/models/device_resource_status.py +++ /dev/null @@ -1,92 +0,0 @@ -# coding: utf-8 - -""" - Open Device Management API - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: undefined - 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 -from openapi_client.models.device_resource_status_type import DeviceResourceStatusType -from typing import Optional, Set -from typing_extensions import Self - -class DeviceResourceStatus(BaseModel): - """ - DeviceResourceStatus - """ # noqa: E501 - cpu: DeviceResourceStatusType - memory: DeviceResourceStatusType - disk: DeviceResourceStatusType - __properties: ClassVar[List[str]] = ["cpu", "memory", "disk"] - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of DeviceResourceStatus 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 DeviceResourceStatus from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "cpu": obj.get("cpu"), - "memory": obj.get("memory"), - "disk": obj.get("disk") - }) - return _obj - - diff --git a/openapi_client/models/device_resource_status_type.py b/openapi_client/models/device_resource_status_type.py deleted file mode 100644 index f357232..0000000 --- a/openapi_client/models/device_resource_status_type.py +++ /dev/null @@ -1,40 +0,0 @@ -# coding: utf-8 - -""" - Open Device Management API - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: undefined - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import json -from enum import Enum -from typing_extensions import Self - - -class DeviceResourceStatusType(str, Enum): - """ - DeviceResourceStatusType - """ - - """ - allowed enum values - """ - HEALTHY = 'Healthy' - WARNING = 'Warning' - CRITICAL = 'Critical' - ERROR = 'Error' - UNKNOWN = 'Unknown' - - @classmethod - def from_json(cls, json_str: str) -> Self: - """Create an instance of DeviceResourceStatusType from a JSON string""" - return cls(json.loads(json_str)) - - diff --git a/openapi_client/models/device_spec.py b/openapi_client/models/device_spec.py deleted file mode 100644 index 3440d97..0000000 --- a/openapi_client/models/device_spec.py +++ /dev/null @@ -1,133 +0,0 @@ -# coding: utf-8 - -""" - Open Device Management API - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: undefined - 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, Field -from typing import Any, ClassVar, Dict, List, Optional -from openapi_client.models.application_spec import ApplicationSpec -from openapi_client.models.config_provider_spec import ConfigProviderSpec -from openapi_client.models.device_hooks_spec import DeviceHooksSpec -from openapi_client.models.device_os_spec import DeviceOSSpec -from openapi_client.models.device_spec_systemd import DeviceSpecSystemd -from openapi_client.models.resource_monitor import ResourceMonitor -from typing import Optional, Set -from typing_extensions import Self - -class DeviceSpec(BaseModel): - """ - DeviceSpec - """ # noqa: E501 - os: Optional[DeviceOSSpec] = None - config: Optional[List[ConfigProviderSpec]] = Field(default=None, description="List of config providers.") - hooks: Optional[DeviceHooksSpec] = None - applications: Optional[List[ApplicationSpec]] = Field(default=None, description="List of applications.") - systemd: Optional[DeviceSpecSystemd] = None - resources: Optional[List[ResourceMonitor]] = Field(default=None, description="Array of resource monitor configurations.") - __properties: ClassVar[List[str]] = ["os", "config", "hooks", "applications", "systemd", "resources"] - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of DeviceSpec 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 os - if self.os: - _dict['os'] = self.os.to_dict() - # override the default output from pydantic by calling `to_dict()` of each item in config (list) - _items = [] - if self.config: - for _item_config in self.config: - if _item_config: - _items.append(_item_config.to_dict()) - _dict['config'] = _items - # override the default output from pydantic by calling `to_dict()` of hooks - if self.hooks: - _dict['hooks'] = self.hooks.to_dict() - # override the default output from pydantic by calling `to_dict()` of each item in applications (list) - _items = [] - if self.applications: - for _item_applications in self.applications: - if _item_applications: - _items.append(_item_applications.to_dict()) - _dict['applications'] = _items - # override the default output from pydantic by calling `to_dict()` of systemd - if self.systemd: - _dict['systemd'] = self.systemd.to_dict() - # override the default output from pydantic by calling `to_dict()` of each item in resources (list) - _items = [] - if self.resources: - for _item_resources in self.resources: - if _item_resources: - _items.append(_item_resources.to_dict()) - _dict['resources'] = _items - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of DeviceSpec from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "os": DeviceOSSpec.from_dict(obj["os"]) if obj.get("os") is not None else None, - "config": [ConfigProviderSpec.from_dict(_item) for _item in obj["config"]] if obj.get("config") is not None else None, - "hooks": DeviceHooksSpec.from_dict(obj["hooks"]) if obj.get("hooks") is not None else None, - "applications": [ApplicationSpec.from_dict(_item) for _item in obj["applications"]] if obj.get("applications") is not None else None, - "systemd": DeviceSpecSystemd.from_dict(obj["systemd"]) if obj.get("systemd") is not None else None, - "resources": [ResourceMonitor.from_dict(_item) for _item in obj["resources"]] if obj.get("resources") is not None else None - }) - return _obj - - diff --git a/openapi_client/models/device_spec_systemd.py b/openapi_client/models/device_spec_systemd.py deleted file mode 100644 index 5b36604..0000000 --- a/openapi_client/models/device_spec_systemd.py +++ /dev/null @@ -1,88 +0,0 @@ -# coding: utf-8 - -""" - Open Device Management API - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: undefined - 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, Field, field_validator -from typing import Any, ClassVar, Dict, List, Optional -from typing_extensions import Annotated -from typing import Optional, Set -from typing_extensions import Self - -class DeviceSpecSystemd(BaseModel): - """ - DeviceSpecSystemd - """ # noqa: E501 - match_patterns: Optional[List[Annotated[str, Field(strict=True, max_length=256)]]] = Field(default=None, alias="matchPatterns") - __properties: ClassVar[List[str]] = ["matchPatterns"] - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of DeviceSpecSystemd 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 DeviceSpecSystemd from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "matchPatterns": obj.get("matchPatterns") - }) - return _obj - - diff --git a/openapi_client/models/device_status.py b/openapi_client/models/device_status.py deleted file mode 100644 index cbb36bb..0000000 --- a/openapi_client/models/device_status.py +++ /dev/null @@ -1,156 +0,0 @@ -# coding: utf-8 - -""" - Open Device Management API - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: undefined - 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, Field -from typing import Any, ClassVar, Dict, List -from openapi_client.models.condition import Condition -from openapi_client.models.device_application_status import DeviceApplicationStatus -from openapi_client.models.device_applications_summary_status import DeviceApplicationsSummaryStatus -from openapi_client.models.device_config_status import DeviceConfigStatus -from openapi_client.models.device_integrity_status import DeviceIntegrityStatus -from openapi_client.models.device_os_status import DeviceOSStatus -from openapi_client.models.device_resource_status import DeviceResourceStatus -from openapi_client.models.device_summary_status import DeviceSummaryStatus -from openapi_client.models.device_system_info import DeviceSystemInfo -from openapi_client.models.device_updated_status import DeviceUpdatedStatus -from typing import Optional, Set -from typing_extensions import Self - -class DeviceStatus(BaseModel): - """ - DeviceStatus represents information about the status of a device. Status may trail the actual state of a device. - """ # noqa: E501 - conditions: List[Condition] = Field(description="Conditions represent the observations of a the current state of a device.") - system_info: DeviceSystemInfo = Field(alias="systemInfo") - applications: List[DeviceApplicationStatus] = Field(description="List of device application status.") - applications_summary: DeviceApplicationsSummaryStatus = Field(alias="applicationsSummary") - resources: DeviceResourceStatus - integrity: DeviceIntegrityStatus - config: DeviceConfigStatus - os: DeviceOSStatus - updated: DeviceUpdatedStatus - summary: DeviceSummaryStatus - last_seen: datetime = Field(alias="lastSeen") - __properties: ClassVar[List[str]] = ["conditions", "systemInfo", "applications", "applicationsSummary", "resources", "integrity", "config", "os", "updated", "summary", "lastSeen"] - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of DeviceStatus 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 conditions (list) - _items = [] - if self.conditions: - for _item_conditions in self.conditions: - if _item_conditions: - _items.append(_item_conditions.to_dict()) - _dict['conditions'] = _items - # override the default output from pydantic by calling `to_dict()` of system_info - if self.system_info: - _dict['systemInfo'] = self.system_info.to_dict() - # override the default output from pydantic by calling `to_dict()` of each item in applications (list) - _items = [] - if self.applications: - for _item_applications in self.applications: - if _item_applications: - _items.append(_item_applications.to_dict()) - _dict['applications'] = _items - # override the default output from pydantic by calling `to_dict()` of applications_summary - if self.applications_summary: - _dict['applicationsSummary'] = self.applications_summary.to_dict() - # override the default output from pydantic by calling `to_dict()` of resources - if self.resources: - _dict['resources'] = self.resources.to_dict() - # override the default output from pydantic by calling `to_dict()` of integrity - if self.integrity: - _dict['integrity'] = self.integrity.to_dict() - # override the default output from pydantic by calling `to_dict()` of config - if self.config: - _dict['config'] = self.config.to_dict() - # override the default output from pydantic by calling `to_dict()` of os - if self.os: - _dict['os'] = self.os.to_dict() - # override the default output from pydantic by calling `to_dict()` of updated - if self.updated: - _dict['updated'] = self.updated.to_dict() - # override the default output from pydantic by calling `to_dict()` of summary - if self.summary: - _dict['summary'] = self.summary.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of DeviceStatus from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "conditions": [Condition.from_dict(_item) for _item in obj["conditions"]] if obj.get("conditions") is not None else None, - "systemInfo": DeviceSystemInfo.from_dict(obj["systemInfo"]) if obj.get("systemInfo") is not None else None, - "applications": [DeviceApplicationStatus.from_dict(_item) for _item in obj["applications"]] if obj.get("applications") is not None else None, - "applicationsSummary": DeviceApplicationsSummaryStatus.from_dict(obj["applicationsSummary"]) if obj.get("applicationsSummary") is not None else None, - "resources": DeviceResourceStatus.from_dict(obj["resources"]) if obj.get("resources") is not None else None, - "integrity": DeviceIntegrityStatus.from_dict(obj["integrity"]) if obj.get("integrity") is not None else None, - "config": DeviceConfigStatus.from_dict(obj["config"]) if obj.get("config") is not None else None, - "os": DeviceOSStatus.from_dict(obj["os"]) if obj.get("os") is not None else None, - "updated": DeviceUpdatedStatus.from_dict(obj["updated"]) if obj.get("updated") is not None else None, - "summary": DeviceSummaryStatus.from_dict(obj["summary"]) if obj.get("summary") is not None else None, - "lastSeen": obj.get("lastSeen") - }) - return _obj - - diff --git a/openapi_client/models/device_summary_status.py b/openapi_client/models/device_summary_status.py deleted file mode 100644 index 696ccc5..0000000 --- a/openapi_client/models/device_summary_status.py +++ /dev/null @@ -1,90 +0,0 @@ -# coding: utf-8 - -""" - Open Device Management API - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: undefined - 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, Field, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from openapi_client.models.device_summary_status_type import DeviceSummaryStatusType -from typing import Optional, Set -from typing_extensions import Self - -class DeviceSummaryStatus(BaseModel): - """ - DeviceSummaryStatus - """ # noqa: E501 - status: DeviceSummaryStatusType - info: Optional[StrictStr] = Field(default=None, description="Human readable information detailing the last device status transition.") - __properties: ClassVar[List[str]] = ["status", "info"] - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of DeviceSummaryStatus 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 DeviceSummaryStatus from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "status": obj.get("status"), - "info": obj.get("info") - }) - return _obj - - diff --git a/openapi_client/models/device_summary_status_type.py b/openapi_client/models/device_summary_status_type.py deleted file mode 100644 index 01c7a48..0000000 --- a/openapi_client/models/device_summary_status_type.py +++ /dev/null @@ -1,41 +0,0 @@ -# coding: utf-8 - -""" - Open Device Management API - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: undefined - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import json -from enum import Enum -from typing_extensions import Self - - -class DeviceSummaryStatusType(str, Enum): - """ - DeviceSummaryStatusType - """ - - """ - allowed enum values - """ - ONLINE = 'Online' - DEGRADED = 'Degraded' - ERROR = 'Error' - REBOOTING = 'Rebooting' - POWEREDOFF = 'PoweredOff' - UNKNOWN = 'Unknown' - - @classmethod - def from_json(cls, json_str: str) -> Self: - """Create an instance of DeviceSummaryStatusType from a JSON string""" - return cls(json.loads(json_str)) - - diff --git a/openapi_client/models/device_system_info.py b/openapi_client/models/device_system_info.py deleted file mode 100644 index d180716..0000000 --- a/openapi_client/models/device_system_info.py +++ /dev/null @@ -1,91 +0,0 @@ -# coding: utf-8 - -""" - Open Device Management API - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: undefined - 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, Field, StrictStr -from typing import Any, ClassVar, Dict, List -from typing import Optional, Set -from typing_extensions import Self - -class DeviceSystemInfo(BaseModel): - """ - DeviceSystemInfo is a set of ids/uuids to uniquely identify the device. - """ # noqa: E501 - architecture: StrictStr = Field(description="The Architecture reported by the device.") - boot_id: StrictStr = Field(description="Boot ID reported by the device.", alias="bootID") - operating_system: StrictStr = Field(description="The Operating System reported by the device.", alias="operatingSystem") - __properties: ClassVar[List[str]] = ["architecture", "bootID", "operatingSystem"] - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of DeviceSystemInfo 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 DeviceSystemInfo from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "architecture": obj.get("architecture"), - "bootID": obj.get("bootID"), - "operatingSystem": obj.get("operatingSystem") - }) - return _obj - - diff --git a/openapi_client/models/device_update_hook_spec.py b/openapi_client/models/device_update_hook_spec.py deleted file mode 100644 index 35d150a..0000000 --- a/openapi_client/models/device_update_hook_spec.py +++ /dev/null @@ -1,104 +0,0 @@ -# coding: utf-8 - -""" - Open Device Management API - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: undefined - 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, Field, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from openapi_client.models.file_operation import FileOperation -from openapi_client.models.hook_action import HookAction -from typing import Optional, Set -from typing_extensions import Self - -class DeviceUpdateHookSpec(BaseModel): - """ - DeviceUpdateHookSpec - """ # noqa: E501 - name: Optional[StrictStr] = None - description: Optional[StrictStr] = None - actions: List[HookAction] = Field(description="The actions to take when the specified file operations are observed. Each action is executed in the order they are defined.") - on_file: Optional[List[FileOperation]] = Field(default=None, alias="onFile") - path: Optional[StrictStr] = Field(default=None, description="The path to monitor for changes in configuration files. This path can point to either a specific file or an entire directory.") - __properties: ClassVar[List[str]] = ["name", "description", "actions", "onFile", "path"] - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of DeviceUpdateHookSpec 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 actions (list) - _items = [] - if self.actions: - for _item_actions in self.actions: - if _item_actions: - _items.append(_item_actions.to_dict()) - _dict['actions'] = _items - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of DeviceUpdateHookSpec 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"), - "actions": [HookAction.from_dict(_item) for _item in obj["actions"]] if obj.get("actions") is not None else None, - "onFile": obj.get("onFile"), - "path": obj.get("path") - }) - return _obj - - diff --git a/openapi_client/models/device_updated_status.py b/openapi_client/models/device_updated_status.py deleted file mode 100644 index 14a952b..0000000 --- a/openapi_client/models/device_updated_status.py +++ /dev/null @@ -1,90 +0,0 @@ -# coding: utf-8 - -""" - Open Device Management API - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: undefined - 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, Field, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from openapi_client.models.device_updated_status_type import DeviceUpdatedStatusType -from typing import Optional, Set -from typing_extensions import Self - -class DeviceUpdatedStatus(BaseModel): - """ - DeviceUpdatedStatus - """ # noqa: E501 - status: DeviceUpdatedStatusType - info: Optional[StrictStr] = Field(default=None, description="Human readable information about the last device update transition.") - __properties: ClassVar[List[str]] = ["status", "info"] - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of DeviceUpdatedStatus 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 DeviceUpdatedStatus from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "status": obj.get("status"), - "info": obj.get("info") - }) - return _obj - - diff --git a/openapi_client/models/device_updated_status_type.py b/openapi_client/models/device_updated_status_type.py deleted file mode 100644 index ab94020..0000000 --- a/openapi_client/models/device_updated_status_type.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - Open Device Management API - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: undefined - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import json -from enum import Enum -from typing_extensions import Self - - -class DeviceUpdatedStatusType(str, Enum): - """ - DeviceUpdatedStatusType - """ - - """ - allowed enum values - """ - UPTODATE = 'UpToDate' - OUTOFDATE = 'OutOfDate' - UPDATING = 'Updating' - UNKNOWN = 'Unknown' - - @classmethod - def from_json(cls, json_str: str) -> Self: - """Create an instance of DeviceUpdatedStatusType from a JSON string""" - return cls(json.loads(json_str)) - - diff --git a/openapi_client/models/devices_summary.py b/openapi_client/models/devices_summary.py deleted file mode 100644 index 966d624..0000000 --- a/openapi_client/models/devices_summary.py +++ /dev/null @@ -1,93 +0,0 @@ -# coding: utf-8 - -""" - Open Device Management API - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: undefined - 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, Field, StrictInt -from typing import Any, ClassVar, Dict, List, Optional -from typing import Optional, Set -from typing_extensions import Self - -class DevicesSummary(BaseModel): - """ - A summary of the devices in the fleet returned when fetching a single Fleet. - """ # noqa: E501 - total: StrictInt = Field(description="The total number of devices in the fleet.") - application_status: Optional[Dict[str, StrictInt]] = Field(default=None, description="A breakdown of the devices in the fleet by \"application\" status.", alias="applicationStatus") - summary_status: Optional[Dict[str, StrictInt]] = Field(default=None, description="A breakdown of the devices in the fleet by \"summary\" status.", alias="summaryStatus") - update_status: Optional[Dict[str, StrictInt]] = Field(default=None, description="A breakdown of the devices in the fleet by \"updated\" status.", alias="updateStatus") - __properties: ClassVar[List[str]] = ["total", "applicationStatus", "summaryStatus", "updateStatus"] - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of DevicesSummary 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 DevicesSummary from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "total": obj.get("total"), - "applicationStatus": obj.get("applicationStatus"), - "summaryStatus": obj.get("summaryStatus"), - "updateStatus": obj.get("updateStatus") - }) - return _obj - - diff --git a/openapi_client/models/disk_resource_monitor_spec.py b/openapi_client/models/disk_resource_monitor_spec.py deleted file mode 100644 index 612912e..0000000 --- a/openapi_client/models/disk_resource_monitor_spec.py +++ /dev/null @@ -1,109 +0,0 @@ -# coding: utf-8 - -""" - Open Device Management API - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: undefined - 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, Field, StrictStr, field_validator -from typing import Any, ClassVar, Dict, List -from typing_extensions import Annotated -from openapi_client.models.resource_alert_rule import ResourceAlertRule -from typing import Optional, Set -from typing_extensions import Self - -class DiskResourceMonitorSpec(BaseModel): - """ - DiskResourceMonitorSpec - """ # noqa: E501 - monitor_type: StrictStr = Field(alias="monitorType") - alert_rules: List[ResourceAlertRule] = Field(description="Array of alert rules. Only one alert per severity is allowed.", alias="alertRules") - sampling_interval: Annotated[str, Field(strict=True)] = Field(description="Duration between monitor samples. Format: positive integer followed by 's' for seconds, 'm' for minutes, 'h' for hours.", alias="samplingInterval") - path: StrictStr = Field(description="The directory path to monitor for disk usage.") - __properties: ClassVar[List[str]] = ["monitorType", "alertRules", "samplingInterval", "path"] - - @field_validator('sampling_interval') - def sampling_interval_validate_regular_expression(cls, value): - """Validates the regular expression""" - if not re.match(r"^[1-9]\d*[smh]$", value): - raise ValueError(r"must validate the regular expression /^[1-9]\d*[smh]$/") - return value - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of DiskResourceMonitorSpec 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 alert_rules (list) - _items = [] - if self.alert_rules: - for _item_alert_rules in self.alert_rules: - if _item_alert_rules: - _items.append(_item_alert_rules.to_dict()) - _dict['alertRules'] = _items - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of DiskResourceMonitorSpec from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "monitorType": obj.get("monitorType"), - "alertRules": [ResourceAlertRule.from_dict(_item) for _item in obj["alertRules"]] if obj.get("alertRules") is not None else None, - "samplingInterval": obj.get("samplingInterval"), - "path": obj.get("path") - }) - return _obj - - diff --git a/openapi_client/models/disruption_allowance.py b/openapi_client/models/disruption_allowance.py deleted file mode 100644 index 911636e..0000000 --- a/openapi_client/models/disruption_allowance.py +++ /dev/null @@ -1,91 +0,0 @@ -# coding: utf-8 - -""" - Open Device Management API - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: undefined - 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, Field, StrictInt, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from typing import Optional, Set -from typing_extensions import Self - -class DisruptionAllowance(BaseModel): - """ - DisruptionAllowance defines the level of allowed disruption when rollout is in progress. - """ # noqa: E501 - group_by: Optional[List[StrictStr]] = Field(default=None, description="List of label keys to perform grouping for the disruption allowance.", alias="groupBy") - min_available: Optional[StrictInt] = Field(default=None, description="The maximum number of unavailable devices allowed during rollout.", alias="minAvailable") - max_unavailable: Optional[StrictInt] = Field(default=None, description="The minimum number of required available devices during rollout.", alias="maxUnavailable") - __properties: ClassVar[List[str]] = ["groupBy", "minAvailable", "maxUnavailable"] - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of DisruptionAllowance 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 DisruptionAllowance from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "groupBy": obj.get("groupBy"), - "minAvailable": obj.get("minAvailable"), - "maxUnavailable": obj.get("maxUnavailable") - }) - return _obj - - diff --git a/openapi_client/models/enrollment_config.py b/openapi_client/models/enrollment_config.py deleted file mode 100644 index 495cc17..0000000 --- a/openapi_client/models/enrollment_config.py +++ /dev/null @@ -1,93 +0,0 @@ -# coding: utf-8 - -""" - Open Device Management API - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: undefined - 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, Field, StrictStr -from typing import Any, ClassVar, Dict, List -from openapi_client.models.enrollment_service import EnrollmentService -from typing import Optional, Set -from typing_extensions import Self - -class EnrollmentConfig(BaseModel): - """ - EnrollmentConfig - """ # noqa: E501 - enrollment_service: EnrollmentService = Field(alias="enrollment-service") - grpc_management_endpoint: StrictStr = Field(alias="grpc-management-endpoint") - __properties: ClassVar[List[str]] = ["enrollment-service", "grpc-management-endpoint"] - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of EnrollmentConfig 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 enrollment_service - if self.enrollment_service: - _dict['enrollment-service'] = self.enrollment_service.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of EnrollmentConfig from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "enrollment-service": EnrollmentService.from_dict(obj["enrollment-service"]) if obj.get("enrollment-service") is not None else None, - "grpc-management-endpoint": obj.get("grpc-management-endpoint") - }) - return _obj - - diff --git a/openapi_client/models/enrollment_request.py b/openapi_client/models/enrollment_request.py deleted file mode 100644 index a6153c5..0000000 --- a/openapi_client/models/enrollment_request.py +++ /dev/null @@ -1,107 +0,0 @@ -# coding: utf-8 - -""" - Open Device Management API - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: undefined - 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, Field, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from openapi_client.models.enrollment_request_spec import EnrollmentRequestSpec -from openapi_client.models.enrollment_request_status import EnrollmentRequestStatus -from openapi_client.models.object_meta import ObjectMeta -from typing import Optional, Set -from typing_extensions import Self - -class EnrollmentRequest(BaseModel): - """ - EnrollmentRequest represents a request for approval to enroll a device. - """ # noqa: E501 - api_version: StrictStr = Field(description="APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", alias="apiVersion") - kind: StrictStr = Field(description="Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds") - metadata: ObjectMeta - spec: EnrollmentRequestSpec - status: Optional[EnrollmentRequestStatus] = None - __properties: ClassVar[List[str]] = ["apiVersion", "kind", "metadata", "spec", "status"] - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of EnrollmentRequest 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 metadata - if self.metadata: - _dict['metadata'] = self.metadata.to_dict() - # override the default output from pydantic by calling `to_dict()` of spec - if self.spec: - _dict['spec'] = self.spec.to_dict() - # override the default output from pydantic by calling `to_dict()` of status - if self.status: - _dict['status'] = self.status.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of EnrollmentRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "apiVersion": obj.get("apiVersion"), - "kind": obj.get("kind"), - "metadata": ObjectMeta.from_dict(obj["metadata"]) if obj.get("metadata") is not None else None, - "spec": EnrollmentRequestSpec.from_dict(obj["spec"]) if obj.get("spec") is not None else None, - "status": EnrollmentRequestStatus.from_dict(obj["status"]) if obj.get("status") is not None else None - }) - return _obj - - diff --git a/openapi_client/models/enrollment_request_approval.py b/openapi_client/models/enrollment_request_approval.py deleted file mode 100644 index a19e859..0000000 --- a/openapi_client/models/enrollment_request_approval.py +++ /dev/null @@ -1,94 +0,0 @@ -# coding: utf-8 - -""" - Open Device Management API - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: undefined - 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, Field, StrictBool, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from typing import Optional, Set -from typing_extensions import Self - -class EnrollmentRequestApproval(BaseModel): - """ - EnrollmentRequestApproval - """ # noqa: E501 - labels: Optional[Dict[str, StrictStr]] = Field(default=None, description="labels is a set of labels to apply to the device.") - approved: StrictBool = Field(description="approved indicates whether the request has been approved.") - approved_by: Optional[StrictStr] = Field(default=None, description="approvedBy is the name of the approver.", alias="approvedBy") - approved_at: Optional[datetime] = Field(default=None, description="approvedAt is the time at which the request was approved.", alias="approvedAt") - __properties: ClassVar[List[str]] = ["labels", "approved", "approvedBy", "approvedAt"] - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of EnrollmentRequestApproval 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 EnrollmentRequestApproval from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "labels": obj.get("labels"), - "approved": obj.get("approved"), - "approvedBy": obj.get("approvedBy"), - "approvedAt": obj.get("approvedAt") - }) - return _obj - - diff --git a/openapi_client/models/enrollment_request_list.py b/openapi_client/models/enrollment_request_list.py deleted file mode 100644 index 9fcb70e..0000000 --- a/openapi_client/models/enrollment_request_list.py +++ /dev/null @@ -1,105 +0,0 @@ -# coding: utf-8 - -""" - Open Device Management API - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: undefined - 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, Field, StrictStr -from typing import Any, ClassVar, Dict, List -from openapi_client.models.enrollment_request import EnrollmentRequest -from openapi_client.models.list_meta import ListMeta -from typing import Optional, Set -from typing_extensions import Self - -class EnrollmentRequestList(BaseModel): - """ - EnrollmentRequestList is a list of EnrollmentRequest. - """ # noqa: E501 - api_version: StrictStr = Field(description="APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", alias="apiVersion") - kind: StrictStr = Field(description="Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds") - metadata: ListMeta - items: List[EnrollmentRequest] = Field(description="List of EnrollmentRequest.") - __properties: ClassVar[List[str]] = ["apiVersion", "kind", "metadata", "items"] - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of EnrollmentRequestList 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 metadata - if self.metadata: - _dict['metadata'] = self.metadata.to_dict() - # override the default output from pydantic by calling `to_dict()` of each item in items (list) - _items = [] - if self.items: - for _item_items in self.items: - if _item_items: - _items.append(_item_items.to_dict()) - _dict['items'] = _items - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of EnrollmentRequestList from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "apiVersion": obj.get("apiVersion"), - "kind": obj.get("kind"), - "metadata": ListMeta.from_dict(obj["metadata"]) if obj.get("metadata") is not None else None, - "items": [EnrollmentRequest.from_dict(_item) for _item in obj["items"]] if obj.get("items") is not None else None - }) - return _obj - - diff --git a/openapi_client/models/enrollment_request_spec.py b/openapi_client/models/enrollment_request_spec.py deleted file mode 100644 index 7f77311..0000000 --- a/openapi_client/models/enrollment_request_spec.py +++ /dev/null @@ -1,95 +0,0 @@ -# coding: utf-8 - -""" - Open Device Management API - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: undefined - 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, Field, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from openapi_client.models.device_status import DeviceStatus -from typing import Optional, Set -from typing_extensions import Self - -class EnrollmentRequestSpec(BaseModel): - """ - EnrollmentRequestSpec is a description of a EnrollmentRequest's target state. - """ # noqa: E501 - csr: StrictStr = Field(description="csr is a PEM-encoded PKCS#10 certificate signing request.") - device_status: Optional[DeviceStatus] = Field(default=None, alias="deviceStatus") - labels: Optional[Dict[str, StrictStr]] = Field(default=None, description="A set of labels that the service will apply to this device when its enrollment is approved") - __properties: ClassVar[List[str]] = ["csr", "deviceStatus", "labels"] - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of EnrollmentRequestSpec 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 device_status - if self.device_status: - _dict['deviceStatus'] = self.device_status.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of EnrollmentRequestSpec from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "csr": obj.get("csr"), - "deviceStatus": DeviceStatus.from_dict(obj["deviceStatus"]) if obj.get("deviceStatus") is not None else None, - "labels": obj.get("labels") - }) - return _obj - - diff --git a/openapi_client/models/enrollment_request_status.py b/openapi_client/models/enrollment_request_status.py deleted file mode 100644 index e92cdb5..0000000 --- a/openapi_client/models/enrollment_request_status.py +++ /dev/null @@ -1,103 +0,0 @@ -# coding: utf-8 - -""" - Open Device Management API - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: undefined - 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, Field, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from openapi_client.models.condition import Condition -from openapi_client.models.enrollment_request_approval import EnrollmentRequestApproval -from typing import Optional, Set -from typing_extensions import Self - -class EnrollmentRequestStatus(BaseModel): - """ - EnrollmentRequestStatus represents information about the status of a EnrollmentRequest. - """ # noqa: E501 - certificate: Optional[StrictStr] = Field(default=None, description="certificate is a PEM-encoded signed certificate.") - conditions: List[Condition] = Field(description="Current state of the EnrollmentRequest.") - approval: Optional[EnrollmentRequestApproval] = None - __properties: ClassVar[List[str]] = ["certificate", "conditions", "approval"] - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of EnrollmentRequestStatus 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 conditions (list) - _items = [] - if self.conditions: - for _item_conditions in self.conditions: - if _item_conditions: - _items.append(_item_conditions.to_dict()) - _dict['conditions'] = _items - # override the default output from pydantic by calling `to_dict()` of approval - if self.approval: - _dict['approval'] = self.approval.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of EnrollmentRequestStatus from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "certificate": obj.get("certificate"), - "conditions": [Condition.from_dict(_item) for _item in obj["conditions"]] if obj.get("conditions") is not None else None, - "approval": EnrollmentRequestApproval.from_dict(obj["approval"]) if obj.get("approval") is not None else None - }) - return _obj - - diff --git a/openapi_client/models/enrollment_service.py b/openapi_client/models/enrollment_service.py deleted file mode 100644 index 8eaee3f..0000000 --- a/openapi_client/models/enrollment_service.py +++ /dev/null @@ -1,99 +0,0 @@ -# coding: utf-8 - -""" - Open Device Management API - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: undefined - 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, Field, StrictStr -from typing import Any, ClassVar, Dict, List -from openapi_client.models.enrollment_service_auth import EnrollmentServiceAuth -from openapi_client.models.enrollment_service_service import EnrollmentServiceService -from typing import Optional, Set -from typing_extensions import Self - -class EnrollmentService(BaseModel): - """ - EnrollmentService - """ # noqa: E501 - authentication: EnrollmentServiceAuth - service: EnrollmentServiceService - enrollment_ui_endpoint: StrictStr = Field(alias="enrollment-ui-endpoint") - __properties: ClassVar[List[str]] = ["authentication", "service", "enrollment-ui-endpoint"] - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of EnrollmentService 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 authentication - if self.authentication: - _dict['authentication'] = self.authentication.to_dict() - # override the default output from pydantic by calling `to_dict()` of service - if self.service: - _dict['service'] = self.service.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of EnrollmentService from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "authentication": EnrollmentServiceAuth.from_dict(obj["authentication"]) if obj.get("authentication") is not None else None, - "service": EnrollmentServiceService.from_dict(obj["service"]) if obj.get("service") is not None else None, - "enrollment-ui-endpoint": obj.get("enrollment-ui-endpoint") - }) - return _obj - - diff --git a/openapi_client/models/enrollment_service_auth.py b/openapi_client/models/enrollment_service_auth.py deleted file mode 100644 index 6908567..0000000 --- a/openapi_client/models/enrollment_service_auth.py +++ /dev/null @@ -1,89 +0,0 @@ -# coding: utf-8 - -""" - Open Device Management API - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: undefined - 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, Field, StrictStr -from typing import Any, ClassVar, Dict, List -from typing import Optional, Set -from typing_extensions import Self - -class EnrollmentServiceAuth(BaseModel): - """ - EnrollmentServiceAuth - """ # noqa: E501 - client_certificate_data: StrictStr = Field(alias="client-certificate-data") - client_key_data: StrictStr = Field(alias="client-key-data") - __properties: ClassVar[List[str]] = ["client-certificate-data", "client-key-data"] - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of EnrollmentServiceAuth 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 EnrollmentServiceAuth from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "client-certificate-data": obj.get("client-certificate-data"), - "client-key-data": obj.get("client-key-data") - }) - return _obj - - diff --git a/openapi_client/models/enrollment_service_service.py b/openapi_client/models/enrollment_service_service.py deleted file mode 100644 index 942bd26..0000000 --- a/openapi_client/models/enrollment_service_service.py +++ /dev/null @@ -1,89 +0,0 @@ -# coding: utf-8 - -""" - Open Device Management API - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: undefined - 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, Field, StrictStr -from typing import Any, ClassVar, Dict, List -from typing import Optional, Set -from typing_extensions import Self - -class EnrollmentServiceService(BaseModel): - """ - EnrollmentServiceService - """ # noqa: E501 - certificate_authority_data: StrictStr = Field(alias="certificate-authority-data") - server: StrictStr - __properties: ClassVar[List[str]] = ["certificate-authority-data", "server"] - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of EnrollmentServiceService 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 EnrollmentServiceService from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "certificate-authority-data": obj.get("certificate-authority-data"), - "server": obj.get("server") - }) - return _obj - - diff --git a/openapi_client/models/error.py b/openapi_client/models/error.py deleted file mode 100644 index 346c870..0000000 --- a/openapi_client/models/error.py +++ /dev/null @@ -1,87 +0,0 @@ -# coding: utf-8 - -""" - Open Device Management API - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: undefined - 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, Field, StrictStr -from typing import Any, ClassVar, Dict, List -from typing import Optional, Set -from typing_extensions import Self - -class Error(BaseModel): - """ - Error - """ # noqa: E501 - message: StrictStr = Field(description="Error message") - __properties: ClassVar[List[str]] = ["message"] - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of Error 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 Error from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "message": obj.get("message") - }) - return _obj - - diff --git a/openapi_client/models/file_operation.py b/openapi_client/models/file_operation.py deleted file mode 100644 index d8f2eb1..0000000 --- a/openapi_client/models/file_operation.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - Open Device Management API - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: undefined - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import json -from enum import Enum -from typing_extensions import Self - - -class FileOperation(str, Enum): - """ - The type of operation that was observed on the file. - """ - - """ - allowed enum values - """ - CREATE = 'Create' - REMOVE = 'Remove' - UPDATE = 'Update' - REBOOT = 'Reboot' - - @classmethod - def from_json(cls, json_str: str) -> Self: - """Create an instance of FileOperation from a JSON string""" - return cls(json.loads(json_str)) - - diff --git a/openapi_client/models/file_spec.py b/openapi_client/models/file_spec.py deleted file mode 100644 index da111c3..0000000 --- a/openapi_client/models/file_spec.py +++ /dev/null @@ -1,107 +0,0 @@ -# coding: utf-8 - -""" - Open Device Management API - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: undefined - 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, Field, StrictInt, StrictStr, field_validator -from typing import Any, ClassVar, Dict, List, Optional -from typing import Optional, Set -from typing_extensions import Self - -class FileSpec(BaseModel): - """ - FileSpec - """ # noqa: E501 - path: StrictStr = Field(description="The absolute path to the file on the device. Note that any existing file will be overwritten.") - content: StrictStr = Field(description="The plain text (UTF-8) or base64-encoded content of the file.") - content_encoding: Optional[StrictStr] = Field(default=None, description="How the contents are encoded. Must be either \"plain\" or \"base64\". Defaults to \"plain\".", alias="contentEncoding") - mode: Optional[StrictInt] = Field(default=None, description="The file’s permission mode. You may specify the more familiar octal with a leading zero (e.g., 0644) or as a decimal without a leading zero (e.g., 420). Setuid/setgid/sticky bits are supported. If not specified, the permission mode for files defaults to 0644. ") - user: Optional[StrictStr] = Field(default=None, description="The file's owner, specified either as a name or numeric ID. Defaults to \"root\".") - group: Optional[StrictStr] = Field(default=None, description="The file's group, specified either as a name or numeric ID. Defaults to \"root\".") - __properties: ClassVar[List[str]] = ["path", "content", "contentEncoding", "mode", "user", "group"] - - @field_validator('content_encoding') - def content_encoding_validate_enum(cls, value): - """Validates the enum""" - if value is None: - return value - - if value not in set(['plain', 'base64']): - raise ValueError("must be one of enum values ('plain', 'base64')") - return value - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of FileSpec 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 FileSpec from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "path": obj.get("path"), - "content": obj.get("content"), - "contentEncoding": obj.get("contentEncoding"), - "mode": obj.get("mode"), - "user": obj.get("user"), - "group": obj.get("group") - }) - return _obj - - diff --git a/openapi_client/models/fleet.py b/openapi_client/models/fleet.py deleted file mode 100644 index 053b718..0000000 --- a/openapi_client/models/fleet.py +++ /dev/null @@ -1,107 +0,0 @@ -# coding: utf-8 - -""" - Open Device Management API - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: undefined - 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, Field, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from openapi_client.models.fleet_spec import FleetSpec -from openapi_client.models.fleet_status import FleetStatus -from openapi_client.models.object_meta import ObjectMeta -from typing import Optional, Set -from typing_extensions import Self - -class Fleet(BaseModel): - """ - Fleet represents a set of devices. - """ # noqa: E501 - api_version: StrictStr = Field(description="APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", alias="apiVersion") - kind: StrictStr = Field(description="Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds") - metadata: ObjectMeta - spec: FleetSpec - status: Optional[FleetStatus] = None - __properties: ClassVar[List[str]] = ["apiVersion", "kind", "metadata", "spec", "status"] - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of Fleet 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 metadata - if self.metadata: - _dict['metadata'] = self.metadata.to_dict() - # override the default output from pydantic by calling `to_dict()` of spec - if self.spec: - _dict['spec'] = self.spec.to_dict() - # override the default output from pydantic by calling `to_dict()` of status - if self.status: - _dict['status'] = self.status.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of Fleet from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "apiVersion": obj.get("apiVersion"), - "kind": obj.get("kind"), - "metadata": ObjectMeta.from_dict(obj["metadata"]) if obj.get("metadata") is not None else None, - "spec": FleetSpec.from_dict(obj["spec"]) if obj.get("spec") is not None else None, - "status": FleetStatus.from_dict(obj["status"]) if obj.get("status") is not None else None - }) - return _obj - - diff --git a/openapi_client/models/fleet_list.py b/openapi_client/models/fleet_list.py deleted file mode 100644 index e6d974a..0000000 --- a/openapi_client/models/fleet_list.py +++ /dev/null @@ -1,105 +0,0 @@ -# coding: utf-8 - -""" - Open Device Management API - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: undefined - 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, Field, StrictStr -from typing import Any, ClassVar, Dict, List -from openapi_client.models.fleet import Fleet -from openapi_client.models.list_meta import ListMeta -from typing import Optional, Set -from typing_extensions import Self - -class FleetList(BaseModel): - """ - FleetList is a list of Fleets. - """ # noqa: E501 - api_version: StrictStr = Field(description="APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", alias="apiVersion") - kind: StrictStr = Field(description="Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds") - metadata: ListMeta - items: List[Fleet] = Field(description="List of Fleets.") - __properties: ClassVar[List[str]] = ["apiVersion", "kind", "metadata", "items"] - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of FleetList 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 metadata - if self.metadata: - _dict['metadata'] = self.metadata.to_dict() - # override the default output from pydantic by calling `to_dict()` of each item in items (list) - _items = [] - if self.items: - for _item_items in self.items: - if _item_items: - _items.append(_item_items.to_dict()) - _dict['items'] = _items - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of FleetList from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "apiVersion": obj.get("apiVersion"), - "kind": obj.get("kind"), - "metadata": ListMeta.from_dict(obj["metadata"]) if obj.get("metadata") is not None else None, - "items": [Fleet.from_dict(_item) for _item in obj["items"]] if obj.get("items") is not None else None - }) - return _obj - - diff --git a/openapi_client/models/fleet_rollout_status.py b/openapi_client/models/fleet_rollout_status.py deleted file mode 100644 index b4dc177..0000000 --- a/openapi_client/models/fleet_rollout_status.py +++ /dev/null @@ -1,87 +0,0 @@ -# coding: utf-8 - -""" - Open Device Management API - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: undefined - 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, Field, StrictInt -from typing import Any, ClassVar, Dict, List, Optional -from typing import Optional, Set -from typing_extensions import Self - -class FleetRolloutStatus(BaseModel): - """ - FleetRolloutStatus - """ # noqa: E501 - current_batch: Optional[StrictInt] = Field(default=None, alias="currentBatch") - __properties: ClassVar[List[str]] = ["currentBatch"] - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of FleetRolloutStatus 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 FleetRolloutStatus from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "currentBatch": obj.get("currentBatch") - }) - return _obj - - diff --git a/openapi_client/models/fleet_spec.py b/openapi_client/models/fleet_spec.py deleted file mode 100644 index 0eb1d3f..0000000 --- a/openapi_client/models/fleet_spec.py +++ /dev/null @@ -1,103 +0,0 @@ -# coding: utf-8 - -""" - Open Device Management API - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: undefined - 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, Field -from typing import Any, ClassVar, Dict, List, Optional -from openapi_client.models.fleet_spec_template import FleetSpecTemplate -from openapi_client.models.label_selector import LabelSelector -from openapi_client.models.rollout_policy import RolloutPolicy -from typing import Optional, Set -from typing_extensions import Self - -class FleetSpec(BaseModel): - """ - FleetSpec is a description of a fleet's target state. - """ # noqa: E501 - selector: Optional[LabelSelector] = None - rollout_policy: Optional[RolloutPolicy] = Field(default=None, alias="rolloutPolicy") - template: FleetSpecTemplate - __properties: ClassVar[List[str]] = ["selector", "rolloutPolicy", "template"] - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of FleetSpec 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 selector - if self.selector: - _dict['selector'] = self.selector.to_dict() - # override the default output from pydantic by calling `to_dict()` of rollout_policy - if self.rollout_policy: - _dict['rolloutPolicy'] = self.rollout_policy.to_dict() - # override the default output from pydantic by calling `to_dict()` of template - if self.template: - _dict['template'] = self.template.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of FleetSpec from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "selector": LabelSelector.from_dict(obj["selector"]) if obj.get("selector") is not None else None, - "rolloutPolicy": RolloutPolicy.from_dict(obj["rolloutPolicy"]) if obj.get("rolloutPolicy") is not None else None, - "template": FleetSpecTemplate.from_dict(obj["template"]) if obj.get("template") is not None else None - }) - return _obj - - diff --git a/openapi_client/models/fleet_spec_template.py b/openapi_client/models/fleet_spec_template.py deleted file mode 100644 index 185296b..0000000 --- a/openapi_client/models/fleet_spec_template.py +++ /dev/null @@ -1,97 +0,0 @@ -# coding: utf-8 - -""" - Open Device Management API - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: undefined - 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 openapi_client.models.device_spec import DeviceSpec -from openapi_client.models.object_meta import ObjectMeta -from typing import Optional, Set -from typing_extensions import Self - -class FleetSpecTemplate(BaseModel): - """ - FleetSpecTemplate - """ # noqa: E501 - metadata: Optional[ObjectMeta] = None - spec: DeviceSpec - __properties: ClassVar[List[str]] = ["metadata", "spec"] - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of FleetSpecTemplate 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 metadata - if self.metadata: - _dict['metadata'] = self.metadata.to_dict() - # override the default output from pydantic by calling `to_dict()` of spec - if self.spec: - _dict['spec'] = self.spec.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of FleetSpecTemplate from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "metadata": ObjectMeta.from_dict(obj["metadata"]) if obj.get("metadata") is not None else None, - "spec": DeviceSpec.from_dict(obj["spec"]) if obj.get("spec") is not None else None - }) - return _obj - - diff --git a/openapi_client/models/fleet_status.py b/openapi_client/models/fleet_status.py deleted file mode 100644 index 9af7c25..0000000 --- a/openapi_client/models/fleet_status.py +++ /dev/null @@ -1,107 +0,0 @@ -# coding: utf-8 - -""" - Open Device Management API - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: undefined - 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, Field -from typing import Any, ClassVar, Dict, List, Optional -from openapi_client.models.condition import Condition -from openapi_client.models.devices_summary import DevicesSummary -from openapi_client.models.fleet_rollout_status import FleetRolloutStatus -from typing import Optional, Set -from typing_extensions import Self - -class FleetStatus(BaseModel): - """ - FleetStatus represents information about the status of a fleet. Status may trail the actual state of a fleet, especially if devices of a fleet have not contacted the management service in a while. - """ # noqa: E501 - rollout: Optional[FleetRolloutStatus] = None - conditions: List[Condition] = Field(description="Current state of the fleet.") - devices_summary: Optional[DevicesSummary] = Field(default=None, alias="devicesSummary") - __properties: ClassVar[List[str]] = ["rollout", "conditions", "devicesSummary"] - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of FleetStatus 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 rollout - if self.rollout: - _dict['rollout'] = self.rollout.to_dict() - # override the default output from pydantic by calling `to_dict()` of each item in conditions (list) - _items = [] - if self.conditions: - for _item_conditions in self.conditions: - if _item_conditions: - _items.append(_item_conditions.to_dict()) - _dict['conditions'] = _items - # override the default output from pydantic by calling `to_dict()` of devices_summary - if self.devices_summary: - _dict['devicesSummary'] = self.devices_summary.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of FleetStatus from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "rollout": FleetRolloutStatus.from_dict(obj["rollout"]) if obj.get("rollout") is not None else None, - "conditions": [Condition.from_dict(_item) for _item in obj["conditions"]] if obj.get("conditions") is not None else None, - "devicesSummary": DevicesSummary.from_dict(obj["devicesSummary"]) if obj.get("devicesSummary") is not None else None - }) - return _obj - - diff --git a/openapi_client/models/generic_repo_spec.py b/openapi_client/models/generic_repo_spec.py deleted file mode 100644 index 8392718..0000000 --- a/openapi_client/models/generic_repo_spec.py +++ /dev/null @@ -1,90 +0,0 @@ -# coding: utf-8 - -""" - Open Device Management API - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: undefined - 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, Field, StrictStr -from typing import Any, ClassVar, Dict, List -from openapi_client.models.repo_spec_type import RepoSpecType -from typing import Optional, Set -from typing_extensions import Self - -class GenericRepoSpec(BaseModel): - """ - GenericRepoSpec - """ # noqa: E501 - url: StrictStr = Field(description="The (possibly remote) repository URL") - type: RepoSpecType - __properties: ClassVar[List[str]] = ["url", "type"] - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of GenericRepoSpec 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 GenericRepoSpec from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "url": obj.get("url"), - "type": obj.get("type") - }) - return _obj - - diff --git a/openapi_client/models/git_config_provider_spec.py b/openapi_client/models/git_config_provider_spec.py deleted file mode 100644 index 58d31a8..0000000 --- a/openapi_client/models/git_config_provider_spec.py +++ /dev/null @@ -1,93 +0,0 @@ -# coding: utf-8 - -""" - Open Device Management API - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: undefined - 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, Field, StrictStr -from typing import Any, ClassVar, Dict, List -from openapi_client.models.git_config_provider_spec_git_ref import GitConfigProviderSpecGitRef -from typing import Optional, Set -from typing_extensions import Self - -class GitConfigProviderSpec(BaseModel): - """ - GitConfigProviderSpec - """ # noqa: E501 - name: StrictStr = Field(description="The name of the config provider") - git_ref: GitConfigProviderSpecGitRef = Field(alias="gitRef") - __properties: ClassVar[List[str]] = ["name", "gitRef"] - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of GitConfigProviderSpec 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 git_ref - if self.git_ref: - _dict['gitRef'] = self.git_ref.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of GitConfigProviderSpec 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"), - "gitRef": GitConfigProviderSpecGitRef.from_dict(obj["gitRef"]) if obj.get("gitRef") is not None else None - }) - return _obj - - diff --git a/openapi_client/models/git_config_provider_spec_git_ref.py b/openapi_client/models/git_config_provider_spec_git_ref.py deleted file mode 100644 index 81172ac..0000000 --- a/openapi_client/models/git_config_provider_spec_git_ref.py +++ /dev/null @@ -1,93 +0,0 @@ -# coding: utf-8 - -""" - Open Device Management API - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: undefined - 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, Field, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from typing import Optional, Set -from typing_extensions import Self - -class GitConfigProviderSpecGitRef(BaseModel): - """ - GitConfigProviderSpecGitRef - """ # noqa: E501 - repository: StrictStr = Field(description="The name of the repository resource to use as the sync source ") - target_revision: StrictStr = Field(alias="targetRevision") - path: StrictStr - mount_path: Optional[StrictStr] = Field(default='/', description="Path to config in device", alias="mountPath") - __properties: ClassVar[List[str]] = ["repository", "targetRevision", "path", "mountPath"] - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of GitConfigProviderSpecGitRef 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 GitConfigProviderSpecGitRef from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "repository": obj.get("repository"), - "targetRevision": obj.get("targetRevision"), - "path": obj.get("path"), - "mountPath": obj.get("mountPath") if obj.get("mountPath") is not None else '/' - }) - return _obj - - diff --git a/openapi_client/models/hook_action.py b/openapi_client/models/hook_action.py deleted file mode 100644 index 6c54d3d..0000000 --- a/openapi_client/models/hook_action.py +++ /dev/null @@ -1,137 +0,0 @@ -# coding: utf-8 - -""" - Open Device Management API - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: undefined - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import json -import pprint -from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator -from typing import Any, List, Optional -from openapi_client.models.hook_action_one_of import HookActionOneOf -from openapi_client.models.hook_action_one_of1 import HookActionOneOf1 -from pydantic import StrictStr, Field -from typing import Union, List, Set, Optional, Dict -from typing_extensions import Literal, Self - -HOOKACTION_ONE_OF_SCHEMAS = ["HookActionOneOf", "HookActionOneOf1"] - -class HookAction(BaseModel): - """ - HookAction - """ - # data type: HookActionOneOf - oneof_schema_1_validator: Optional[HookActionOneOf] = None - # data type: HookActionOneOf1 - oneof_schema_2_validator: Optional[HookActionOneOf1] = None - actual_instance: Optional[Union[HookActionOneOf, HookActionOneOf1]] = None - one_of_schemas: Set[str] = { "HookActionOneOf", "HookActionOneOf1" } - - model_config = ConfigDict( - validate_assignment=True, - protected_namespaces=(), - ) - - - def __init__(self, *args, **kwargs) -> None: - if args: - if len(args) > 1: - raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") - if kwargs: - raise ValueError("If a position argument is used, keyword arguments cannot be used.") - super().__init__(actual_instance=args[0]) - else: - super().__init__(**kwargs) - - @field_validator('actual_instance') - def actual_instance_must_validate_oneof(cls, v): - instance = HookAction.model_construct() - error_messages = [] - match = 0 - # validate data type: HookActionOneOf - if not isinstance(v, HookActionOneOf): - error_messages.append(f"Error! Input type `{type(v)}` is not `HookActionOneOf`") - else: - match += 1 - # validate data type: HookActionOneOf1 - if not isinstance(v, HookActionOneOf1): - error_messages.append(f"Error! Input type `{type(v)}` is not `HookActionOneOf1`") - else: - match += 1 - if match > 1: - # more than 1 match - raise ValueError("Multiple matches found when setting `actual_instance` in HookAction with oneOf schemas: HookActionOneOf, HookActionOneOf1. Details: " + ", ".join(error_messages)) - elif match == 0: - # no match - raise ValueError("No match found when setting `actual_instance` in HookAction with oneOf schemas: HookActionOneOf, HookActionOneOf1. Details: " + ", ".join(error_messages)) - else: - return v - - @classmethod - def from_dict(cls, obj: Union[str, Dict[str, Any]]) -> Self: - return cls.from_json(json.dumps(obj)) - - @classmethod - def from_json(cls, json_str: str) -> Self: - """Returns the object represented by the json string""" - instance = cls.model_construct() - error_messages = [] - match = 0 - - # deserialize data into HookActionOneOf - try: - instance.actual_instance = HookActionOneOf.from_json(json_str) - match += 1 - except (ValidationError, ValueError) as e: - error_messages.append(str(e)) - # deserialize data into HookActionOneOf1 - try: - instance.actual_instance = HookActionOneOf1.from_json(json_str) - match += 1 - except (ValidationError, ValueError) as e: - error_messages.append(str(e)) - - if match > 1: - # more than 1 match - raise ValueError("Multiple matches found when deserializing the JSON string into HookAction with oneOf schemas: HookActionOneOf, HookActionOneOf1. Details: " + ", ".join(error_messages)) - elif match == 0: - # no match - raise ValueError("No match found when deserializing the JSON string into HookAction with oneOf schemas: HookActionOneOf, HookActionOneOf1. Details: " + ", ".join(error_messages)) - else: - return instance - - def to_json(self) -> str: - """Returns the JSON representation of the actual instance""" - if self.actual_instance is None: - return "null" - - if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): - return self.actual_instance.to_json() - else: - return json.dumps(self.actual_instance) - - def to_dict(self) -> Optional[Union[Dict[str, Any], HookActionOneOf, HookActionOneOf1]]: - """Returns the dict representation of the actual instance""" - if self.actual_instance is None: - return None - - if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): - return self.actual_instance.to_dict() - else: - # primitive type - return self.actual_instance - - def to_str(self) -> str: - """Returns the string representation of the actual instance""" - return pprint.pformat(self.model_dump()) - - diff --git a/openapi_client/models/hook_action_executable.py b/openapi_client/models/hook_action_executable.py deleted file mode 100644 index 283e067..0000000 --- a/openapi_client/models/hook_action_executable.py +++ /dev/null @@ -1,91 +0,0 @@ -# coding: utf-8 - -""" - Open Device Management API - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: undefined - 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, Field, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from typing import Optional, Set -from typing_extensions import Self - -class HookActionExecutable(BaseModel): - """ - HookActionExecutable - """ # noqa: E501 - run: StrictStr = Field(description="The command to be executed, including any arguments using standard shell syntax. This field supports multiple commands piped together, as if they were executed under a bash -c context.") - env_vars: Optional[List[StrictStr]] = Field(default=None, description="An optional list of KEY=VALUE pairs to set as environment variables for the executable.", alias="envVars") - work_dir: Optional[StrictStr] = Field(default=None, description="The directory in which the executable will be run from if it is left empty it will run from the users home directory.", alias="workDir") - __properties: ClassVar[List[str]] = ["run", "envVars", "workDir"] - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of HookActionExecutable 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 HookActionExecutable from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "run": obj.get("run"), - "envVars": obj.get("envVars"), - "workDir": obj.get("workDir") - }) - return _obj - - diff --git a/openapi_client/models/hook_action_executable_spec.py b/openapi_client/models/hook_action_executable_spec.py deleted file mode 100644 index 301939e..0000000 --- a/openapi_client/models/hook_action_executable_spec.py +++ /dev/null @@ -1,104 +0,0 @@ -# coding: utf-8 - -""" - Open Device Management API - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: undefined - 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, Field, StrictStr, field_validator -from typing import Any, ClassVar, Dict, List, Optional -from typing_extensions import Annotated -from typing import Optional, Set -from typing_extensions import Self - -class HookActionExecutableSpec(BaseModel): - """ - HookActionExecutableSpec - """ # noqa: E501 - timeout: Optional[Annotated[str, Field(strict=True)]] = Field(default=None, description="The maximum duration allowed for the action to complete. The duration should be specified as a positive integer followed by a time unit. Supported time units are: - 's' for seconds - 'm' for minutes - 'h' for hours - 'd' for days ") - run: StrictStr = Field(description="The command to be executed, including any arguments using standard shell syntax. This field supports multiple commands piped together, as if they were executed under a bash -c context.") - env_vars: Optional[List[StrictStr]] = Field(default=None, description="An optional list of KEY=VALUE pairs to set as environment variables for the executable.", alias="envVars") - work_dir: Optional[StrictStr] = Field(default=None, description="The directory in which the executable will be run from if it is left empty it will run from the users home directory.", alias="workDir") - __properties: ClassVar[List[str]] = ["timeout", "run", "envVars", "workDir"] - - @field_validator('timeout') - def timeout_validate_regular_expression(cls, value): - """Validates the regular expression""" - if value is None: - return value - - if not re.match(r"^[1-9]\d*[smhd]$", value): - raise ValueError(r"must validate the regular expression /^[1-9]\d*[smhd]$/") - return value - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of HookActionExecutableSpec 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 HookActionExecutableSpec from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "timeout": obj.get("timeout"), - "run": obj.get("run"), - "envVars": obj.get("envVars"), - "workDir": obj.get("workDir") - }) - return _obj - - diff --git a/openapi_client/models/hook_action_one_of.py b/openapi_client/models/hook_action_one_of.py deleted file mode 100644 index 71bc9f2..0000000 --- a/openapi_client/models/hook_action_one_of.py +++ /dev/null @@ -1,91 +0,0 @@ -# coding: utf-8 - -""" - Open Device Management API - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: undefined - 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 -from openapi_client.models.hook_action_executable_spec import HookActionExecutableSpec -from typing import Optional, Set -from typing_extensions import Self - -class HookActionOneOf(BaseModel): - """ - HookActionOneOf - """ # noqa: E501 - executable: HookActionExecutableSpec - __properties: ClassVar[List[str]] = ["executable"] - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of HookActionOneOf 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 executable - if self.executable: - _dict['executable'] = self.executable.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of HookActionOneOf from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "executable": HookActionExecutableSpec.from_dict(obj["executable"]) if obj.get("executable") is not None else None - }) - return _obj - - diff --git a/openapi_client/models/hook_action_one_of1.py b/openapi_client/models/hook_action_one_of1.py deleted file mode 100644 index 79b3a2f..0000000 --- a/openapi_client/models/hook_action_one_of1.py +++ /dev/null @@ -1,91 +0,0 @@ -# coding: utf-8 - -""" - Open Device Management API - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: undefined - 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 -from openapi_client.models.hook_action_systemd_spec import HookActionSystemdSpec -from typing import Optional, Set -from typing_extensions import Self - -class HookActionOneOf1(BaseModel): - """ - HookActionOneOf1 - """ # noqa: E501 - systemd: HookActionSystemdSpec - __properties: ClassVar[List[str]] = ["systemd"] - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of HookActionOneOf1 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 systemd - if self.systemd: - _dict['systemd'] = self.systemd.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of HookActionOneOf1 from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "systemd": HookActionSystemdSpec.from_dict(obj["systemd"]) if obj.get("systemd") is not None else None - }) - return _obj - - diff --git a/openapi_client/models/hook_action_spec.py b/openapi_client/models/hook_action_spec.py deleted file mode 100644 index 03c2660..0000000 --- a/openapi_client/models/hook_action_spec.py +++ /dev/null @@ -1,98 +0,0 @@ -# coding: utf-8 - -""" - Open Device Management API - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: undefined - 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, Field, field_validator -from typing import Any, ClassVar, Dict, List, Optional -from typing_extensions import Annotated -from typing import Optional, Set -from typing_extensions import Self - -class HookActionSpec(BaseModel): - """ - HookActionSpec - """ # noqa: E501 - timeout: Optional[Annotated[str, Field(strict=True)]] = Field(default=None, description="The maximum duration allowed for the action to complete. The duration should be specified as a positive integer followed by a time unit. Supported time units are: - 's' for seconds - 'm' for minutes - 'h' for hours - 'd' for days ") - __properties: ClassVar[List[str]] = ["timeout"] - - @field_validator('timeout') - def timeout_validate_regular_expression(cls, value): - """Validates the regular expression""" - if value is None: - return value - - if not re.match(r"^[1-9]\d*[smhd]$", value): - raise ValueError(r"must validate the regular expression /^[1-9]\d*[smhd]$/") - return value - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of HookActionSpec 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 HookActionSpec from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "timeout": obj.get("timeout") - }) - return _obj - - diff --git a/openapi_client/models/hook_action_systemd_spec.py b/openapi_client/models/hook_action_systemd_spec.py deleted file mode 100644 index a801ffd..0000000 --- a/openapi_client/models/hook_action_systemd_spec.py +++ /dev/null @@ -1,104 +0,0 @@ -# coding: utf-8 - -""" - Open Device Management API - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: undefined - 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, Field, field_validator -from typing import Any, ClassVar, Dict, List, Optional -from typing_extensions import Annotated -from openapi_client.models.hook_action_systemd_unit import HookActionSystemdUnit -from typing import Optional, Set -from typing_extensions import Self - -class HookActionSystemdSpec(BaseModel): - """ - HookActionSystemdSpec - """ # noqa: E501 - timeout: Optional[Annotated[str, Field(strict=True)]] = Field(default=None, description="The maximum duration allowed for the action to complete. The duration should be specified as a positive integer followed by a time unit. Supported time units are: - 's' for seconds - 'm' for minutes - 'h' for hours - 'd' for days ") - unit: HookActionSystemdUnit - __properties: ClassVar[List[str]] = ["timeout", "unit"] - - @field_validator('timeout') - def timeout_validate_regular_expression(cls, value): - """Validates the regular expression""" - if value is None: - return value - - if not re.match(r"^[1-9]\d*[smhd]$", value): - raise ValueError(r"must validate the regular expression /^[1-9]\d*[smhd]$/") - return value - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of HookActionSystemdSpec 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 unit - if self.unit: - _dict['unit'] = self.unit.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of HookActionSystemdSpec from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "timeout": obj.get("timeout"), - "unit": HookActionSystemdUnit.from_dict(obj["unit"]) if obj.get("unit") is not None else None - }) - return _obj - - diff --git a/openapi_client/models/hook_action_systemd_unit.py b/openapi_client/models/hook_action_systemd_unit.py deleted file mode 100644 index 8156180..0000000 --- a/openapi_client/models/hook_action_systemd_unit.py +++ /dev/null @@ -1,99 +0,0 @@ -# coding: utf-8 - -""" - Open Device Management API - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: undefined - 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, Field, StrictStr, field_validator -from typing import Any, ClassVar, Dict, List, Optional -from typing import Optional, Set -from typing_extensions import Self - -class HookActionSystemdUnit(BaseModel): - """ - HookActionSystemdUnit - """ # noqa: E501 - name: StrictStr = Field(description="The name of the systemd unit on which the specified operations will be performed. This should be the exact name of the unit file, such as example.service. If the name is not populated the name will be auto discovered from the file path.") - operations: List[StrictStr] = Field(description="The specific systemd operations to perform on the specified unit.") - work_dir: Optional[StrictStr] = Field(default=None, description="The directory in which the executable will be run from if it is left empty it will run from the users home directory.", alias="workDir") - __properties: ClassVar[List[str]] = ["name", "operations", "workDir"] - - @field_validator('operations') - def operations_validate_enum(cls, value): - """Validates the enum""" - for i in value: - if i not in set(['Enable', 'Disable', 'Start', 'Stop', 'Restart', 'Reload', 'DaemonReload']): - raise ValueError("each list item must be one of ('Enable', 'Disable', 'Start', 'Stop', 'Restart', 'Reload', 'DaemonReload')") - return value - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of HookActionSystemdUnit 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 HookActionSystemdUnit 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"), - "operations": obj.get("operations"), - "workDir": obj.get("workDir") - }) - return _obj - - diff --git a/openapi_client/models/http_config.py b/openapi_client/models/http_config.py deleted file mode 100644 index 9fe7ab2..0000000 --- a/openapi_client/models/http_config.py +++ /dev/null @@ -1,99 +0,0 @@ -# coding: utf-8 - -""" - Open Device Management API - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: undefined - 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, Field, SecretStr, StrictBool, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from typing import Optional, Set -from typing_extensions import Self - -class HttpConfig(BaseModel): - """ - HttpConfig - """ # noqa: E501 - username: Optional[StrictStr] = Field(default=None, description="The username for auth with HTTP transport") - password: Optional[SecretStr] = Field(default=None, description="The password for auth with HTTP transport") - tls_crt: Optional[SecretStr] = Field(default=None, description="Base64 encoded TLS cert data", alias="tls.crt") - tls_key: Optional[SecretStr] = Field(default=None, description="Base64 encoded TLS cert key", alias="tls.key") - ca_crt: Optional[StrictStr] = Field(default=None, description="Base64 encoded root CA", alias="ca.crt") - skip_server_verification: Optional[StrictBool] = Field(default=None, description="Skip remote server verification", alias="skipServerVerification") - token: Optional[SecretStr] = Field(default=None, description="The token for auth with HTTP transport") - __properties: ClassVar[List[str]] = ["username", "password", "tls.crt", "tls.key", "ca.crt", "skipServerVerification", "token"] - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of HttpConfig 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 HttpConfig 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"), - "tls.crt": obj.get("tls.crt"), - "tls.key": obj.get("tls.key"), - "ca.crt": obj.get("ca.crt"), - "skipServerVerification": obj.get("skipServerVerification"), - "token": obj.get("token") - }) - return _obj - - diff --git a/openapi_client/models/http_config_provider_spec.py b/openapi_client/models/http_config_provider_spec.py deleted file mode 100644 index eada8ee..0000000 --- a/openapi_client/models/http_config_provider_spec.py +++ /dev/null @@ -1,93 +0,0 @@ -# coding: utf-8 - -""" - Open Device Management API - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: undefined - 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, Field, StrictStr -from typing import Any, ClassVar, Dict, List -from openapi_client.models.http_config_provider_spec_http_ref import HttpConfigProviderSpecHttpRef -from typing import Optional, Set -from typing_extensions import Self - -class HttpConfigProviderSpec(BaseModel): - """ - HttpConfigProviderSpec - """ # noqa: E501 - name: StrictStr = Field(description="The name of the config provider") - http_ref: HttpConfigProviderSpecHttpRef = Field(alias="httpRef") - __properties: ClassVar[List[str]] = ["name", "httpRef"] - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of HttpConfigProviderSpec 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 http_ref - if self.http_ref: - _dict['httpRef'] = self.http_ref.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of HttpConfigProviderSpec 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"), - "httpRef": HttpConfigProviderSpecHttpRef.from_dict(obj["httpRef"]) if obj.get("httpRef") is not None else None - }) - return _obj - - diff --git a/openapi_client/models/http_config_provider_spec_http_ref.py b/openapi_client/models/http_config_provider_spec_http_ref.py deleted file mode 100644 index 5d72b41..0000000 --- a/openapi_client/models/http_config_provider_spec_http_ref.py +++ /dev/null @@ -1,91 +0,0 @@ -# coding: utf-8 - -""" - Open Device Management API - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: undefined - 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, Field, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from typing import Optional, Set -from typing_extensions import Self - -class HttpConfigProviderSpecHttpRef(BaseModel): - """ - HttpConfigProviderSpecHttpRef - """ # noqa: E501 - repository: StrictStr = Field(description="The name of the repository resource to use as the sync source ") - suffix: Optional[StrictStr] = Field(default=None, description="Part of the URL that comes after the base URL. It can include query parameters such as: /path/to/endpoint?query=param ") - file_path: StrictStr = Field(description="The path of the file where the response is stored in the filesystem of the device. ", alias="filePath") - __properties: ClassVar[List[str]] = ["repository", "suffix", "filePath"] - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of HttpConfigProviderSpecHttpRef 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 HttpConfigProviderSpecHttpRef from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "repository": obj.get("repository"), - "suffix": obj.get("suffix"), - "filePath": obj.get("filePath") - }) - return _obj - - diff --git a/openapi_client/models/http_repo_spec.py b/openapi_client/models/http_repo_spec.py deleted file mode 100644 index 76de842..0000000 --- a/openapi_client/models/http_repo_spec.py +++ /dev/null @@ -1,98 +0,0 @@ -# coding: utf-8 - -""" - Open Device Management API - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: undefined - 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, Field, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from openapi_client.models.http_config import HttpConfig -from openapi_client.models.repo_spec_type import RepoSpecType -from typing import Optional, Set -from typing_extensions import Self - -class HttpRepoSpec(BaseModel): - """ - HttpRepoSpec - """ # noqa: E501 - url: StrictStr = Field(description="The HTTP URL to call or clone from") - type: RepoSpecType - http_config: HttpConfig = Field(alias="httpConfig") - validation_suffix: Optional[StrictStr] = Field(default=None, description="URL suffix used only for validating access to the repository. Users might use the URL field as a root URL to be used by config sources adding suffixes. This will help with the validation of the http endpoint.", alias="validationSuffix") - __properties: ClassVar[List[str]] = ["url", "type", "httpConfig", "validationSuffix"] - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of HttpRepoSpec 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 http_config - if self.http_config: - _dict['httpConfig'] = self.http_config.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of HttpRepoSpec from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "url": obj.get("url"), - "type": obj.get("type"), - "httpConfig": HttpConfig.from_dict(obj["httpConfig"]) if obj.get("httpConfig") is not None else None, - "validationSuffix": obj.get("validationSuffix") - }) - return _obj - - diff --git a/openapi_client/models/image_application_provider.py b/openapi_client/models/image_application_provider.py deleted file mode 100644 index 19cdec2..0000000 --- a/openapi_client/models/image_application_provider.py +++ /dev/null @@ -1,87 +0,0 @@ -# coding: utf-8 - -""" - Open Device Management API - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: undefined - 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, Field, StrictStr -from typing import Any, ClassVar, Dict, List -from typing import Optional, Set -from typing_extensions import Self - -class ImageApplicationProvider(BaseModel): - """ - ImageApplicationProvider - """ # noqa: E501 - image: StrictStr = Field(description="Reference to the container image for the application package") - __properties: ClassVar[List[str]] = ["image"] - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ImageApplicationProvider 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 ImageApplicationProvider from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "image": obj.get("image") - }) - return _obj - - diff --git a/openapi_client/models/inline_config_provider_spec.py b/openapi_client/models/inline_config_provider_spec.py deleted file mode 100644 index 8b87a93..0000000 --- a/openapi_client/models/inline_config_provider_spec.py +++ /dev/null @@ -1,97 +0,0 @@ -# coding: utf-8 - -""" - Open Device Management API - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: undefined - 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, Field, StrictStr -from typing import Any, ClassVar, Dict, List -from openapi_client.models.file_spec import FileSpec -from typing import Optional, Set -from typing_extensions import Self - -class InlineConfigProviderSpec(BaseModel): - """ - InlineConfigProviderSpec - """ # noqa: E501 - name: StrictStr = Field(description="The name of the config provider") - inline: List[FileSpec] - __properties: ClassVar[List[str]] = ["name", "inline"] - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of InlineConfigProviderSpec 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 inline (list) - _items = [] - if self.inline: - for _item_inline in self.inline: - if _item_inline: - _items.append(_item_inline.to_dict()) - _dict['inline'] = _items - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of InlineConfigProviderSpec 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"), - "inline": [FileSpec.from_dict(_item) for _item in obj["inline"]] if obj.get("inline") is not None else None - }) - return _obj - - diff --git a/openapi_client/models/kubernetes_secret_provider_spec.py b/openapi_client/models/kubernetes_secret_provider_spec.py deleted file mode 100644 index 84b1561..0000000 --- a/openapi_client/models/kubernetes_secret_provider_spec.py +++ /dev/null @@ -1,93 +0,0 @@ -# coding: utf-8 - -""" - Open Device Management API - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: undefined - 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, Field, StrictStr -from typing import Any, ClassVar, Dict, List -from openapi_client.models.kubernetes_secret_provider_spec_secret_ref import KubernetesSecretProviderSpecSecretRef -from typing import Optional, Set -from typing_extensions import Self - -class KubernetesSecretProviderSpec(BaseModel): - """ - KubernetesSecretProviderSpec - """ # noqa: E501 - name: StrictStr = Field(description="The name of the config provider") - secret_ref: KubernetesSecretProviderSpecSecretRef = Field(alias="secretRef") - __properties: ClassVar[List[str]] = ["name", "secretRef"] - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of KubernetesSecretProviderSpec 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 secret_ref - if self.secret_ref: - _dict['secretRef'] = self.secret_ref.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of KubernetesSecretProviderSpec 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"), - "secretRef": KubernetesSecretProviderSpecSecretRef.from_dict(obj["secretRef"]) if obj.get("secretRef") is not None else None - }) - return _obj - - diff --git a/openapi_client/models/kubernetes_secret_provider_spec_secret_ref.py b/openapi_client/models/kubernetes_secret_provider_spec_secret_ref.py deleted file mode 100644 index 4823169..0000000 --- a/openapi_client/models/kubernetes_secret_provider_spec_secret_ref.py +++ /dev/null @@ -1,91 +0,0 @@ -# coding: utf-8 - -""" - Open Device Management API - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: undefined - 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, Field, StrictStr -from typing import Any, ClassVar, Dict, List -from typing import Optional, Set -from typing_extensions import Self - -class KubernetesSecretProviderSpecSecretRef(BaseModel): - """ - KubernetesSecretProviderSpecSecretRef - """ # noqa: E501 - name: StrictStr - namespace: StrictStr - mount_path: StrictStr = Field(alias="mountPath") - __properties: ClassVar[List[str]] = ["name", "namespace", "mountPath"] - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of KubernetesSecretProviderSpecSecretRef 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 KubernetesSecretProviderSpecSecretRef 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"), - "namespace": obj.get("namespace"), - "mountPath": obj.get("mountPath") - }) - return _obj - - diff --git a/openapi_client/models/label_selector.py b/openapi_client/models/label_selector.py deleted file mode 100644 index f34eae5..0000000 --- a/openapi_client/models/label_selector.py +++ /dev/null @@ -1,98 +0,0 @@ -# coding: utf-8 - -""" - Open Device Management API - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: undefined - 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, Field, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from typing_extensions import Annotated -from openapi_client.models.match_expression import MatchExpression -from typing import Optional, Set -from typing_extensions import Self - -class LabelSelector(BaseModel): - """ - A map of key,value pairs that are ANDed. Empty/null label selectors match nothing. - """ # noqa: E501 - match_labels: Optional[Dict[str, StrictStr]] = Field(default=None, alias="matchLabels") - match_expressions: Optional[Annotated[List[MatchExpression], Field(min_length=1)]] = Field(default=None, alias="matchExpressions") - __properties: ClassVar[List[str]] = ["matchLabels", "matchExpressions"] - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of LabelSelector 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 match_expressions (list) - _items = [] - if self.match_expressions: - for _item_match_expressions in self.match_expressions: - if _item_match_expressions: - _items.append(_item_match_expressions.to_dict()) - _dict['matchExpressions'] = _items - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of LabelSelector from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "matchLabels": obj.get("matchLabels"), - "matchExpressions": [MatchExpression.from_dict(_item) for _item in obj["matchExpressions"]] if obj.get("matchExpressions") is not None else None - }) - return _obj - - diff --git a/openapi_client/models/list_meta.py b/openapi_client/models/list_meta.py deleted file mode 100644 index ab117bc..0000000 --- a/openapi_client/models/list_meta.py +++ /dev/null @@ -1,89 +0,0 @@ -# coding: utf-8 - -""" - Open Device Management API - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: undefined - 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, Field, StrictInt, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from typing import Optional, Set -from typing_extensions import Self - -class ListMeta(BaseModel): - """ - ListMeta describes metadata that synthetic resources must have, including lists and various status objects. A resource may have only one of {ObjectMeta, ListMeta}. - """ # noqa: E501 - var_continue: Optional[StrictStr] = Field(default=None, description="continue may be set if the user set a limit on the number of items returned, and indicates that the server has more data available. The value is opaque and may be used to issue another request to the endpoint that served this list to retrieve the next set of available objects. Continuing a consistent list may not be possible if the server configuration has changed or more than a few minutes have passed. The resourceVersion field returned when using this continue value will be identical to the value in the first response, unless you have received this token from an error message.", alias="continue") - remaining_item_count: Optional[StrictInt] = Field(default=None, description="remainingItemCount is the number of subsequent items in the list which are not included in this list response. If the list request contained label or field selectors, then the number of remaining items is unknown and the field will be left unset and omitted during serialization. If the list is complete (either because it is not chunking or because this is the last chunk), then there are no more remaining items and this field will be left unset and omitted during serialization. Servers older than v1.15 do not set this field. The intended use of the remainingItemCount is *estimating* the size of a collection. Clients should not rely on the remainingItemCount to be set or to be exact.", alias="remainingItemCount") - __properties: ClassVar[List[str]] = ["continue", "remainingItemCount"] - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ListMeta 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 ListMeta from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "continue": obj.get("continue"), - "remainingItemCount": obj.get("remainingItemCount") - }) - return _obj - - diff --git a/openapi_client/models/match_expression.py b/openapi_client/models/match_expression.py deleted file mode 100644 index d22d441..0000000 --- a/openapi_client/models/match_expression.py +++ /dev/null @@ -1,98 +0,0 @@ -# coding: utf-8 - -""" - Open Device Management API - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: undefined - 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, field_validator -from typing import Any, ClassVar, Dict, List, Optional -from typing import Optional, Set -from typing_extensions import Self - -class MatchExpression(BaseModel): - """ - MatchExpression - """ # noqa: E501 - key: StrictStr - operator: StrictStr - values: Optional[List[StrictStr]] = None - __properties: ClassVar[List[str]] = ["key", "operator", "values"] - - @field_validator('operator') - def operator_validate_enum(cls, value): - """Validates the enum""" - if value not in set(['In', 'NotIn', 'Exists', 'DoesNotExist']): - raise ValueError("must be one of enum values ('In', 'NotIn', 'Exists', 'DoesNotExist')") - return value - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of MatchExpression 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 MatchExpression from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "key": obj.get("key"), - "operator": obj.get("operator"), - "values": obj.get("values") - }) - return _obj - - diff --git a/openapi_client/models/memory_resource_monitor_spec.py b/openapi_client/models/memory_resource_monitor_spec.py deleted file mode 100644 index f1db4ed..0000000 --- a/openapi_client/models/memory_resource_monitor_spec.py +++ /dev/null @@ -1,107 +0,0 @@ -# coding: utf-8 - -""" - Open Device Management API - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: undefined - 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, Field, StrictStr, field_validator -from typing import Any, ClassVar, Dict, List -from typing_extensions import Annotated -from openapi_client.models.resource_alert_rule import ResourceAlertRule -from typing import Optional, Set -from typing_extensions import Self - -class MemoryResourceMonitorSpec(BaseModel): - """ - MemoryResourceMonitorSpec - """ # noqa: E501 - monitor_type: StrictStr = Field(alias="monitorType") - alert_rules: List[ResourceAlertRule] = Field(description="Array of alert rules. Only one alert per severity is allowed.", alias="alertRules") - sampling_interval: Annotated[str, Field(strict=True)] = Field(description="Duration between monitor samples. Format: positive integer followed by 's' for seconds, 'm' for minutes, 'h' for hours.", alias="samplingInterval") - __properties: ClassVar[List[str]] = ["monitorType", "alertRules", "samplingInterval"] - - @field_validator('sampling_interval') - def sampling_interval_validate_regular_expression(cls, value): - """Validates the regular expression""" - if not re.match(r"^[1-9]\d*[smh]$", value): - raise ValueError(r"must validate the regular expression /^[1-9]\d*[smh]$/") - return value - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of MemoryResourceMonitorSpec 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 alert_rules (list) - _items = [] - if self.alert_rules: - for _item_alert_rules in self.alert_rules: - if _item_alert_rules: - _items.append(_item_alert_rules.to_dict()) - _dict['alertRules'] = _items - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of MemoryResourceMonitorSpec from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "monitorType": obj.get("monitorType"), - "alertRules": [ResourceAlertRule.from_dict(_item) for _item in obj["alertRules"]] if obj.get("alertRules") is not None else None, - "samplingInterval": obj.get("samplingInterval") - }) - return _obj - - diff --git a/openapi_client/models/object_meta.py b/openapi_client/models/object_meta.py deleted file mode 100644 index 18aa717..0000000 --- a/openapi_client/models/object_meta.py +++ /dev/null @@ -1,102 +0,0 @@ -# coding: utf-8 - -""" - Open Device Management API - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: undefined - 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, Field, StrictInt, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from typing import Optional, Set -from typing_extensions import Self - -class ObjectMeta(BaseModel): - """ - ObjectMeta is metadata that all persisted resources must have, which includes all objects users must create. - """ # noqa: E501 - creation_timestamp: Optional[datetime] = Field(default=None, alias="creationTimestamp") - deletion_timestamp: Optional[datetime] = Field(default=None, alias="deletionTimestamp") - name: Optional[StrictStr] = Field(default=None, description="name of the object") - labels: Optional[Dict[str, StrictStr]] = Field(default=None, description="Map of string keys and values that can be used to organize and categorize (scope and select) objects.") - generation: Optional[StrictInt] = Field(default=None, description="A sequence number representing a specific generation of the desired state. Populated by the system. Read-only.") - owner: Optional[StrictStr] = Field(default=None, description="A resource that owns this resource, in \"kind/name\" format.") - annotations: Optional[Dict[str, StrictStr]] = Field(default=None, description="Properties set by the service.") - resource_version: Optional[StrictStr] = Field(default=None, description="An opaque string that identifies the server's internal version of an object.", alias="resourceVersion") - __properties: ClassVar[List[str]] = ["creationTimestamp", "deletionTimestamp", "name", "labels", "generation", "owner", "annotations", "resourceVersion"] - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ObjectMeta 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 ObjectMeta from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "creationTimestamp": obj.get("creationTimestamp"), - "deletionTimestamp": obj.get("deletionTimestamp"), - "name": obj.get("name"), - "labels": obj.get("labels"), - "generation": obj.get("generation"), - "owner": obj.get("owner"), - "annotations": obj.get("annotations"), - "resourceVersion": obj.get("resourceVersion") - }) - return _obj - - diff --git a/openapi_client/models/patch_request_inner.py b/openapi_client/models/patch_request_inner.py deleted file mode 100644 index b3a3ef9..0000000 --- a/openapi_client/models/patch_request_inner.py +++ /dev/null @@ -1,103 +0,0 @@ -# coding: utf-8 - -""" - Open Device Management API - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: undefined - 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, Field, StrictStr, field_validator -from typing import Any, ClassVar, Dict, List, Optional -from typing import Optional, Set -from typing_extensions import Self - -class PatchRequestInner(BaseModel): - """ - PatchRequestInner - """ # noqa: E501 - path: StrictStr = Field(description="A JSON Pointer path.") - value: Optional[Any] = Field(default=None, description="The value to add or replace.") - op: StrictStr = Field(description="The operation to perform.") - __properties: ClassVar[List[str]] = ["path", "value", "op"] - - @field_validator('op') - def op_validate_enum(cls, value): - """Validates the enum""" - if value not in set(['add', 'replace', 'remove']): - raise ValueError("must be one of enum values ('add', 'replace', 'remove')") - return value - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of PatchRequestInner 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, - ) - # set to None if value (nullable) is None - # and model_fields_set contains the field - if self.value is None and "value" in self.model_fields_set: - _dict['value'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of PatchRequestInner from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "path": obj.get("path"), - "value": obj.get("value"), - "op": obj.get("op") - }) - return _obj - - diff --git a/openapi_client/models/rendered_application_spec.py b/openapi_client/models/rendered_application_spec.py deleted file mode 100644 index a81bb0a..0000000 --- a/openapi_client/models/rendered_application_spec.py +++ /dev/null @@ -1,91 +0,0 @@ -# coding: utf-8 - -""" - Open Device Management API - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: undefined - 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, Field, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from typing import Optional, Set -from typing_extensions import Self - -class RenderedApplicationSpec(BaseModel): - """ - RenderedApplicationSpec - """ # noqa: E501 - env_vars: Optional[Dict[str, StrictStr]] = Field(default=None, description="Environment variable key-value pairs, injected during runtime", alias="envVars") - name: Optional[StrictStr] = None - image: StrictStr = Field(description="Reference to the container image for the application package") - __properties: ClassVar[List[str]] = ["envVars", "name", "image"] - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of RenderedApplicationSpec 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 RenderedApplicationSpec from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "envVars": obj.get("envVars"), - "name": obj.get("name"), - "image": obj.get("image") - }) - return _obj - - diff --git a/openapi_client/models/rendered_device_spec.py b/openapi_client/models/rendered_device_spec.py deleted file mode 100644 index a8c9a99..0000000 --- a/openapi_client/models/rendered_device_spec.py +++ /dev/null @@ -1,133 +0,0 @@ -# coding: utf-8 - -""" - Open Device Management API - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: undefined - 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, Field, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from openapi_client.models.device_console import DeviceConsole -from openapi_client.models.device_hooks_spec import DeviceHooksSpec -from openapi_client.models.device_os_spec import DeviceOSSpec -from openapi_client.models.rendered_application_spec import RenderedApplicationSpec -from openapi_client.models.rendered_device_spec_systemd import RenderedDeviceSpecSystemd -from openapi_client.models.resource_monitor import ResourceMonitor -from typing import Optional, Set -from typing_extensions import Self - -class RenderedDeviceSpec(BaseModel): - """ - RenderedDeviceSpec - """ # noqa: E501 - rendered_version: StrictStr = Field(alias="renderedVersion") - os: Optional[DeviceOSSpec] = None - config: Optional[StrictStr] = None - applications: Optional[List[RenderedApplicationSpec]] = None - hooks: Optional[DeviceHooksSpec] = None - systemd: Optional[RenderedDeviceSpecSystemd] = None - resources: Optional[List[ResourceMonitor]] = Field(default=None, description="Array of resource monitor configurations.") - console: Optional[DeviceConsole] = None - __properties: ClassVar[List[str]] = ["renderedVersion", "os", "config", "applications", "hooks", "systemd", "resources", "console"] - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of RenderedDeviceSpec 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 os - if self.os: - _dict['os'] = self.os.to_dict() - # override the default output from pydantic by calling `to_dict()` of each item in applications (list) - _items = [] - if self.applications: - for _item_applications in self.applications: - if _item_applications: - _items.append(_item_applications.to_dict()) - _dict['applications'] = _items - # override the default output from pydantic by calling `to_dict()` of hooks - if self.hooks: - _dict['hooks'] = self.hooks.to_dict() - # override the default output from pydantic by calling `to_dict()` of systemd - if self.systemd: - _dict['systemd'] = self.systemd.to_dict() - # override the default output from pydantic by calling `to_dict()` of each item in resources (list) - _items = [] - if self.resources: - for _item_resources in self.resources: - if _item_resources: - _items.append(_item_resources.to_dict()) - _dict['resources'] = _items - # override the default output from pydantic by calling `to_dict()` of console - if self.console: - _dict['console'] = self.console.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of RenderedDeviceSpec from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "renderedVersion": obj.get("renderedVersion"), - "os": DeviceOSSpec.from_dict(obj["os"]) if obj.get("os") is not None else None, - "config": obj.get("config"), - "applications": [RenderedApplicationSpec.from_dict(_item) for _item in obj["applications"]] if obj.get("applications") is not None else None, - "hooks": DeviceHooksSpec.from_dict(obj["hooks"]) if obj.get("hooks") is not None else None, - "systemd": RenderedDeviceSpecSystemd.from_dict(obj["systemd"]) if obj.get("systemd") is not None else None, - "resources": [ResourceMonitor.from_dict(_item) for _item in obj["resources"]] if obj.get("resources") is not None else None, - "console": DeviceConsole.from_dict(obj["console"]) if obj.get("console") is not None else None - }) - return _obj - - diff --git a/openapi_client/models/rendered_device_spec_systemd.py b/openapi_client/models/rendered_device_spec_systemd.py deleted file mode 100644 index 62d10f0..0000000 --- a/openapi_client/models/rendered_device_spec_systemd.py +++ /dev/null @@ -1,87 +0,0 @@ -# coding: utf-8 - -""" - Open Device Management API - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: undefined - 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, Field, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from typing import Optional, Set -from typing_extensions import Self - -class RenderedDeviceSpecSystemd(BaseModel): - """ - RenderedDeviceSpecSystemd - """ # noqa: E501 - match_patterns: Optional[List[StrictStr]] = Field(default=None, alias="matchPatterns") - __properties: ClassVar[List[str]] = ["matchPatterns"] - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of RenderedDeviceSpecSystemd 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 RenderedDeviceSpecSystemd from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "matchPatterns": obj.get("matchPatterns") - }) - return _obj - - diff --git a/openapi_client/models/repo_spec_type.py b/openapi_client/models/repo_spec_type.py deleted file mode 100644 index 529b04b..0000000 --- a/openapi_client/models/repo_spec_type.py +++ /dev/null @@ -1,37 +0,0 @@ -# coding: utf-8 - -""" - Open Device Management API - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: undefined - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import json -from enum import Enum -from typing_extensions import Self - - -class RepoSpecType(str, Enum): - """ - RepoSpecType is the type of the repository - """ - - """ - allowed enum values - """ - GIT = 'git' - HTTP = 'http' - - @classmethod - def from_json(cls, json_str: str) -> Self: - """Create an instance of RepoSpecType from a JSON string""" - return cls(json.loads(json_str)) - - diff --git a/openapi_client/models/repository.py b/openapi_client/models/repository.py deleted file mode 100644 index 770b49a..0000000 --- a/openapi_client/models/repository.py +++ /dev/null @@ -1,107 +0,0 @@ -# coding: utf-8 - -""" - Open Device Management API - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: undefined - 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, Field, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from openapi_client.models.object_meta import ObjectMeta -from openapi_client.models.repository_spec import RepositorySpec -from openapi_client.models.repository_status import RepositoryStatus -from typing import Optional, Set -from typing_extensions import Self - -class Repository(BaseModel): - """ - Repository represents a Git repository or an HTTP endpoint - """ # noqa: E501 - api_version: StrictStr = Field(description="APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", alias="apiVersion") - kind: StrictStr = Field(description="Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds") - metadata: ObjectMeta - spec: Optional[RepositorySpec] = None - status: Optional[RepositoryStatus] = None - __properties: ClassVar[List[str]] = ["apiVersion", "kind", "metadata", "spec", "status"] - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of Repository 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 metadata - if self.metadata: - _dict['metadata'] = self.metadata.to_dict() - # override the default output from pydantic by calling `to_dict()` of spec - if self.spec: - _dict['spec'] = self.spec.to_dict() - # override the default output from pydantic by calling `to_dict()` of status - if self.status: - _dict['status'] = self.status.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of Repository from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "apiVersion": obj.get("apiVersion"), - "kind": obj.get("kind"), - "metadata": ObjectMeta.from_dict(obj["metadata"]) if obj.get("metadata") is not None else None, - "spec": RepositorySpec.from_dict(obj["spec"]) if obj.get("spec") is not None else None, - "status": RepositoryStatus.from_dict(obj["status"]) if obj.get("status") is not None else None - }) - return _obj - - diff --git a/openapi_client/models/repository_list.py b/openapi_client/models/repository_list.py deleted file mode 100644 index 7b9b026..0000000 --- a/openapi_client/models/repository_list.py +++ /dev/null @@ -1,105 +0,0 @@ -# coding: utf-8 - -""" - Open Device Management API - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: undefined - 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, Field, StrictStr -from typing import Any, ClassVar, Dict, List -from openapi_client.models.list_meta import ListMeta -from openapi_client.models.repository import Repository -from typing import Optional, Set -from typing_extensions import Self - -class RepositoryList(BaseModel): - """ - RepositoryList is a list of Repositories. - """ # noqa: E501 - api_version: StrictStr = Field(description="APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", alias="apiVersion") - kind: StrictStr = Field(description="Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds") - metadata: ListMeta - items: List[Repository] = Field(description="List of repositories.") - __properties: ClassVar[List[str]] = ["apiVersion", "kind", "metadata", "items"] - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of RepositoryList 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 metadata - if self.metadata: - _dict['metadata'] = self.metadata.to_dict() - # override the default output from pydantic by calling `to_dict()` of each item in items (list) - _items = [] - if self.items: - for _item_items in self.items: - if _item_items: - _items.append(_item_items.to_dict()) - _dict['items'] = _items - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of RepositoryList from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "apiVersion": obj.get("apiVersion"), - "kind": obj.get("kind"), - "metadata": ListMeta.from_dict(obj["metadata"]) if obj.get("metadata") is not None else None, - "items": [Repository.from_dict(_item) for _item in obj["items"]] if obj.get("items") is not None else None - }) - return _obj - - diff --git a/openapi_client/models/repository_spec.py b/openapi_client/models/repository_spec.py deleted file mode 100644 index e0a7425..0000000 --- a/openapi_client/models/repository_spec.py +++ /dev/null @@ -1,151 +0,0 @@ -# coding: utf-8 - -""" - Open Device Management API - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: undefined - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import json -import pprint -from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator -from typing import Any, List, Optional -from openapi_client.models.generic_repo_spec import GenericRepoSpec -from openapi_client.models.http_repo_spec import HttpRepoSpec -from openapi_client.models.ssh_repo_spec import SshRepoSpec -from pydantic import StrictStr, Field -from typing import Union, List, Set, Optional, Dict -from typing_extensions import Literal, Self - -REPOSITORYSPEC_ONE_OF_SCHEMAS = ["GenericRepoSpec", "HttpRepoSpec", "SshRepoSpec"] - -class RepositorySpec(BaseModel): - """ - RepositorySpec - """ - # data type: GenericRepoSpec - oneof_schema_1_validator: Optional[GenericRepoSpec] = None - # data type: HttpRepoSpec - oneof_schema_2_validator: Optional[HttpRepoSpec] = None - # data type: SshRepoSpec - oneof_schema_3_validator: Optional[SshRepoSpec] = None - actual_instance: Optional[Union[GenericRepoSpec, HttpRepoSpec, SshRepoSpec]] = None - one_of_schemas: Set[str] = { "GenericRepoSpec", "HttpRepoSpec", "SshRepoSpec" } - - model_config = ConfigDict( - validate_assignment=True, - protected_namespaces=(), - ) - - - def __init__(self, *args, **kwargs) -> None: - if args: - if len(args) > 1: - raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") - if kwargs: - raise ValueError("If a position argument is used, keyword arguments cannot be used.") - super().__init__(actual_instance=args[0]) - else: - super().__init__(**kwargs) - - @field_validator('actual_instance') - def actual_instance_must_validate_oneof(cls, v): - instance = RepositorySpec.model_construct() - error_messages = [] - match = 0 - # validate data type: GenericRepoSpec - if not isinstance(v, GenericRepoSpec): - error_messages.append(f"Error! Input type `{type(v)}` is not `GenericRepoSpec`") - else: - match += 1 - # validate data type: HttpRepoSpec - if not isinstance(v, HttpRepoSpec): - error_messages.append(f"Error! Input type `{type(v)}` is not `HttpRepoSpec`") - else: - match += 1 - # validate data type: SshRepoSpec - if not isinstance(v, SshRepoSpec): - error_messages.append(f"Error! Input type `{type(v)}` is not `SshRepoSpec`") - else: - match += 1 - if match > 1: - # more than 1 match - raise ValueError("Multiple matches found when setting `actual_instance` in RepositorySpec with oneOf schemas: GenericRepoSpec, HttpRepoSpec, SshRepoSpec. Details: " + ", ".join(error_messages)) - elif match == 0: - # no match - raise ValueError("No match found when setting `actual_instance` in RepositorySpec with oneOf schemas: GenericRepoSpec, HttpRepoSpec, SshRepoSpec. Details: " + ", ".join(error_messages)) - else: - return v - - @classmethod - def from_dict(cls, obj: Union[str, Dict[str, Any]]) -> Self: - return cls.from_json(json.dumps(obj)) - - @classmethod - def from_json(cls, json_str: str) -> Self: - """Returns the object represented by the json string""" - instance = cls.model_construct() - error_messages = [] - match = 0 - - # deserialize data into GenericRepoSpec - try: - instance.actual_instance = GenericRepoSpec.from_json(json_str) - match += 1 - except (ValidationError, ValueError) as e: - error_messages.append(str(e)) - # deserialize data into HttpRepoSpec - try: - instance.actual_instance = HttpRepoSpec.from_json(json_str) - match += 1 - except (ValidationError, ValueError) as e: - error_messages.append(str(e)) - # deserialize data into SshRepoSpec - try: - instance.actual_instance = SshRepoSpec.from_json(json_str) - match += 1 - except (ValidationError, ValueError) as e: - error_messages.append(str(e)) - - if match > 1: - # more than 1 match - raise ValueError("Multiple matches found when deserializing the JSON string into RepositorySpec with oneOf schemas: GenericRepoSpec, HttpRepoSpec, SshRepoSpec. Details: " + ", ".join(error_messages)) - elif match == 0: - # no match - raise ValueError("No match found when deserializing the JSON string into RepositorySpec with oneOf schemas: GenericRepoSpec, HttpRepoSpec, SshRepoSpec. Details: " + ", ".join(error_messages)) - else: - return instance - - def to_json(self) -> str: - """Returns the JSON representation of the actual instance""" - if self.actual_instance is None: - return "null" - - if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): - return self.actual_instance.to_json() - else: - return json.dumps(self.actual_instance) - - def to_dict(self) -> Optional[Union[Dict[str, Any], GenericRepoSpec, HttpRepoSpec, SshRepoSpec]]: - """Returns the dict representation of the actual instance""" - if self.actual_instance is None: - return None - - if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): - return self.actual_instance.to_dict() - else: - # primitive type - return self.actual_instance - - def to_str(self) -> str: - """Returns the string representation of the actual instance""" - return pprint.pformat(self.model_dump()) - - diff --git a/openapi_client/models/repository_status.py b/openapi_client/models/repository_status.py deleted file mode 100644 index 64b9017..0000000 --- a/openapi_client/models/repository_status.py +++ /dev/null @@ -1,95 +0,0 @@ -# coding: utf-8 - -""" - Open Device Management API - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: undefined - 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, Field -from typing import Any, ClassVar, Dict, List -from openapi_client.models.condition import Condition -from typing import Optional, Set -from typing_extensions import Self - -class RepositoryStatus(BaseModel): - """ - RepositoryStatus represents information about the status of a repository. Status may trail the actual state of a repository. - """ # noqa: E501 - conditions: List[Condition] = Field(description="Current state of the repository.") - __properties: ClassVar[List[str]] = ["conditions"] - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of RepositoryStatus 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 conditions (list) - _items = [] - if self.conditions: - for _item_conditions in self.conditions: - if _item_conditions: - _items.append(_item_conditions.to_dict()) - _dict['conditions'] = _items - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of RepositoryStatus from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "conditions": [Condition.from_dict(_item) for _item in obj["conditions"]] if obj.get("conditions") is not None else None - }) - return _obj - - diff --git a/openapi_client/models/resource_alert_rule.py b/openapi_client/models/resource_alert_rule.py deleted file mode 100644 index 4cfbe9b..0000000 --- a/openapi_client/models/resource_alert_rule.py +++ /dev/null @@ -1,102 +0,0 @@ -# coding: utf-8 - -""" - Open Device Management API - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: undefined - 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, Field, StrictFloat, StrictInt, StrictStr, field_validator -from typing import Any, ClassVar, Dict, List, Union -from typing_extensions import Annotated -from openapi_client.models.resource_alert_severity_type import ResourceAlertSeverityType -from typing import Optional, Set -from typing_extensions import Self - -class ResourceAlertRule(BaseModel): - """ - ResourceAlertRule - """ # noqa: E501 - severity: ResourceAlertSeverityType - duration: Annotated[str, Field(strict=True)] = Field(description="Duration is the time over which the average usage is observed before alerting. Format: positive integer followed by 's' for seconds, 'm' for minutes, 'h' for hours.") - percentage: Union[StrictFloat, StrictInt] = Field(description="The percentage of usage that triggers the alert.") - description: StrictStr = Field(description="A human-readable description of the alert.") - __properties: ClassVar[List[str]] = ["severity", "duration", "percentage", "description"] - - @field_validator('duration') - def duration_validate_regular_expression(cls, value): - """Validates the regular expression""" - if not re.match(r"^\d+[smh]$", value): - raise ValueError(r"must validate the regular expression /^\d+[smh]$/") - return value - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ResourceAlertRule 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 ResourceAlertRule from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "severity": obj.get("severity"), - "duration": obj.get("duration"), - "percentage": obj.get("percentage"), - "description": obj.get("description") - }) - return _obj - - diff --git a/openapi_client/models/resource_alert_severity_type.py b/openapi_client/models/resource_alert_severity_type.py deleted file mode 100644 index de1688e..0000000 --- a/openapi_client/models/resource_alert_severity_type.py +++ /dev/null @@ -1,38 +0,0 @@ -# coding: utf-8 - -""" - Open Device Management API - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: undefined - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import json -from enum import Enum -from typing_extensions import Self - - -class ResourceAlertSeverityType(str, Enum): - """ - ResourceAlertSeverityType - """ - - """ - allowed enum values - """ - WARNING = 'Warning' - CRITICAL = 'Critical' - INFO = 'Info' - - @classmethod - def from_json(cls, json_str: str) -> Self: - """Create an instance of ResourceAlertSeverityType from a JSON string""" - return cls(json.loads(json_str)) - - diff --git a/openapi_client/models/resource_monitor.py b/openapi_client/models/resource_monitor.py deleted file mode 100644 index a8d206a..0000000 --- a/openapi_client/models/resource_monitor.py +++ /dev/null @@ -1,154 +0,0 @@ -# coding: utf-8 - -""" - Open Device Management API - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: undefined - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import json -import pprint -from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator -from typing import Any, List, Optional -from openapi_client.models.cpu_resource_monitor_spec import CPUResourceMonitorSpec -from openapi_client.models.disk_resource_monitor_spec import DiskResourceMonitorSpec -from openapi_client.models.memory_resource_monitor_spec import MemoryResourceMonitorSpec -from pydantic import StrictStr, Field -from typing import Union, List, Set, Optional, Dict -from typing_extensions import Literal, Self - -RESOURCEMONITOR_ONE_OF_SCHEMAS = ["CPUResourceMonitorSpec", "DiskResourceMonitorSpec", "MemoryResourceMonitorSpec"] - -class ResourceMonitor(BaseModel): - """ - ResourceMonitor - """ - # data type: CPUResourceMonitorSpec - oneof_schema_1_validator: Optional[CPUResourceMonitorSpec] = None - # data type: MemoryResourceMonitorSpec - oneof_schema_2_validator: Optional[MemoryResourceMonitorSpec] = None - # data type: DiskResourceMonitorSpec - oneof_schema_3_validator: Optional[DiskResourceMonitorSpec] = None - actual_instance: Optional[Union[CPUResourceMonitorSpec, DiskResourceMonitorSpec, MemoryResourceMonitorSpec]] = None - one_of_schemas: Set[str] = { "CPUResourceMonitorSpec", "DiskResourceMonitorSpec", "MemoryResourceMonitorSpec" } - - model_config = ConfigDict( - validate_assignment=True, - protected_namespaces=(), - ) - - - discriminator_value_class_map: Dict[str, str] = { - } - - def __init__(self, *args, **kwargs) -> None: - if args: - if len(args) > 1: - raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") - if kwargs: - raise ValueError("If a position argument is used, keyword arguments cannot be used.") - super().__init__(actual_instance=args[0]) - else: - super().__init__(**kwargs) - - @field_validator('actual_instance') - def actual_instance_must_validate_oneof(cls, v): - instance = ResourceMonitor.model_construct() - error_messages = [] - match = 0 - # validate data type: CPUResourceMonitorSpec - if not isinstance(v, CPUResourceMonitorSpec): - error_messages.append(f"Error! Input type `{type(v)}` is not `CPUResourceMonitorSpec`") - else: - match += 1 - # validate data type: MemoryResourceMonitorSpec - if not isinstance(v, MemoryResourceMonitorSpec): - error_messages.append(f"Error! Input type `{type(v)}` is not `MemoryResourceMonitorSpec`") - else: - match += 1 - # validate data type: DiskResourceMonitorSpec - if not isinstance(v, DiskResourceMonitorSpec): - error_messages.append(f"Error! Input type `{type(v)}` is not `DiskResourceMonitorSpec`") - else: - match += 1 - if match > 1: - # more than 1 match - raise ValueError("Multiple matches found when setting `actual_instance` in ResourceMonitor with oneOf schemas: CPUResourceMonitorSpec, DiskResourceMonitorSpec, MemoryResourceMonitorSpec. Details: " + ", ".join(error_messages)) - elif match == 0: - # no match - raise ValueError("No match found when setting `actual_instance` in ResourceMonitor with oneOf schemas: CPUResourceMonitorSpec, DiskResourceMonitorSpec, MemoryResourceMonitorSpec. Details: " + ", ".join(error_messages)) - else: - return v - - @classmethod - def from_dict(cls, obj: Union[str, Dict[str, Any]]) -> Self: - return cls.from_json(json.dumps(obj)) - - @classmethod - def from_json(cls, json_str: str) -> Self: - """Returns the object represented by the json string""" - instance = cls.model_construct() - error_messages = [] - match = 0 - - # deserialize data into CPUResourceMonitorSpec - try: - instance.actual_instance = CPUResourceMonitorSpec.from_json(json_str) - match += 1 - except (ValidationError, ValueError) as e: - error_messages.append(str(e)) - # deserialize data into MemoryResourceMonitorSpec - try: - instance.actual_instance = MemoryResourceMonitorSpec.from_json(json_str) - match += 1 - except (ValidationError, ValueError) as e: - error_messages.append(str(e)) - # deserialize data into DiskResourceMonitorSpec - try: - instance.actual_instance = DiskResourceMonitorSpec.from_json(json_str) - match += 1 - except (ValidationError, ValueError) as e: - error_messages.append(str(e)) - - if match > 1: - # more than 1 match - raise ValueError("Multiple matches found when deserializing the JSON string into ResourceMonitor with oneOf schemas: CPUResourceMonitorSpec, DiskResourceMonitorSpec, MemoryResourceMonitorSpec. Details: " + ", ".join(error_messages)) - elif match == 0: - # no match - raise ValueError("No match found when deserializing the JSON string into ResourceMonitor with oneOf schemas: CPUResourceMonitorSpec, DiskResourceMonitorSpec, MemoryResourceMonitorSpec. Details: " + ", ".join(error_messages)) - else: - return instance - - def to_json(self) -> str: - """Returns the JSON representation of the actual instance""" - if self.actual_instance is None: - return "null" - - if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): - return self.actual_instance.to_json() - else: - return json.dumps(self.actual_instance) - - def to_dict(self) -> Optional[Union[Dict[str, Any], CPUResourceMonitorSpec, DiskResourceMonitorSpec, MemoryResourceMonitorSpec]]: - """Returns the dict representation of the actual instance""" - if self.actual_instance is None: - return None - - if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): - return self.actual_instance.to_dict() - else: - # primitive type - return self.actual_instance - - def to_str(self) -> str: - """Returns the string representation of the actual instance""" - return pprint.pformat(self.model_dump()) - - diff --git a/openapi_client/models/resource_monitor_spec.py b/openapi_client/models/resource_monitor_spec.py deleted file mode 100644 index 1199cdf..0000000 --- a/openapi_client/models/resource_monitor_spec.py +++ /dev/null @@ -1,107 +0,0 @@ -# coding: utf-8 - -""" - Open Device Management API - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: undefined - 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, Field, StrictStr, field_validator -from typing import Any, ClassVar, Dict, List -from typing_extensions import Annotated -from openapi_client.models.resource_alert_rule import ResourceAlertRule -from typing import Optional, Set -from typing_extensions import Self - -class ResourceMonitorSpec(BaseModel): - """ - ResourceMonitorSpec - """ # noqa: E501 - monitor_type: StrictStr = Field(alias="monitorType") - alert_rules: List[ResourceAlertRule] = Field(description="Array of alert rules. Only one alert per severity is allowed.", alias="alertRules") - sampling_interval: Annotated[str, Field(strict=True)] = Field(description="Duration between monitor samples. Format: positive integer followed by 's' for seconds, 'm' for minutes, 'h' for hours.", alias="samplingInterval") - __properties: ClassVar[List[str]] = ["monitorType", "alertRules", "samplingInterval"] - - @field_validator('sampling_interval') - def sampling_interval_validate_regular_expression(cls, value): - """Validates the regular expression""" - if not re.match(r"^[1-9]\d*[smh]$", value): - raise ValueError(r"must validate the regular expression /^[1-9]\d*[smh]$/") - return value - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ResourceMonitorSpec 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 alert_rules (list) - _items = [] - if self.alert_rules: - for _item_alert_rules in self.alert_rules: - if _item_alert_rules: - _items.append(_item_alert_rules.to_dict()) - _dict['alertRules'] = _items - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ResourceMonitorSpec from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "monitorType": obj.get("monitorType"), - "alertRules": [ResourceAlertRule.from_dict(_item) for _item in obj["alertRules"]] if obj.get("alertRules") is not None else None, - "samplingInterval": obj.get("samplingInterval") - }) - return _obj - - diff --git a/openapi_client/models/resource_sync.py b/openapi_client/models/resource_sync.py deleted file mode 100644 index 1450601..0000000 --- a/openapi_client/models/resource_sync.py +++ /dev/null @@ -1,107 +0,0 @@ -# coding: utf-8 - -""" - Open Device Management API - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: undefined - 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, Field, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from openapi_client.models.object_meta import ObjectMeta -from openapi_client.models.resource_sync_spec import ResourceSyncSpec -from openapi_client.models.resource_sync_status import ResourceSyncStatus -from typing import Optional, Set -from typing_extensions import Self - -class ResourceSync(BaseModel): - """ - ResourceSync represents a reference to one or more files in a repository to sync to resource definitions - """ # noqa: E501 - api_version: StrictStr = Field(description="APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", alias="apiVersion") - kind: StrictStr = Field(description="Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds") - metadata: ObjectMeta - spec: ResourceSyncSpec - status: Optional[ResourceSyncStatus] = None - __properties: ClassVar[List[str]] = ["apiVersion", "kind", "metadata", "spec", "status"] - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ResourceSync 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 metadata - if self.metadata: - _dict['metadata'] = self.metadata.to_dict() - # override the default output from pydantic by calling `to_dict()` of spec - if self.spec: - _dict['spec'] = self.spec.to_dict() - # override the default output from pydantic by calling `to_dict()` of status - if self.status: - _dict['status'] = self.status.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ResourceSync from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "apiVersion": obj.get("apiVersion"), - "kind": obj.get("kind"), - "metadata": ObjectMeta.from_dict(obj["metadata"]) if obj.get("metadata") is not None else None, - "spec": ResourceSyncSpec.from_dict(obj["spec"]) if obj.get("spec") is not None else None, - "status": ResourceSyncStatus.from_dict(obj["status"]) if obj.get("status") is not None else None - }) - return _obj - - diff --git a/openapi_client/models/resource_sync_list.py b/openapi_client/models/resource_sync_list.py deleted file mode 100644 index d369332..0000000 --- a/openapi_client/models/resource_sync_list.py +++ /dev/null @@ -1,105 +0,0 @@ -# coding: utf-8 - -""" - Open Device Management API - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: undefined - 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, Field, StrictStr -from typing import Any, ClassVar, Dict, List -from openapi_client.models.list_meta import ListMeta -from openapi_client.models.resource_sync import ResourceSync -from typing import Optional, Set -from typing_extensions import Self - -class ResourceSyncList(BaseModel): - """ - ResourceSyncList - """ # noqa: E501 - api_version: StrictStr = Field(description="APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", alias="apiVersion") - kind: StrictStr = Field(description="Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds") - metadata: ListMeta - items: List[ResourceSync] = Field(description="List of resourcesync.") - __properties: ClassVar[List[str]] = ["apiVersion", "kind", "metadata", "items"] - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ResourceSyncList 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 metadata - if self.metadata: - _dict['metadata'] = self.metadata.to_dict() - # override the default output from pydantic by calling `to_dict()` of each item in items (list) - _items = [] - if self.items: - for _item_items in self.items: - if _item_items: - _items.append(_item_items.to_dict()) - _dict['items'] = _items - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ResourceSyncList from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "apiVersion": obj.get("apiVersion"), - "kind": obj.get("kind"), - "metadata": ListMeta.from_dict(obj["metadata"]) if obj.get("metadata") is not None else None, - "items": [ResourceSync.from_dict(_item) for _item in obj["items"]] if obj.get("items") is not None else None - }) - return _obj - - diff --git a/openapi_client/models/resource_sync_spec.py b/openapi_client/models/resource_sync_spec.py deleted file mode 100644 index 71366b8..0000000 --- a/openapi_client/models/resource_sync_spec.py +++ /dev/null @@ -1,91 +0,0 @@ -# coding: utf-8 - -""" - Open Device Management API - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: undefined - 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, Field, StrictStr -from typing import Any, ClassVar, Dict, List -from typing import Optional, Set -from typing_extensions import Self - -class ResourceSyncSpec(BaseModel): - """ - ResourceSyncSpec - """ # noqa: E501 - repository: StrictStr = Field(description="The name of the repository resource to use as the sync source ") - target_revision: StrictStr = Field(description="The desired revision in the repository", alias="targetRevision") - path: StrictStr = Field(description="The path of a file or directory in the repository. If a directory, the directory should contain only resource definitions with no subdirectories. Each file should contain the definition of one or more resources. ") - __properties: ClassVar[List[str]] = ["repository", "targetRevision", "path"] - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ResourceSyncSpec 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 ResourceSyncSpec from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "repository": obj.get("repository"), - "targetRevision": obj.get("targetRevision"), - "path": obj.get("path") - }) - return _obj - - diff --git a/openapi_client/models/resource_sync_status.py b/openapi_client/models/resource_sync_status.py deleted file mode 100644 index c5fbaa8..0000000 --- a/openapi_client/models/resource_sync_status.py +++ /dev/null @@ -1,99 +0,0 @@ -# coding: utf-8 - -""" - Open Device Management API - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: undefined - 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, Field, StrictInt, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from openapi_client.models.condition import Condition -from typing import Optional, Set -from typing_extensions import Self - -class ResourceSyncStatus(BaseModel): - """ - ResourceSyncStatus represents information about the status of a resourcesync - """ # noqa: E501 - observed_commit: Optional[StrictStr] = Field(default=None, description="The last commit hash that was synced ", alias="observedCommit") - observed_generation: Optional[StrictInt] = Field(default=None, description="The last generation that was synced ", alias="observedGeneration") - conditions: List[Condition] = Field(description="Current state of a resourcesync.") - __properties: ClassVar[List[str]] = ["observedCommit", "observedGeneration", "conditions"] - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ResourceSyncStatus 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 conditions (list) - _items = [] - if self.conditions: - for _item_conditions in self.conditions: - if _item_conditions: - _items.append(_item_conditions.to_dict()) - _dict['conditions'] = _items - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ResourceSyncStatus from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "observedCommit": obj.get("observedCommit"), - "observedGeneration": obj.get("observedGeneration"), - "conditions": [Condition.from_dict(_item) for _item in obj["conditions"]] if obj.get("conditions") is not None else None - }) - return _obj - - diff --git a/openapi_client/models/rollout_device_selection.py b/openapi_client/models/rollout_device_selection.py deleted file mode 100644 index 81454e9..0000000 --- a/openapi_client/models/rollout_device_selection.py +++ /dev/null @@ -1,126 +0,0 @@ -# coding: utf-8 - -""" - Open Device Management API - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: undefined - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import json -import pprint -from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator -from typing import Any, List, Optional -from openapi_client.models.batch_sequence import BatchSequence -from pydantic import StrictStr, Field -from typing import Union, List, Set, Optional, Dict -from typing_extensions import Literal, Self - -ROLLOUTDEVICESELECTION_ONE_OF_SCHEMAS = ["BatchSequence"] - -class RolloutDeviceSelection(BaseModel): - """ - RolloutDeviceSelection - """ - # data type: BatchSequence - oneof_schema_1_validator: Optional[BatchSequence] = None - actual_instance: Optional[Union[BatchSequence]] = None - one_of_schemas: Set[str] = { "BatchSequence" } - - model_config = ConfigDict( - validate_assignment=True, - protected_namespaces=(), - ) - - - discriminator_value_class_map: Dict[str, str] = { - } - - def __init__(self, *args, **kwargs) -> None: - if args: - if len(args) > 1: - raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") - if kwargs: - raise ValueError("If a position argument is used, keyword arguments cannot be used.") - super().__init__(actual_instance=args[0]) - else: - super().__init__(**kwargs) - - @field_validator('actual_instance') - def actual_instance_must_validate_oneof(cls, v): - instance = RolloutDeviceSelection.model_construct() - error_messages = [] - match = 0 - # validate data type: BatchSequence - if not isinstance(v, BatchSequence): - error_messages.append(f"Error! Input type `{type(v)}` is not `BatchSequence`") - else: - match += 1 - if match > 1: - # more than 1 match - raise ValueError("Multiple matches found when setting `actual_instance` in RolloutDeviceSelection with oneOf schemas: BatchSequence. Details: " + ", ".join(error_messages)) - elif match == 0: - # no match - raise ValueError("No match found when setting `actual_instance` in RolloutDeviceSelection with oneOf schemas: BatchSequence. Details: " + ", ".join(error_messages)) - else: - return v - - @classmethod - def from_dict(cls, obj: Union[str, Dict[str, Any]]) -> Self: - return cls.from_json(json.dumps(obj)) - - @classmethod - def from_json(cls, json_str: str) -> Self: - """Returns the object represented by the json string""" - instance = cls.model_construct() - error_messages = [] - match = 0 - - # deserialize data into BatchSequence - try: - instance.actual_instance = BatchSequence.from_json(json_str) - match += 1 - except (ValidationError, ValueError) as e: - error_messages.append(str(e)) - - if match > 1: - # more than 1 match - raise ValueError("Multiple matches found when deserializing the JSON string into RolloutDeviceSelection with oneOf schemas: BatchSequence. Details: " + ", ".join(error_messages)) - elif match == 0: - # no match - raise ValueError("No match found when deserializing the JSON string into RolloutDeviceSelection with oneOf schemas: BatchSequence. Details: " + ", ".join(error_messages)) - else: - return instance - - def to_json(self) -> str: - """Returns the JSON representation of the actual instance""" - if self.actual_instance is None: - return "null" - - if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): - return self.actual_instance.to_json() - else: - return json.dumps(self.actual_instance) - - def to_dict(self) -> Optional[Union[Dict[str, Any], BatchSequence]]: - """Returns the dict representation of the actual instance""" - if self.actual_instance is None: - return None - - if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): - return self.actual_instance.to_dict() - else: - # primitive type - return self.actual_instance - - def to_str(self) -> str: - """Returns the string representation of the actual instance""" - return pprint.pformat(self.model_dump()) - - diff --git a/openapi_client/models/rollout_policy.py b/openapi_client/models/rollout_policy.py deleted file mode 100644 index e8a25c0..0000000 --- a/openapi_client/models/rollout_policy.py +++ /dev/null @@ -1,112 +0,0 @@ -# coding: utf-8 - -""" - Open Device Management API - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: undefined - 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, Field, StrictStr, field_validator -from typing import Any, ClassVar, Dict, List, Optional -from typing_extensions import Annotated -from openapi_client.models.disruption_allowance import DisruptionAllowance -from openapi_client.models.rollout_device_selection import RolloutDeviceSelection -from typing import Optional, Set -from typing_extensions import Self - -class RolloutPolicy(BaseModel): - """ - RolloutPolicy is the rollout policy of the fleet. - """ # noqa: E501 - disruption_allowance: Optional[DisruptionAllowance] = Field(default=None, alias="disruptionAllowance") - device_selection: Optional[RolloutDeviceSelection] = Field(default=None, alias="deviceSelection") - success_threshold: Optional[StrictStr] = Field(default=None, description="Percentage is the string format representing percentage string.", alias="successThreshold") - default_update_timeout: Optional[Annotated[str, Field(strict=True)]] = Field(default=None, description="The maximum duration allowed for the action to complete. The duration should be specified as a positive integer followed by a time unit. Supported time units are: - 's' for seconds - 'm' for minutes - 'h' for hours - 'd' for days ", alias="defaultUpdateTimeout") - __properties: ClassVar[List[str]] = ["disruptionAllowance", "deviceSelection", "successThreshold", "defaultUpdateTimeout"] - - @field_validator('default_update_timeout') - def default_update_timeout_validate_regular_expression(cls, value): - """Validates the regular expression""" - if value is None: - return value - - if not re.match(r"^[1-9]\d*[smhd]$", value): - raise ValueError(r"must validate the regular expression /^[1-9]\d*[smhd]$/") - return value - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of RolloutPolicy 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 disruption_allowance - if self.disruption_allowance: - _dict['disruptionAllowance'] = self.disruption_allowance.to_dict() - # override the default output from pydantic by calling `to_dict()` of device_selection - if self.device_selection: - _dict['deviceSelection'] = self.device_selection.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of RolloutPolicy from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "disruptionAllowance": DisruptionAllowance.from_dict(obj["disruptionAllowance"]) if obj.get("disruptionAllowance") is not None else None, - "deviceSelection": RolloutDeviceSelection.from_dict(obj["deviceSelection"]) if obj.get("deviceSelection") is not None else None, - "successThreshold": obj.get("successThreshold"), - "defaultUpdateTimeout": obj.get("defaultUpdateTimeout") - }) - return _obj - - diff --git a/openapi_client/models/sort_order.py b/openapi_client/models/sort_order.py deleted file mode 100644 index bece02b..0000000 --- a/openapi_client/models/sort_order.py +++ /dev/null @@ -1,37 +0,0 @@ -# coding: utf-8 - -""" - Open Device Management API - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: undefined - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import json -from enum import Enum -from typing_extensions import Self - - -class SortOrder(str, Enum): - """ - Specifies the sort order. - """ - - """ - allowed enum values - """ - ASC = 'Asc' - DESC = 'Desc' - - @classmethod - def from_json(cls, json_str: str) -> Self: - """Create an instance of SortOrder from a JSON string""" - return cls(json.loads(json_str)) - - diff --git a/openapi_client/models/ssh_config.py b/openapi_client/models/ssh_config.py deleted file mode 100644 index eeb7a1b..0000000 --- a/openapi_client/models/ssh_config.py +++ /dev/null @@ -1,91 +0,0 @@ -# coding: utf-8 - -""" - Open Device Management API - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: undefined - 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, Field, SecretStr, StrictBool -from typing import Any, ClassVar, Dict, List, Optional -from typing import Optional, Set -from typing_extensions import Self - -class SshConfig(BaseModel): - """ - SshConfig - """ # noqa: E501 - ssh_private_key: Optional[SecretStr] = Field(default=None, description="Base64 encoded private SSH key", alias="sshPrivateKey") - private_key_passphrase: Optional[SecretStr] = Field(default=None, description="The passphrase for sshPrivateKey", alias="privateKeyPassphrase") - skip_server_verification: Optional[StrictBool] = Field(default=None, description="Skip remote server verification", alias="skipServerVerification") - __properties: ClassVar[List[str]] = ["sshPrivateKey", "privateKeyPassphrase", "skipServerVerification"] - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of SshConfig 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 SshConfig from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "sshPrivateKey": obj.get("sshPrivateKey"), - "privateKeyPassphrase": obj.get("privateKeyPassphrase"), - "skipServerVerification": obj.get("skipServerVerification") - }) - return _obj - - diff --git a/openapi_client/models/ssh_repo_spec.py b/openapi_client/models/ssh_repo_spec.py deleted file mode 100644 index 9e81b71..0000000 --- a/openapi_client/models/ssh_repo_spec.py +++ /dev/null @@ -1,96 +0,0 @@ -# coding: utf-8 - -""" - Open Device Management API - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: undefined - 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, Field, StrictStr -from typing import Any, ClassVar, Dict, List -from openapi_client.models.repo_spec_type import RepoSpecType -from openapi_client.models.ssh_config import SshConfig -from typing import Optional, Set -from typing_extensions import Self - -class SshRepoSpec(BaseModel): - """ - SshRepoSpec - """ # noqa: E501 - url: StrictStr = Field(description="The SSH Git repository URL to clone from") - type: RepoSpecType - ssh_config: SshConfig = Field(alias="sshConfig") - __properties: ClassVar[List[str]] = ["url", "type", "sshConfig"] - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of SshRepoSpec 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 ssh_config - if self.ssh_config: - _dict['sshConfig'] = self.ssh_config.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of SshRepoSpec from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "url": obj.get("url"), - "type": obj.get("type"), - "sshConfig": SshConfig.from_dict(obj["sshConfig"]) if obj.get("sshConfig") is not None else None - }) - return _obj - - diff --git a/openapi_client/models/status.py b/openapi_client/models/status.py deleted file mode 100644 index f907731..0000000 --- a/openapi_client/models/status.py +++ /dev/null @@ -1,91 +0,0 @@ -# coding: utf-8 - -""" - Open Device Management API - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: undefined - 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, Field, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from typing import Optional, Set -from typing_extensions import Self - -class Status(BaseModel): - """ - Status is a return value for calls that don't return other objects. - """ # noqa: E501 - message: Optional[StrictStr] = Field(default=None, description="A human-readable description of the status of this operation.") - reason: Optional[StrictStr] = Field(default=None, description="A machine-readable description of why this operation is in the \"Failure\" status. If this value is empty there is no information available. A Reason clarifies an HTTP status code but does not override it.") - status: Optional[StrictStr] = Field(default=None, description="Status of the operation. One of: \"Success\" or \"Failure\". More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status") - __properties: ClassVar[List[str]] = ["message", "reason", "status"] - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of Status 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 Status from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "message": obj.get("message"), - "reason": obj.get("reason"), - "status": obj.get("status") - }) - return _obj - - diff --git a/openapi_client/models/template_version.py b/openapi_client/models/template_version.py deleted file mode 100644 index 536b425..0000000 --- a/openapi_client/models/template_version.py +++ /dev/null @@ -1,107 +0,0 @@ -# coding: utf-8 - -""" - Open Device Management API - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: undefined - 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, Field, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from openapi_client.models.object_meta import ObjectMeta -from openapi_client.models.template_version_spec import TemplateVersionSpec -from openapi_client.models.template_version_status import TemplateVersionStatus -from typing import Optional, Set -from typing_extensions import Self - -class TemplateVersion(BaseModel): - """ - TemplateVersion represents a version of a template. - """ # noqa: E501 - api_version: StrictStr = Field(description="APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", alias="apiVersion") - kind: StrictStr = Field(description="Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds") - metadata: ObjectMeta - spec: TemplateVersionSpec - status: Optional[TemplateVersionStatus] = None - __properties: ClassVar[List[str]] = ["apiVersion", "kind", "metadata", "spec", "status"] - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of TemplateVersion 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 metadata - if self.metadata: - _dict['metadata'] = self.metadata.to_dict() - # override the default output from pydantic by calling `to_dict()` of spec - if self.spec: - _dict['spec'] = self.spec.to_dict() - # override the default output from pydantic by calling `to_dict()` of status - if self.status: - _dict['status'] = self.status.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of TemplateVersion from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "apiVersion": obj.get("apiVersion"), - "kind": obj.get("kind"), - "metadata": ObjectMeta.from_dict(obj["metadata"]) if obj.get("metadata") is not None else None, - "spec": TemplateVersionSpec.from_dict(obj["spec"]) if obj.get("spec") is not None else None, - "status": TemplateVersionStatus.from_dict(obj["status"]) if obj.get("status") is not None else None - }) - return _obj - - diff --git a/openapi_client/models/template_version_list.py b/openapi_client/models/template_version_list.py deleted file mode 100644 index 408abf3..0000000 --- a/openapi_client/models/template_version_list.py +++ /dev/null @@ -1,105 +0,0 @@ -# coding: utf-8 - -""" - Open Device Management API - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: undefined - 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, Field, StrictStr -from typing import Any, ClassVar, Dict, List -from openapi_client.models.list_meta import ListMeta -from openapi_client.models.template_version import TemplateVersion -from typing import Optional, Set -from typing_extensions import Self - -class TemplateVersionList(BaseModel): - """ - TemplateVersionList is a list of TemplateVersions. - """ # noqa: E501 - api_version: StrictStr = Field(description="APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", alias="apiVersion") - kind: StrictStr = Field(description="Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds") - metadata: ListMeta - items: List[TemplateVersion] = Field(description="List of TemplateVersions.") - __properties: ClassVar[List[str]] = ["apiVersion", "kind", "metadata", "items"] - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of TemplateVersionList 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 metadata - if self.metadata: - _dict['metadata'] = self.metadata.to_dict() - # override the default output from pydantic by calling `to_dict()` of each item in items (list) - _items = [] - if self.items: - for _item_items in self.items: - if _item_items: - _items.append(_item_items.to_dict()) - _dict['items'] = _items - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of TemplateVersionList from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "apiVersion": obj.get("apiVersion"), - "kind": obj.get("kind"), - "metadata": ListMeta.from_dict(obj["metadata"]) if obj.get("metadata") is not None else None, - "items": [TemplateVersion.from_dict(_item) for _item in obj["items"]] if obj.get("items") is not None else None - }) - return _obj - - diff --git a/openapi_client/models/template_version_spec.py b/openapi_client/models/template_version_spec.py deleted file mode 100644 index 46a2f3b..0000000 --- a/openapi_client/models/template_version_spec.py +++ /dev/null @@ -1,87 +0,0 @@ -# coding: utf-8 - -""" - Open Device Management API - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: undefined - 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, Field, StrictStr -from typing import Any, ClassVar, Dict, List -from typing import Optional, Set -from typing_extensions import Self - -class TemplateVersionSpec(BaseModel): - """ - TemplateVersionSpec - """ # noqa: E501 - fleet: StrictStr = Field(description="The fleet whose template this refers to.") - __properties: ClassVar[List[str]] = ["fleet"] - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of TemplateVersionSpec 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 TemplateVersionSpec from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "fleet": obj.get("fleet") - }) - return _obj - - diff --git a/openapi_client/models/template_version_status.py b/openapi_client/models/template_version_status.py deleted file mode 100644 index 58bf02a..0000000 --- a/openapi_client/models/template_version_status.py +++ /dev/null @@ -1,146 +0,0 @@ -# coding: utf-8 - -""" - Open Device Management API - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: undefined - 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, Field -from typing import Any, ClassVar, Dict, List, Optional -from openapi_client.models.application_spec import ApplicationSpec -from openapi_client.models.condition import Condition -from openapi_client.models.config_provider_spec import ConfigProviderSpec -from openapi_client.models.device_hooks_spec import DeviceHooksSpec -from openapi_client.models.device_os_spec import DeviceOSSpec -from openapi_client.models.device_spec_systemd import DeviceSpecSystemd -from openapi_client.models.resource_monitor import ResourceMonitor -from typing import Optional, Set -from typing_extensions import Self - -class TemplateVersionStatus(BaseModel): - """ - TemplateVersionStatus - """ # noqa: E501 - os: Optional[DeviceOSSpec] = None - config: Optional[List[ConfigProviderSpec]] = Field(default=None, description="List of config providers.") - hooks: Optional[DeviceHooksSpec] = None - applications: Optional[List[ApplicationSpec]] = Field(default=None, description="List of applications.") - systemd: Optional[DeviceSpecSystemd] = None - resources: Optional[List[ResourceMonitor]] = Field(default=None, description="Array of resource monitor configurations.") - updated_at: Optional[datetime] = Field(default=None, alias="updatedAt") - conditions: Optional[List[Condition]] = Field(default=None, description="Current state of the device.") - __properties: ClassVar[List[str]] = ["os", "config", "hooks", "applications", "systemd", "resources", "updatedAt", "conditions"] - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of TemplateVersionStatus 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 os - if self.os: - _dict['os'] = self.os.to_dict() - # override the default output from pydantic by calling `to_dict()` of each item in config (list) - _items = [] - if self.config: - for _item_config in self.config: - if _item_config: - _items.append(_item_config.to_dict()) - _dict['config'] = _items - # override the default output from pydantic by calling `to_dict()` of hooks - if self.hooks: - _dict['hooks'] = self.hooks.to_dict() - # override the default output from pydantic by calling `to_dict()` of each item in applications (list) - _items = [] - if self.applications: - for _item_applications in self.applications: - if _item_applications: - _items.append(_item_applications.to_dict()) - _dict['applications'] = _items - # override the default output from pydantic by calling `to_dict()` of systemd - if self.systemd: - _dict['systemd'] = self.systemd.to_dict() - # override the default output from pydantic by calling `to_dict()` of each item in resources (list) - _items = [] - if self.resources: - for _item_resources in self.resources: - if _item_resources: - _items.append(_item_resources.to_dict()) - _dict['resources'] = _items - # override the default output from pydantic by calling `to_dict()` of each item in conditions (list) - _items = [] - if self.conditions: - for _item_conditions in self.conditions: - if _item_conditions: - _items.append(_item_conditions.to_dict()) - _dict['conditions'] = _items - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of TemplateVersionStatus from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "os": DeviceOSSpec.from_dict(obj["os"]) if obj.get("os") is not None else None, - "config": [ConfigProviderSpec.from_dict(_item) for _item in obj["config"]] if obj.get("config") is not None else None, - "hooks": DeviceHooksSpec.from_dict(obj["hooks"]) if obj.get("hooks") is not None else None, - "applications": [ApplicationSpec.from_dict(_item) for _item in obj["applications"]] if obj.get("applications") is not None else None, - "systemd": DeviceSpecSystemd.from_dict(obj["systemd"]) if obj.get("systemd") is not None else None, - "resources": [ResourceMonitor.from_dict(_item) for _item in obj["resources"]] if obj.get("resources") is not None else None, - "updatedAt": obj.get("updatedAt"), - "conditions": [Condition.from_dict(_item) for _item in obj["conditions"]] if obj.get("conditions") is not None else None - }) - return _obj - - diff --git a/openapi_client/py.typed b/openapi_client/py.typed deleted file mode 100644 index e69de29..0000000 diff --git a/openapi_client/rest.py b/openapi_client/rest.py deleted file mode 100644 index 6903d1d..0000000 --- a/openapi_client/rest.py +++ /dev/null @@ -1,257 +0,0 @@ -# coding: utf-8 - -""" - Open Device Management API - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: undefined - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import io -import json -import re -import ssl - -import urllib3 - -from openapi_client.exceptions import ApiException, ApiValueError - -SUPPORTED_SOCKS_PROXIES = {"socks5", "socks5h", "socks4", "socks4a"} -RESTResponseType = urllib3.HTTPResponse - - -def is_socks_proxy_url(url): - if url is None: - return False - split_section = url.split("://") - if len(split_section) < 2: - return False - else: - return split_section[0].lower() in SUPPORTED_SOCKS_PROXIES - - -class RESTResponse(io.IOBase): - - def __init__(self, resp) -> None: - self.response = resp - self.status = resp.status - self.reason = resp.reason - self.data = None - - def read(self): - if self.data is None: - self.data = self.response.data - return self.data - - def getheaders(self): - """Returns a dictionary of the response headers.""" - return self.response.headers - - def getheader(self, name, default=None): - """Returns a given response header.""" - return self.response.headers.get(name, default) - - -class RESTClientObject: - - def __init__(self, configuration) -> None: - # urllib3.PoolManager will pass all kw parameters to connectionpool - # https://github.com/shazow/urllib3/blob/f9409436f83aeb79fbaf090181cd81b784f1b8ce/urllib3/poolmanager.py#L75 # noqa: E501 - # https://github.com/shazow/urllib3/blob/f9409436f83aeb79fbaf090181cd81b784f1b8ce/urllib3/connectionpool.py#L680 # noqa: E501 - # Custom SSL certificates and client certificates: http://urllib3.readthedocs.io/en/latest/advanced-usage.html # noqa: E501 - - # cert_reqs - if configuration.verify_ssl: - cert_reqs = ssl.CERT_REQUIRED - else: - cert_reqs = ssl.CERT_NONE - - pool_args = { - "cert_reqs": cert_reqs, - "ca_certs": configuration.ssl_ca_cert, - "cert_file": configuration.cert_file, - "key_file": configuration.key_file, - } - if configuration.assert_hostname is not None: - pool_args['assert_hostname'] = ( - configuration.assert_hostname - ) - - if configuration.retries is not None: - pool_args['retries'] = configuration.retries - - if 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 - - if configuration.connection_pool_maxsize is not None: - pool_args['maxsize'] = configuration.connection_pool_maxsize - - # https pool manager - self.pool_manager: urllib3.PoolManager - - 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) - else: - pool_args["proxy_url"] = configuration.proxy - pool_args["proxy_headers"] = configuration.proxy_headers - self.pool_manager = urllib3.ProxyManager(**pool_args) - else: - self.pool_manager = urllib3.PoolManager(**pool_args) - - def request( - self, - method, - url, - headers=None, - body=None, - post_params=None, - _request_timeout=None - ): - """Perform requests. - - :param method: http request method - :param url: http request url - :param headers: http request headers - :param body: request json body, for `application/json` - :param post_params: request post parameters, - `application/x-www-form-urlencoded` - and `multipart/form-data` - :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. - """ - method = method.upper() - assert method in [ - 'GET', - 'HEAD', - 'DELETE', - 'POST', - 'PUT', - 'PATCH', - 'OPTIONS' - ] - - if post_params and body: - raise ApiValueError( - "body parameter cannot be used with post_params parameter." - ) - - post_params = post_params or {} - headers = headers or {} - - timeout = None - 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 - ): - timeout = urllib3.Timeout( - connect=_request_timeout[0], - read=_request_timeout[1] - ) - - try: - # For `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) - ): - request_body = None - if body is not None: - request_body = json.dumps(body) - r = self.pool_manager.request( - method, - url, - body=request_body, - timeout=timeout, - headers=headers, - preload_content=False - ) - elif content_type == 'application/x-www-form-urlencoded': - r = self.pool_manager.request( - method, - url, - fields=post_params, - encode_multipart=False, - timeout=timeout, - headers=headers, - preload_content=False - ) - 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'] - # 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] - r = self.pool_manager.request( - method, - url, - fields=post_params, - encode_multipart=True, - timeout=timeout, - headers=headers, - preload_content=False - ) - # Pass a `string` parameter directly in the body to support - # other content types than JSON when `body` argument is - # provided in serialized form. - elif isinstance(body, str) or isinstance(body, bytes): - r = self.pool_manager.request( - method, - url, - body=body, - timeout=timeout, - headers=headers, - preload_content=False - ) - elif headers['Content-Type'].startswith('text/') and isinstance(body, bool): - request_body = "true" if body else "false" - r = self.pool_manager.request( - method, - url, - body=request_body, - preload_content=False, - timeout=timeout, - headers=headers) - else: - # Cannot generate the request from given parameters - msg = """Cannot prepare a request message for provided - arguments. Please check that your arguments match - declared content type.""" - raise ApiException(status=0, reason=msg) - # For `GET`, `HEAD` - else: - r = self.pool_manager.request( - method, - url, - fields={}, - timeout=timeout, - headers=headers, - preload_content=False - ) - except urllib3.exceptions.SSLError as e: - msg = "\n".join([type(e).__name__, str(e)]) - raise ApiException(status=0, reason=msg) - - return RESTResponse(r) diff --git a/test/test_application_env_vars.py b/test/test_application_env_vars.py index 186d038..65f9a60 100644 --- a/test/test_application_env_vars.py +++ b/test/test_application_env_vars.py @@ -14,7 +14,7 @@ import unittest -from openapi_client.models.application_env_vars import ApplicationEnvVars +from flightctl.models.application_env_vars import ApplicationEnvVars class TestApplicationEnvVars(unittest.TestCase): """ApplicationEnvVars unit test stubs""" diff --git a/test/test_application_spec.py b/test/test_application_spec.py index 8c62718..377b941 100644 --- a/test/test_application_spec.py +++ b/test/test_application_spec.py @@ -14,7 +14,7 @@ import unittest -from openapi_client.models.application_spec import ApplicationSpec +from flightctl.models.application_spec import ApplicationSpec class TestApplicationSpec(unittest.TestCase): """ApplicationSpec unit test stubs""" diff --git a/test/test_application_status_type.py b/test/test_application_status_type.py index d5ac410..c3ce0b5 100644 --- a/test/test_application_status_type.py +++ b/test/test_application_status_type.py @@ -14,7 +14,7 @@ import unittest -from openapi_client.models.application_status_type import ApplicationStatusType +from flightctl.models.application_status_type import ApplicationStatusType class TestApplicationStatusType(unittest.TestCase): """ApplicationStatusType unit test stubs""" diff --git a/test/test_applications_summary_status_type.py b/test/test_applications_summary_status_type.py index 4009b3d..fd98b98 100644 --- a/test/test_applications_summary_status_type.py +++ b/test/test_applications_summary_status_type.py @@ -14,7 +14,7 @@ import unittest -from openapi_client.models.applications_summary_status_type import ApplicationsSummaryStatusType +from flightctl.models.applications_summary_status_type import ApplicationsSummaryStatusType class TestApplicationsSummaryStatusType(unittest.TestCase): """ApplicationsSummaryStatusType unit test stubs""" diff --git a/test/test_auth_config.py b/test/test_auth_config.py index 3de520d..2ac3183 100644 --- a/test/test_auth_config.py +++ b/test/test_auth_config.py @@ -14,7 +14,7 @@ import unittest -from openapi_client.models.auth_config import AuthConfig +from flightctl.models.auth_config import AuthConfig class TestAuthConfig(unittest.TestCase): """AuthConfig unit test stubs""" diff --git a/test/test_batch.py b/test/test_batch.py index ecd16f2..139cf53 100644 --- a/test/test_batch.py +++ b/test/test_batch.py @@ -14,7 +14,7 @@ import unittest -from openapi_client.models.batch import Batch +from flightctl.models.batch import Batch class TestBatch(unittest.TestCase): """Batch unit test stubs""" @@ -35,12 +35,12 @@ def make_instance(self, include_optional) -> Batch: model = Batch() if include_optional: return Batch( - selector = openapi_client.models.label_selector.LabelSelector( + selector = flightctl.models.label_selector.LabelSelector( match_labels = { 'key' : '' }, match_expressions = [ - openapi_client.models.match_expression.MatchExpression( + flightctl.models.match_expression.MatchExpression( key = '', operator = 'In', values = [ diff --git a/test/test_batch_limit.py b/test/test_batch_limit.py index ed69b24..0f18823 100644 --- a/test/test_batch_limit.py +++ b/test/test_batch_limit.py @@ -14,7 +14,7 @@ import unittest -from openapi_client.models.batch_limit import BatchLimit +from flightctl.models.batch_limit import BatchLimit class TestBatchLimit(unittest.TestCase): """BatchLimit unit test stubs""" diff --git a/test/test_batch_sequence.py b/test/test_batch_sequence.py index b8a2c5b..5d3666e 100644 --- a/test/test_batch_sequence.py +++ b/test/test_batch_sequence.py @@ -14,7 +14,7 @@ import unittest -from openapi_client.models.batch_sequence import BatchSequence +from flightctl.models.batch_sequence import BatchSequence class TestBatchSequence(unittest.TestCase): """BatchSequence unit test stubs""" @@ -36,13 +36,13 @@ def make_instance(self, include_optional) -> BatchSequence: if include_optional: return BatchSequence( sequence = [ - openapi_client.models.batch.Batch( - selector = openapi_client.models.label_selector.LabelSelector( + flightctl.models.batch.Batch( + selector = flightctl.models.label_selector.LabelSelector( match_labels = { 'key' : '' }, match_expressions = [ - openapi_client.models.match_expression.MatchExpression( + flightctl.models.match_expression.MatchExpression( key = '', operator = 'In', values = [ diff --git a/test/test_certificate_signing_request.py b/test/test_certificate_signing_request.py index 240f72d..029c77a 100644 --- a/test/test_certificate_signing_request.py +++ b/test/test_certificate_signing_request.py @@ -14,7 +14,7 @@ import unittest -from openapi_client.models.certificate_signing_request import CertificateSigningRequest +from flightctl.models.certificate_signing_request import CertificateSigningRequest class TestCertificateSigningRequest(unittest.TestCase): """CertificateSigningRequest unit test stubs""" @@ -37,7 +37,7 @@ def make_instance(self, include_optional) -> CertificateSigningRequest: return CertificateSigningRequest( api_version = '', kind = '', - metadata = openapi_client.models.object_meta.ObjectMeta( + metadata = flightctl.models.object_meta.ObjectMeta( creation_timestamp = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), deletion_timestamp = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), name = '', @@ -50,7 +50,7 @@ def make_instance(self, include_optional) -> CertificateSigningRequest: 'key' : '' }, resource_version = '', ), - spec = openapi_client.models.certificate_signing_request_spec.CertificateSigningRequestSpec( + spec = flightctl.models.certificate_signing_request_spec.CertificateSigningRequestSpec( expiration_seconds = 56, extra = { 'key' : [ @@ -64,7 +64,7 @@ def make_instance(self, include_optional) -> CertificateSigningRequest: '' ], username = '', ), - status = openapi_client.models.certificate_signing_request_status.CertificateSigningRequestStatus( + status = flightctl.models.certificate_signing_request_status.CertificateSigningRequestStatus( certificate = 'YQ==', conditions = [ null @@ -74,7 +74,7 @@ def make_instance(self, include_optional) -> CertificateSigningRequest: return CertificateSigningRequest( api_version = '', kind = '', - metadata = openapi_client.models.object_meta.ObjectMeta( + metadata = flightctl.models.object_meta.ObjectMeta( creation_timestamp = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), deletion_timestamp = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), name = '', @@ -87,7 +87,7 @@ def make_instance(self, include_optional) -> CertificateSigningRequest: 'key' : '' }, resource_version = '', ), - spec = openapi_client.models.certificate_signing_request_spec.CertificateSigningRequestSpec( + spec = flightctl.models.certificate_signing_request_spec.CertificateSigningRequestSpec( expiration_seconds = 56, extra = { 'key' : [ diff --git a/test/test_certificate_signing_request_list.py b/test/test_certificate_signing_request_list.py index 70cec51..0668d9b 100644 --- a/test/test_certificate_signing_request_list.py +++ b/test/test_certificate_signing_request_list.py @@ -14,7 +14,7 @@ import unittest -from openapi_client.models.certificate_signing_request_list import CertificateSigningRequestList +from flightctl.models.certificate_signing_request_list import CertificateSigningRequestList class TestCertificateSigningRequestList(unittest.TestCase): """CertificateSigningRequestList unit test stubs""" @@ -37,14 +37,14 @@ def make_instance(self, include_optional) -> CertificateSigningRequestList: return CertificateSigningRequestList( api_version = '', kind = '', - metadata = openapi_client.models.list_meta.ListMeta( + metadata = flightctl.models.list_meta.ListMeta( continue = '', remaining_item_count = 56, ), items = [ - openapi_client.models.certificate_signing_request.CertificateSigningRequest( + flightctl.models.certificate_signing_request.CertificateSigningRequest( api_version = '', kind = '', - metadata = openapi_client.models.object_meta.ObjectMeta( + metadata = flightctl.models.object_meta.ObjectMeta( creation_timestamp = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), deletion_timestamp = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), name = '', @@ -57,7 +57,7 @@ def make_instance(self, include_optional) -> CertificateSigningRequestList: 'key' : '' }, resource_version = '', ), - spec = openapi_client.models.certificate_signing_request_spec.CertificateSigningRequestSpec( + spec = flightctl.models.certificate_signing_request_spec.CertificateSigningRequestSpec( expiration_seconds = 56, extra = { 'key' : [ @@ -71,7 +71,7 @@ def make_instance(self, include_optional) -> CertificateSigningRequestList: '' ], username = '', ), - status = openapi_client.models.certificate_signing_request_status.CertificateSigningRequestStatus( + status = flightctl.models.certificate_signing_request_status.CertificateSigningRequestStatus( certificate = 'YQ==', conditions = [ null @@ -82,14 +82,14 @@ def make_instance(self, include_optional) -> CertificateSigningRequestList: return CertificateSigningRequestList( api_version = '', kind = '', - metadata = openapi_client.models.list_meta.ListMeta( + metadata = flightctl.models.list_meta.ListMeta( continue = '', remaining_item_count = 56, ), items = [ - openapi_client.models.certificate_signing_request.CertificateSigningRequest( + flightctl.models.certificate_signing_request.CertificateSigningRequest( api_version = '', kind = '', - metadata = openapi_client.models.object_meta.ObjectMeta( + metadata = flightctl.models.object_meta.ObjectMeta( creation_timestamp = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), deletion_timestamp = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), name = '', @@ -102,7 +102,7 @@ def make_instance(self, include_optional) -> CertificateSigningRequestList: 'key' : '' }, resource_version = '', ), - spec = openapi_client.models.certificate_signing_request_spec.CertificateSigningRequestSpec( + spec = flightctl.models.certificate_signing_request_spec.CertificateSigningRequestSpec( expiration_seconds = 56, extra = { 'key' : [ @@ -116,7 +116,7 @@ def make_instance(self, include_optional) -> CertificateSigningRequestList: '' ], username = '', ), - status = openapi_client.models.certificate_signing_request_status.CertificateSigningRequestStatus( + status = flightctl.models.certificate_signing_request_status.CertificateSigningRequestStatus( certificate = 'YQ==', conditions = [ null diff --git a/test/test_certificate_signing_request_spec.py b/test/test_certificate_signing_request_spec.py index 652bcef..c316f16 100644 --- a/test/test_certificate_signing_request_spec.py +++ b/test/test_certificate_signing_request_spec.py @@ -14,7 +14,7 @@ import unittest -from openapi_client.models.certificate_signing_request_spec import CertificateSigningRequestSpec +from flightctl.models.certificate_signing_request_spec import CertificateSigningRequestSpec class TestCertificateSigningRequestSpec(unittest.TestCase): """CertificateSigningRequestSpec unit test stubs""" diff --git a/test/test_certificate_signing_request_status.py b/test/test_certificate_signing_request_status.py index d9179d8..2d83989 100644 --- a/test/test_certificate_signing_request_status.py +++ b/test/test_certificate_signing_request_status.py @@ -14,7 +14,7 @@ import unittest -from openapi_client.models.certificate_signing_request_status import CertificateSigningRequestStatus +from flightctl.models.certificate_signing_request_status import CertificateSigningRequestStatus class TestCertificateSigningRequestStatus(unittest.TestCase): """CertificateSigningRequestStatus unit test stubs""" diff --git a/test/test_certificatesigningrequest_api.py b/test/test_certificatesigningrequest_api.py index ee4125c..39f796c 100644 --- a/test/test_certificatesigningrequest_api.py +++ b/test/test_certificatesigningrequest_api.py @@ -14,7 +14,7 @@ import unittest -from openapi_client.api.certificatesigningrequest_api import CertificatesigningrequestApi +from flightctl.api.certificatesigningrequest_api import CertificatesigningrequestApi class TestCertificatesigningrequestApi(unittest.TestCase): diff --git a/test/test_condition.py b/test/test_condition.py index 71deb9d..cb0277e 100644 --- a/test/test_condition.py +++ b/test/test_condition.py @@ -14,7 +14,7 @@ import unittest -from openapi_client.models.condition import Condition +from flightctl.models.condition import Condition class TestCondition(unittest.TestCase): """Condition unit test stubs""" diff --git a/test/test_condition_status.py b/test/test_condition_status.py index 4050a42..f6195db 100644 --- a/test/test_condition_status.py +++ b/test/test_condition_status.py @@ -14,7 +14,7 @@ import unittest -from openapi_client.models.condition_status import ConditionStatus +from flightctl.models.condition_status import ConditionStatus class TestConditionStatus(unittest.TestCase): """ConditionStatus unit test stubs""" diff --git a/test/test_condition_type.py b/test/test_condition_type.py index 9265e7e..03eb16c 100644 --- a/test/test_condition_type.py +++ b/test/test_condition_type.py @@ -14,7 +14,7 @@ import unittest -from openapi_client.models.condition_type import ConditionType +from flightctl.models.condition_type import ConditionType class TestConditionType(unittest.TestCase): """ConditionType unit test stubs""" diff --git a/test/test_config_provider_spec.py b/test/test_config_provider_spec.py index 0d45eb8..ea97efd 100644 --- a/test/test_config_provider_spec.py +++ b/test/test_config_provider_spec.py @@ -14,7 +14,7 @@ import unittest -from openapi_client.models.config_provider_spec import ConfigProviderSpec +from flightctl.models.config_provider_spec import ConfigProviderSpec class TestConfigProviderSpec(unittest.TestCase): """ConfigProviderSpec unit test stubs""" @@ -36,17 +36,17 @@ def make_instance(self, include_optional) -> ConfigProviderSpec: if include_optional: return ConfigProviderSpec( name = '', - git_ref = openapi_client.models.git_config_provider_spec_git_ref.GitConfigProviderSpec_gitRef( + git_ref = flightctl.models.git_config_provider_spec_git_ref.GitConfigProviderSpec_gitRef( repository = '', target_revision = '', path = '', mount_path = '/', ), - secret_ref = openapi_client.models.kubernetes_secret_provider_spec_secret_ref.KubernetesSecretProviderSpec_secretRef( + secret_ref = flightctl.models.kubernetes_secret_provider_spec_secret_ref.KubernetesSecretProviderSpec_secretRef( name = '', namespace = '', mount_path = '', ), inline = [ - openapi_client.models.file_spec.FileSpec( + flightctl.models.file_spec.FileSpec( path = '', content = '', content_encoding = 'plain', @@ -54,7 +54,7 @@ def make_instance(self, include_optional) -> ConfigProviderSpec: user = '', group = '', ) ], - http_ref = openapi_client.models.http_config_provider_spec_http_ref.HttpConfigProviderSpec_httpRef( + http_ref = flightctl.models.http_config_provider_spec_http_ref.HttpConfigProviderSpec_httpRef( repository = '', suffix = '', file_path = '', ) @@ -62,17 +62,17 @@ def make_instance(self, include_optional) -> ConfigProviderSpec: else: return ConfigProviderSpec( name = '', - git_ref = openapi_client.models.git_config_provider_spec_git_ref.GitConfigProviderSpec_gitRef( + git_ref = flightctl.models.git_config_provider_spec_git_ref.GitConfigProviderSpec_gitRef( repository = '', target_revision = '', path = '', mount_path = '/', ), - secret_ref = openapi_client.models.kubernetes_secret_provider_spec_secret_ref.KubernetesSecretProviderSpec_secretRef( + secret_ref = flightctl.models.kubernetes_secret_provider_spec_secret_ref.KubernetesSecretProviderSpec_secretRef( name = '', namespace = '', mount_path = '', ), inline = [ - openapi_client.models.file_spec.FileSpec( + flightctl.models.file_spec.FileSpec( path = '', content = '', content_encoding = 'plain', @@ -80,7 +80,7 @@ def make_instance(self, include_optional) -> ConfigProviderSpec: user = '', group = '', ) ], - http_ref = openapi_client.models.http_config_provider_spec_http_ref.HttpConfigProviderSpec_httpRef( + http_ref = flightctl.models.http_config_provider_spec_http_ref.HttpConfigProviderSpec_httpRef( repository = '', suffix = '', file_path = '', ), diff --git a/test/test_cpu_resource_monitor_spec.py b/test/test_cpu_resource_monitor_spec.py index 481f11d..a23bf29 100644 --- a/test/test_cpu_resource_monitor_spec.py +++ b/test/test_cpu_resource_monitor_spec.py @@ -14,7 +14,7 @@ import unittest -from openapi_client.models.cpu_resource_monitor_spec import CPUResourceMonitorSpec +from flightctl.models.cpu_resource_monitor_spec import CPUResourceMonitorSpec class TestCPUResourceMonitorSpec(unittest.TestCase): """CPUResourceMonitorSpec unit test stubs""" @@ -37,7 +37,7 @@ def make_instance(self, include_optional) -> CPUResourceMonitorSpec: return CPUResourceMonitorSpec( monitor_type = '', alert_rules = [ - openapi_client.models.resource_alert_rule.ResourceAlertRule( + flightctl.models.resource_alert_rule.ResourceAlertRule( severity = 'Warning', duration = '4s', percentage = 1.337, @@ -49,7 +49,7 @@ def make_instance(self, include_optional) -> CPUResourceMonitorSpec: return CPUResourceMonitorSpec( monitor_type = '', alert_rules = [ - openapi_client.models.resource_alert_rule.ResourceAlertRule( + flightctl.models.resource_alert_rule.ResourceAlertRule( severity = 'Warning', duration = '4s', percentage = 1.337, diff --git a/test/test_custom_resource_monitor_spec.py b/test/test_custom_resource_monitor_spec.py index ee710c7..7a51d5c 100644 --- a/test/test_custom_resource_monitor_spec.py +++ b/test/test_custom_resource_monitor_spec.py @@ -14,7 +14,7 @@ import unittest -from openapi_client.models.custom_resource_monitor_spec import CustomResourceMonitorSpec +from flightctl.models.custom_resource_monitor_spec import CustomResourceMonitorSpec class TestCustomResourceMonitorSpec(unittest.TestCase): """CustomResourceMonitorSpec unit test stubs""" @@ -37,7 +37,7 @@ def make_instance(self, include_optional) -> CustomResourceMonitorSpec: return CustomResourceMonitorSpec( monitor_type = '', alert_rules = [ - openapi_client.models.resource_alert_rule.ResourceAlertRule( + flightctl.models.resource_alert_rule.ResourceAlertRule( severity = 'Warning', duration = '4s', percentage = 1.337, @@ -49,7 +49,7 @@ def make_instance(self, include_optional) -> CustomResourceMonitorSpec: return CustomResourceMonitorSpec( monitor_type = '', alert_rules = [ - openapi_client.models.resource_alert_rule.ResourceAlertRule( + flightctl.models.resource_alert_rule.ResourceAlertRule( severity = 'Warning', duration = '4s', percentage = 1.337, diff --git a/test/test_default_api.py b/test/test_default_api.py index c8f0da7..35b0ed4 100644 --- a/test/test_default_api.py +++ b/test/test_default_api.py @@ -14,7 +14,7 @@ import unittest -from openapi_client.api.default_api import DefaultApi +from flightctl.api.default_api import DefaultApi class TestDefaultApi(unittest.TestCase): diff --git a/test/test_device.py b/test/test_device.py index 9094c65..61000bd 100644 --- a/test/test_device.py +++ b/test/test_device.py @@ -14,7 +14,7 @@ import unittest -from openapi_client.models.device import Device +from flightctl.models.device import Device class TestDevice(unittest.TestCase): """Device unit test stubs""" @@ -37,7 +37,7 @@ def make_instance(self, include_optional) -> Device: return Device( api_version = '', kind = '', - metadata = openapi_client.models.object_meta.ObjectMeta( + metadata = flightctl.models.object_meta.ObjectMeta( creation_timestamp = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), deletion_timestamp = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), name = '', @@ -50,19 +50,19 @@ def make_instance(self, include_optional) -> Device: 'key' : '' }, resource_version = '', ), - spec = openapi_client.models.device_spec.DeviceSpec( - os = openapi_client.models.device_os_spec.DeviceOSSpec( + spec = flightctl.models.device_spec.DeviceSpec( + os = flightctl.models.device_os_spec.DeviceOSSpec( image = '', ), config = [ null ], - hooks = openapi_client.models.device_hooks_spec.DeviceHooksSpec( + hooks = flightctl.models.device_hooks_spec.DeviceHooksSpec( before_updating = [ - openapi_client.models.device_update_hook_spec.DeviceUpdateHookSpec( + flightctl.models.device_update_hook_spec.DeviceUpdateHookSpec( name = '', description = '', actions = [ - openapi_client.models.hook_action.HookAction() + flightctl.models.hook_action.HookAction() ], on_file = [ 'Create' @@ -70,43 +70,43 @@ def make_instance(self, include_optional) -> Device: path = '', ) ], after_updating = [ - openapi_client.models.device_update_hook_spec.DeviceUpdateHookSpec( + flightctl.models.device_update_hook_spec.DeviceUpdateHookSpec( name = '', description = '', actions = [ - openapi_client.models.hook_action.HookAction() + flightctl.models.hook_action.HookAction() ], path = '', ) ], before_rebooting = [ - openapi_client.models.device_reboot_hook_spec.DeviceRebootHookSpec( + flightctl.models.device_reboot_hook_spec.DeviceRebootHookSpec( name = '', description = '', actions = [ - openapi_client.models.hook_action.HookAction() + flightctl.models.hook_action.HookAction() ], ) ], after_rebooting = [ - openapi_client.models.device_reboot_hook_spec.DeviceRebootHookSpec( + flightctl.models.device_reboot_hook_spec.DeviceRebootHookSpec( name = '', description = '', actions = [ - openapi_client.models.hook_action.HookAction() + flightctl.models.hook_action.HookAction() ], ) ], ), applications = [ - openapi_client.models.application_spec.ApplicationSpec() + flightctl.models.application_spec.ApplicationSpec() ], - systemd = openapi_client.models.device_spec_systemd.DeviceSpec_systemd( + systemd = flightctl.models.device_spec_systemd.DeviceSpec_systemd( match_patterns = [ 'ge34w9Wa*CLfoo\\yJX2gCb' ], ), resources = [ null ], ), - status = openapi_client.models.device_status.DeviceStatus( + status = flightctl.models.device_status.DeviceStatus( conditions = [ - openapi_client.models.condition.Condition( + flightctl.models.condition.Condition( type = 'Approved', status = 'True', observed_generation = 56, @@ -114,37 +114,37 @@ def make_instance(self, include_optional) -> Device: message = '', reason = '', ) ], - system_info = openapi_client.models.device_system_info.DeviceSystemInfo( + system_info = flightctl.models.device_system_info.DeviceSystemInfo( architecture = '', boot_id = '', operating_system = '', ), applications = [ - openapi_client.models.device_application_status.DeviceApplicationStatus( + flightctl.models.device_application_status.DeviceApplicationStatus( name = '', ready = '', restarts = 56, status = 'Preparing', ) ], - applications_summary = openapi_client.models.device_applications_summary_status.DeviceApplicationsSummaryStatus( + applications_summary = flightctl.models.device_applications_summary_status.DeviceApplicationsSummaryStatus( status = 'Healthy', info = '', ), - resources = openapi_client.models.device_resource_status.DeviceResourceStatus( + resources = flightctl.models.device_resource_status.DeviceResourceStatus( cpu = 'Healthy', memory = 'Healthy', disk = 'Healthy', ), - integrity = openapi_client.models.device_integrity_status.DeviceIntegrityStatus( - summary = openapi_client.models.device_integrity_status_summary.DeviceIntegrityStatusSummary( + integrity = flightctl.models.device_integrity_status.DeviceIntegrityStatus( + summary = flightctl.models.device_integrity_status_summary.DeviceIntegrityStatusSummary( status = 'Passed', info = '', ), ), - config = openapi_client.models.device_config_status.DeviceConfigStatus( + config = flightctl.models.device_config_status.DeviceConfigStatus( rendered_version = '', ), - os = openapi_client.models.device_os_status.DeviceOSStatus( + os = flightctl.models.device_os_status.DeviceOSStatus( image = '', image_digest = '', ), - updated = openapi_client.models.device_updated_status.DeviceUpdatedStatus( + updated = flightctl.models.device_updated_status.DeviceUpdatedStatus( status = 'UpToDate', info = '', ), - summary = openapi_client.models.device_summary_status.DeviceSummaryStatus( + summary = flightctl.models.device_summary_status.DeviceSummaryStatus( status = 'Online', info = '', ), last_seen = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), ) @@ -153,7 +153,7 @@ def make_instance(self, include_optional) -> Device: return Device( api_version = '', kind = '', - metadata = openapi_client.models.object_meta.ObjectMeta( + metadata = flightctl.models.object_meta.ObjectMeta( creation_timestamp = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), deletion_timestamp = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), name = '', diff --git a/test/test_device_api.py b/test/test_device_api.py index 04009a8..4840b57 100644 --- a/test/test_device_api.py +++ b/test/test_device_api.py @@ -14,7 +14,7 @@ import unittest -from openapi_client.api.device_api import DeviceApi +from flightctl.api.device_api import DeviceApi class TestDeviceApi(unittest.TestCase): diff --git a/test/test_device_application_status.py b/test/test_device_application_status.py index 4931500..3f6a02b 100644 --- a/test/test_device_application_status.py +++ b/test/test_device_application_status.py @@ -14,7 +14,7 @@ import unittest -from openapi_client.models.device_application_status import DeviceApplicationStatus +from flightctl.models.device_application_status import DeviceApplicationStatus class TestDeviceApplicationStatus(unittest.TestCase): """DeviceApplicationStatus unit test stubs""" diff --git a/test/test_device_applications_summary_status.py b/test/test_device_applications_summary_status.py index c6f2398..bc61c14 100644 --- a/test/test_device_applications_summary_status.py +++ b/test/test_device_applications_summary_status.py @@ -14,7 +14,7 @@ import unittest -from openapi_client.models.device_applications_summary_status import DeviceApplicationsSummaryStatus +from flightctl.models.device_applications_summary_status import DeviceApplicationsSummaryStatus class TestDeviceApplicationsSummaryStatus(unittest.TestCase): """DeviceApplicationsSummaryStatus unit test stubs""" diff --git a/test/test_device_config_status.py b/test/test_device_config_status.py index 912359c..343b666 100644 --- a/test/test_device_config_status.py +++ b/test/test_device_config_status.py @@ -14,7 +14,7 @@ import unittest -from openapi_client.models.device_config_status import DeviceConfigStatus +from flightctl.models.device_config_status import DeviceConfigStatus class TestDeviceConfigStatus(unittest.TestCase): """DeviceConfigStatus unit test stubs""" diff --git a/test/test_device_console.py b/test/test_device_console.py index 2c52a5f..73c1838 100644 --- a/test/test_device_console.py +++ b/test/test_device_console.py @@ -14,7 +14,7 @@ import unittest -from openapi_client.models.device_console import DeviceConsole +from flightctl.models.device_console import DeviceConsole class TestDeviceConsole(unittest.TestCase): """DeviceConsole unit test stubs""" diff --git a/test/test_device_hooks_spec.py b/test/test_device_hooks_spec.py index 10d66a3..fcc667a 100644 --- a/test/test_device_hooks_spec.py +++ b/test/test_device_hooks_spec.py @@ -14,7 +14,7 @@ import unittest -from openapi_client.models.device_hooks_spec import DeviceHooksSpec +from flightctl.models.device_hooks_spec import DeviceHooksSpec class TestDeviceHooksSpec(unittest.TestCase): """DeviceHooksSpec unit test stubs""" @@ -36,11 +36,11 @@ def make_instance(self, include_optional) -> DeviceHooksSpec: if include_optional: return DeviceHooksSpec( before_updating = [ - openapi_client.models.device_update_hook_spec.DeviceUpdateHookSpec( + flightctl.models.device_update_hook_spec.DeviceUpdateHookSpec( name = '', description = '', actions = [ - openapi_client.models.hook_action.HookAction() + flightctl.models.hook_action.HookAction() ], on_file = [ 'Create' @@ -48,11 +48,11 @@ def make_instance(self, include_optional) -> DeviceHooksSpec: path = '', ) ], after_updating = [ - openapi_client.models.device_update_hook_spec.DeviceUpdateHookSpec( + flightctl.models.device_update_hook_spec.DeviceUpdateHookSpec( name = '', description = '', actions = [ - openapi_client.models.hook_action.HookAction() + flightctl.models.hook_action.HookAction() ], on_file = [ 'Create' @@ -60,19 +60,19 @@ def make_instance(self, include_optional) -> DeviceHooksSpec: path = '', ) ], before_rebooting = [ - openapi_client.models.device_reboot_hook_spec.DeviceRebootHookSpec( + flightctl.models.device_reboot_hook_spec.DeviceRebootHookSpec( name = '', description = '', actions = [ - openapi_client.models.hook_action.HookAction() + flightctl.models.hook_action.HookAction() ], ) ], after_rebooting = [ - openapi_client.models.device_reboot_hook_spec.DeviceRebootHookSpec( + flightctl.models.device_reboot_hook_spec.DeviceRebootHookSpec( name = '', description = '', actions = [ - openapi_client.models.hook_action.HookAction() + flightctl.models.hook_action.HookAction() ], ) ] ) diff --git a/test/test_device_integrity_status.py b/test/test_device_integrity_status.py index f040c14..749fb1f 100644 --- a/test/test_device_integrity_status.py +++ b/test/test_device_integrity_status.py @@ -14,7 +14,7 @@ import unittest -from openapi_client.models.device_integrity_status import DeviceIntegrityStatus +from flightctl.models.device_integrity_status import DeviceIntegrityStatus class TestDeviceIntegrityStatus(unittest.TestCase): """DeviceIntegrityStatus unit test stubs""" @@ -35,13 +35,13 @@ def make_instance(self, include_optional) -> DeviceIntegrityStatus: model = DeviceIntegrityStatus() if include_optional: return DeviceIntegrityStatus( - summary = openapi_client.models.device_integrity_status_summary.DeviceIntegrityStatusSummary( + summary = flightctl.models.device_integrity_status_summary.DeviceIntegrityStatusSummary( status = 'Passed', info = '', ) ) else: return DeviceIntegrityStatus( - summary = openapi_client.models.device_integrity_status_summary.DeviceIntegrityStatusSummary( + summary = flightctl.models.device_integrity_status_summary.DeviceIntegrityStatusSummary( status = 'Passed', info = '', ), ) diff --git a/test/test_device_integrity_status_summary.py b/test/test_device_integrity_status_summary.py index 1f4db6e..30fa50c 100644 --- a/test/test_device_integrity_status_summary.py +++ b/test/test_device_integrity_status_summary.py @@ -14,7 +14,7 @@ import unittest -from openapi_client.models.device_integrity_status_summary import DeviceIntegrityStatusSummary +from flightctl.models.device_integrity_status_summary import DeviceIntegrityStatusSummary class TestDeviceIntegrityStatusSummary(unittest.TestCase): """DeviceIntegrityStatusSummary unit test stubs""" diff --git a/test/test_device_integrity_status_summary_type.py b/test/test_device_integrity_status_summary_type.py index bd739e5..a1d3b35 100644 --- a/test/test_device_integrity_status_summary_type.py +++ b/test/test_device_integrity_status_summary_type.py @@ -14,7 +14,7 @@ import unittest -from openapi_client.models.device_integrity_status_summary_type import DeviceIntegrityStatusSummaryType +from flightctl.models.device_integrity_status_summary_type import DeviceIntegrityStatusSummaryType class TestDeviceIntegrityStatusSummaryType(unittest.TestCase): """DeviceIntegrityStatusSummaryType unit test stubs""" diff --git a/test/test_device_list.py b/test/test_device_list.py index 9b5c6f7..49d0966 100644 --- a/test/test_device_list.py +++ b/test/test_device_list.py @@ -14,7 +14,7 @@ import unittest -from openapi_client.models.device_list import DeviceList +from flightctl.models.device_list import DeviceList class TestDeviceList(unittest.TestCase): """DeviceList unit test stubs""" @@ -37,14 +37,14 @@ def make_instance(self, include_optional) -> DeviceList: return DeviceList( api_version = '', kind = '', - metadata = openapi_client.models.list_meta.ListMeta( + metadata = flightctl.models.list_meta.ListMeta( continue = '', remaining_item_count = 56, ), items = [ - openapi_client.models.device.Device( + flightctl.models.device.Device( api_version = '', kind = '', - metadata = openapi_client.models.object_meta.ObjectMeta( + metadata = flightctl.models.object_meta.ObjectMeta( creation_timestamp = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), deletion_timestamp = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), name = '', @@ -57,19 +57,19 @@ def make_instance(self, include_optional) -> DeviceList: 'key' : '' }, resource_version = '', ), - spec = openapi_client.models.device_spec.DeviceSpec( - os = openapi_client.models.device_os_spec.DeviceOSSpec( + spec = flightctl.models.device_spec.DeviceSpec( + os = flightctl.models.device_os_spec.DeviceOSSpec( image = '', ), config = [ null ], - hooks = openapi_client.models.device_hooks_spec.DeviceHooksSpec( + hooks = flightctl.models.device_hooks_spec.DeviceHooksSpec( before_updating = [ - openapi_client.models.device_update_hook_spec.DeviceUpdateHookSpec( + flightctl.models.device_update_hook_spec.DeviceUpdateHookSpec( name = '', description = '', actions = [ - openapi_client.models.hook_action.HookAction() + flightctl.models.hook_action.HookAction() ], on_file = [ 'Create' @@ -77,43 +77,43 @@ def make_instance(self, include_optional) -> DeviceList: path = '', ) ], after_updating = [ - openapi_client.models.device_update_hook_spec.DeviceUpdateHookSpec( + flightctl.models.device_update_hook_spec.DeviceUpdateHookSpec( name = '', description = '', actions = [ - openapi_client.models.hook_action.HookAction() + flightctl.models.hook_action.HookAction() ], path = '', ) ], before_rebooting = [ - openapi_client.models.device_reboot_hook_spec.DeviceRebootHookSpec( + flightctl.models.device_reboot_hook_spec.DeviceRebootHookSpec( name = '', description = '', actions = [ - openapi_client.models.hook_action.HookAction() + flightctl.models.hook_action.HookAction() ], ) ], after_rebooting = [ - openapi_client.models.device_reboot_hook_spec.DeviceRebootHookSpec( + flightctl.models.device_reboot_hook_spec.DeviceRebootHookSpec( name = '', description = '', actions = [ - openapi_client.models.hook_action.HookAction() + flightctl.models.hook_action.HookAction() ], ) ], ), applications = [ - openapi_client.models.application_spec.ApplicationSpec() + flightctl.models.application_spec.ApplicationSpec() ], - systemd = openapi_client.models.device_spec_systemd.DeviceSpec_systemd( + systemd = flightctl.models.device_spec_systemd.DeviceSpec_systemd( match_patterns = [ 'ge34w9Wa*CLfoo\\yJX2gCb' ], ), resources = [ null ], ), - status = openapi_client.models.device_status.DeviceStatus( + status = flightctl.models.device_status.DeviceStatus( conditions = [ - openapi_client.models.condition.Condition( + flightctl.models.condition.Condition( type = 'Approved', status = 'True', observed_generation = 56, @@ -121,42 +121,42 @@ def make_instance(self, include_optional) -> DeviceList: message = '', reason = '', ) ], - system_info = openapi_client.models.device_system_info.DeviceSystemInfo( + system_info = flightctl.models.device_system_info.DeviceSystemInfo( architecture = '', boot_id = '', operating_system = '', ), applications = [ - openapi_client.models.device_application_status.DeviceApplicationStatus( + flightctl.models.device_application_status.DeviceApplicationStatus( name = '', ready = '', restarts = 56, status = 'Preparing', ) ], - applications_summary = openapi_client.models.device_applications_summary_status.DeviceApplicationsSummaryStatus( + applications_summary = flightctl.models.device_applications_summary_status.DeviceApplicationsSummaryStatus( status = 'Healthy', info = '', ), - resources = openapi_client.models.device_resource_status.DeviceResourceStatus( + resources = flightctl.models.device_resource_status.DeviceResourceStatus( cpu = 'Healthy', memory = 'Healthy', disk = 'Healthy', ), - integrity = openapi_client.models.device_integrity_status.DeviceIntegrityStatus( - summary = openapi_client.models.device_integrity_status_summary.DeviceIntegrityStatusSummary( + integrity = flightctl.models.device_integrity_status.DeviceIntegrityStatus( + summary = flightctl.models.device_integrity_status_summary.DeviceIntegrityStatusSummary( status = 'Passed', info = '', ), ), - config = openapi_client.models.device_config_status.DeviceConfigStatus( + config = flightctl.models.device_config_status.DeviceConfigStatus( rendered_version = '', ), - os = openapi_client.models.device_os_status.DeviceOSStatus( + os = flightctl.models.device_os_status.DeviceOSStatus( image = '', image_digest = '', ), - updated = openapi_client.models.device_updated_status.DeviceUpdatedStatus( + updated = flightctl.models.device_updated_status.DeviceUpdatedStatus( status = 'UpToDate', info = '', ), - summary = openapi_client.models.device_summary_status.DeviceSummaryStatus( + summary = flightctl.models.device_summary_status.DeviceSummaryStatus( status = 'Online', info = '', ), last_seen = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), ), ) ], - summary = openapi_client.models.devices_summary.DevicesSummary( + summary = flightctl.models.devices_summary.DevicesSummary( total = 56, application_status = { 'key' : 56 @@ -172,14 +172,14 @@ def make_instance(self, include_optional) -> DeviceList: return DeviceList( api_version = '', kind = '', - metadata = openapi_client.models.list_meta.ListMeta( + metadata = flightctl.models.list_meta.ListMeta( continue = '', remaining_item_count = 56, ), items = [ - openapi_client.models.device.Device( + flightctl.models.device.Device( api_version = '', kind = '', - metadata = openapi_client.models.object_meta.ObjectMeta( + metadata = flightctl.models.object_meta.ObjectMeta( creation_timestamp = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), deletion_timestamp = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), name = '', @@ -192,19 +192,19 @@ def make_instance(self, include_optional) -> DeviceList: 'key' : '' }, resource_version = '', ), - spec = openapi_client.models.device_spec.DeviceSpec( - os = openapi_client.models.device_os_spec.DeviceOSSpec( + spec = flightctl.models.device_spec.DeviceSpec( + os = flightctl.models.device_os_spec.DeviceOSSpec( image = '', ), config = [ null ], - hooks = openapi_client.models.device_hooks_spec.DeviceHooksSpec( + hooks = flightctl.models.device_hooks_spec.DeviceHooksSpec( before_updating = [ - openapi_client.models.device_update_hook_spec.DeviceUpdateHookSpec( + flightctl.models.device_update_hook_spec.DeviceUpdateHookSpec( name = '', description = '', actions = [ - openapi_client.models.hook_action.HookAction() + flightctl.models.hook_action.HookAction() ], on_file = [ 'Create' @@ -212,43 +212,43 @@ def make_instance(self, include_optional) -> DeviceList: path = '', ) ], after_updating = [ - openapi_client.models.device_update_hook_spec.DeviceUpdateHookSpec( + flightctl.models.device_update_hook_spec.DeviceUpdateHookSpec( name = '', description = '', actions = [ - openapi_client.models.hook_action.HookAction() + flightctl.models.hook_action.HookAction() ], path = '', ) ], before_rebooting = [ - openapi_client.models.device_reboot_hook_spec.DeviceRebootHookSpec( + flightctl.models.device_reboot_hook_spec.DeviceRebootHookSpec( name = '', description = '', actions = [ - openapi_client.models.hook_action.HookAction() + flightctl.models.hook_action.HookAction() ], ) ], after_rebooting = [ - openapi_client.models.device_reboot_hook_spec.DeviceRebootHookSpec( + flightctl.models.device_reboot_hook_spec.DeviceRebootHookSpec( name = '', description = '', actions = [ - openapi_client.models.hook_action.HookAction() + flightctl.models.hook_action.HookAction() ], ) ], ), applications = [ - openapi_client.models.application_spec.ApplicationSpec() + flightctl.models.application_spec.ApplicationSpec() ], - systemd = openapi_client.models.device_spec_systemd.DeviceSpec_systemd( + systemd = flightctl.models.device_spec_systemd.DeviceSpec_systemd( match_patterns = [ 'ge34w9Wa*CLfoo\\yJX2gCb' ], ), resources = [ null ], ), - status = openapi_client.models.device_status.DeviceStatus( + status = flightctl.models.device_status.DeviceStatus( conditions = [ - openapi_client.models.condition.Condition( + flightctl.models.condition.Condition( type = 'Approved', status = 'True', observed_generation = 56, @@ -256,37 +256,37 @@ def make_instance(self, include_optional) -> DeviceList: message = '', reason = '', ) ], - system_info = openapi_client.models.device_system_info.DeviceSystemInfo( + system_info = flightctl.models.device_system_info.DeviceSystemInfo( architecture = '', boot_id = '', operating_system = '', ), applications = [ - openapi_client.models.device_application_status.DeviceApplicationStatus( + flightctl.models.device_application_status.DeviceApplicationStatus( name = '', ready = '', restarts = 56, status = 'Preparing', ) ], - applications_summary = openapi_client.models.device_applications_summary_status.DeviceApplicationsSummaryStatus( + applications_summary = flightctl.models.device_applications_summary_status.DeviceApplicationsSummaryStatus( status = 'Healthy', info = '', ), - resources = openapi_client.models.device_resource_status.DeviceResourceStatus( + resources = flightctl.models.device_resource_status.DeviceResourceStatus( cpu = 'Healthy', memory = 'Healthy', disk = 'Healthy', ), - integrity = openapi_client.models.device_integrity_status.DeviceIntegrityStatus( - summary = openapi_client.models.device_integrity_status_summary.DeviceIntegrityStatusSummary( + integrity = flightctl.models.device_integrity_status.DeviceIntegrityStatus( + summary = flightctl.models.device_integrity_status_summary.DeviceIntegrityStatusSummary( status = 'Passed', info = '', ), ), - config = openapi_client.models.device_config_status.DeviceConfigStatus( + config = flightctl.models.device_config_status.DeviceConfigStatus( rendered_version = '', ), - os = openapi_client.models.device_os_status.DeviceOSStatus( + os = flightctl.models.device_os_status.DeviceOSStatus( image = '', image_digest = '', ), - updated = openapi_client.models.device_updated_status.DeviceUpdatedStatus( + updated = flightctl.models.device_updated_status.DeviceUpdatedStatus( status = 'UpToDate', info = '', ), - summary = openapi_client.models.device_summary_status.DeviceSummaryStatus( + summary = flightctl.models.device_summary_status.DeviceSummaryStatus( status = 'Online', info = '', ), last_seen = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), ), ) diff --git a/test/test_device_os_spec.py b/test/test_device_os_spec.py index 031cafa..3916b23 100644 --- a/test/test_device_os_spec.py +++ b/test/test_device_os_spec.py @@ -14,7 +14,7 @@ import unittest -from openapi_client.models.device_os_spec import DeviceOSSpec +from flightctl.models.device_os_spec import DeviceOSSpec class TestDeviceOSSpec(unittest.TestCase): """DeviceOSSpec unit test stubs""" diff --git a/test/test_device_os_status.py b/test/test_device_os_status.py index 7eb322b..aea9212 100644 --- a/test/test_device_os_status.py +++ b/test/test_device_os_status.py @@ -14,7 +14,7 @@ import unittest -from openapi_client.models.device_os_status import DeviceOSStatus +from flightctl.models.device_os_status import DeviceOSStatus class TestDeviceOSStatus(unittest.TestCase): """DeviceOSStatus unit test stubs""" diff --git a/test/test_device_reboot_hook_spec.py b/test/test_device_reboot_hook_spec.py index bd4a609..3d03757 100644 --- a/test/test_device_reboot_hook_spec.py +++ b/test/test_device_reboot_hook_spec.py @@ -14,7 +14,7 @@ import unittest -from openapi_client.models.device_reboot_hook_spec import DeviceRebootHookSpec +from flightctl.models.device_reboot_hook_spec import DeviceRebootHookSpec class TestDeviceRebootHookSpec(unittest.TestCase): """DeviceRebootHookSpec unit test stubs""" @@ -38,13 +38,13 @@ def make_instance(self, include_optional) -> DeviceRebootHookSpec: name = '', description = '', actions = [ - openapi_client.models.hook_action.HookAction() + flightctl.models.hook_action.HookAction() ] ) else: return DeviceRebootHookSpec( actions = [ - openapi_client.models.hook_action.HookAction() + flightctl.models.hook_action.HookAction() ], ) """ diff --git a/test/test_device_resource_status.py b/test/test_device_resource_status.py index 050389d..4c1d981 100644 --- a/test/test_device_resource_status.py +++ b/test/test_device_resource_status.py @@ -14,7 +14,7 @@ import unittest -from openapi_client.models.device_resource_status import DeviceResourceStatus +from flightctl.models.device_resource_status import DeviceResourceStatus class TestDeviceResourceStatus(unittest.TestCase): """DeviceResourceStatus unit test stubs""" diff --git a/test/test_device_resource_status_type.py b/test/test_device_resource_status_type.py index ceb5435..72bc07f 100644 --- a/test/test_device_resource_status_type.py +++ b/test/test_device_resource_status_type.py @@ -14,7 +14,7 @@ import unittest -from openapi_client.models.device_resource_status_type import DeviceResourceStatusType +from flightctl.models.device_resource_status_type import DeviceResourceStatusType class TestDeviceResourceStatusType(unittest.TestCase): """DeviceResourceStatusType unit test stubs""" diff --git a/test/test_device_spec.py b/test/test_device_spec.py index 8120302..34fd365 100644 --- a/test/test_device_spec.py +++ b/test/test_device_spec.py @@ -14,7 +14,7 @@ import unittest -from openapi_client.models.device_spec import DeviceSpec +from flightctl.models.device_spec import DeviceSpec class TestDeviceSpec(unittest.TestCase): """DeviceSpec unit test stubs""" @@ -35,18 +35,18 @@ def make_instance(self, include_optional) -> DeviceSpec: model = DeviceSpec() if include_optional: return DeviceSpec( - os = openapi_client.models.device_os_spec.DeviceOSSpec( + os = flightctl.models.device_os_spec.DeviceOSSpec( image = '', ), config = [ null ], - hooks = openapi_client.models.device_hooks_spec.DeviceHooksSpec( + hooks = flightctl.models.device_hooks_spec.DeviceHooksSpec( before_updating = [ - openapi_client.models.device_update_hook_spec.DeviceUpdateHookSpec( + flightctl.models.device_update_hook_spec.DeviceUpdateHookSpec( name = '', description = '', actions = [ - openapi_client.models.hook_action.HookAction() + flightctl.models.hook_action.HookAction() ], on_file = [ 'Create' @@ -54,34 +54,34 @@ def make_instance(self, include_optional) -> DeviceSpec: path = '', ) ], after_updating = [ - openapi_client.models.device_update_hook_spec.DeviceUpdateHookSpec( + flightctl.models.device_update_hook_spec.DeviceUpdateHookSpec( name = '', description = '', actions = [ - openapi_client.models.hook_action.HookAction() + flightctl.models.hook_action.HookAction() ], path = '', ) ], before_rebooting = [ - openapi_client.models.device_reboot_hook_spec.DeviceRebootHookSpec( + flightctl.models.device_reboot_hook_spec.DeviceRebootHookSpec( name = '', description = '', actions = [ - openapi_client.models.hook_action.HookAction() + flightctl.models.hook_action.HookAction() ], ) ], after_rebooting = [ - openapi_client.models.device_reboot_hook_spec.DeviceRebootHookSpec( + flightctl.models.device_reboot_hook_spec.DeviceRebootHookSpec( name = '', description = '', actions = [ - openapi_client.models.hook_action.HookAction() + flightctl.models.hook_action.HookAction() ], ) ], ), applications = [ - openapi_client.models.application_spec.ApplicationSpec() + flightctl.models.application_spec.ApplicationSpec() ], - systemd = openapi_client.models.device_spec_systemd.DeviceSpec_systemd( + systemd = flightctl.models.device_spec_systemd.DeviceSpec_systemd( match_patterns = [ 'ge34w9Wa*CLfoo\\yJX2gCb' ], ), diff --git a/test/test_device_spec_systemd.py b/test/test_device_spec_systemd.py index be0186b..834d052 100644 --- a/test/test_device_spec_systemd.py +++ b/test/test_device_spec_systemd.py @@ -14,7 +14,7 @@ import unittest -from openapi_client.models.device_spec_systemd import DeviceSpecSystemd +from flightctl.models.device_spec_systemd import DeviceSpecSystemd class TestDeviceSpecSystemd(unittest.TestCase): """DeviceSpecSystemd unit test stubs""" diff --git a/test/test_device_status.py b/test/test_device_status.py index c5e3161..d403fd3 100644 --- a/test/test_device_status.py +++ b/test/test_device_status.py @@ -14,7 +14,7 @@ import unittest -from openapi_client.models.device_status import DeviceStatus +from flightctl.models.device_status import DeviceStatus class TestDeviceStatus(unittest.TestCase): """DeviceStatus unit test stubs""" @@ -36,7 +36,7 @@ def make_instance(self, include_optional) -> DeviceStatus: if include_optional: return DeviceStatus( conditions = [ - openapi_client.models.condition.Condition( + flightctl.models.condition.Condition( type = 'Approved', status = 'True', observed_generation = 56, @@ -44,37 +44,37 @@ def make_instance(self, include_optional) -> DeviceStatus: message = '', reason = '', ) ], - system_info = openapi_client.models.device_system_info.DeviceSystemInfo( + system_info = flightctl.models.device_system_info.DeviceSystemInfo( architecture = '', boot_id = '', operating_system = '', ), applications = [ - openapi_client.models.device_application_status.DeviceApplicationStatus( + flightctl.models.device_application_status.DeviceApplicationStatus( name = '', ready = '', restarts = 56, status = 'Preparing', ) ], - applications_summary = openapi_client.models.device_applications_summary_status.DeviceApplicationsSummaryStatus( + applications_summary = flightctl.models.device_applications_summary_status.DeviceApplicationsSummaryStatus( status = 'Healthy', info = '', ), - resources = openapi_client.models.device_resource_status.DeviceResourceStatus( + resources = flightctl.models.device_resource_status.DeviceResourceStatus( cpu = 'Healthy', memory = 'Healthy', disk = 'Healthy', ), - integrity = openapi_client.models.device_integrity_status.DeviceIntegrityStatus( - summary = openapi_client.models.device_integrity_status_summary.DeviceIntegrityStatusSummary( + integrity = flightctl.models.device_integrity_status.DeviceIntegrityStatus( + summary = flightctl.models.device_integrity_status_summary.DeviceIntegrityStatusSummary( status = 'Passed', info = '', ), ), - config = openapi_client.models.device_config_status.DeviceConfigStatus( + config = flightctl.models.device_config_status.DeviceConfigStatus( rendered_version = '', ), - os = openapi_client.models.device_os_status.DeviceOSStatus( + os = flightctl.models.device_os_status.DeviceOSStatus( image = '', image_digest = '', ), - updated = openapi_client.models.device_updated_status.DeviceUpdatedStatus( + updated = flightctl.models.device_updated_status.DeviceUpdatedStatus( status = 'UpToDate', info = '', ), - summary = openapi_client.models.device_summary_status.DeviceSummaryStatus( + summary = flightctl.models.device_summary_status.DeviceSummaryStatus( status = 'Online', info = '', ), last_seen = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f') @@ -82,7 +82,7 @@ def make_instance(self, include_optional) -> DeviceStatus: else: return DeviceStatus( conditions = [ - openapi_client.models.condition.Condition( + flightctl.models.condition.Condition( type = 'Approved', status = 'True', observed_generation = 56, @@ -90,37 +90,37 @@ def make_instance(self, include_optional) -> DeviceStatus: message = '', reason = '', ) ], - system_info = openapi_client.models.device_system_info.DeviceSystemInfo( + system_info = flightctl.models.device_system_info.DeviceSystemInfo( architecture = '', boot_id = '', operating_system = '', ), applications = [ - openapi_client.models.device_application_status.DeviceApplicationStatus( + flightctl.models.device_application_status.DeviceApplicationStatus( name = '', ready = '', restarts = 56, status = 'Preparing', ) ], - applications_summary = openapi_client.models.device_applications_summary_status.DeviceApplicationsSummaryStatus( + applications_summary = flightctl.models.device_applications_summary_status.DeviceApplicationsSummaryStatus( status = 'Healthy', info = '', ), - resources = openapi_client.models.device_resource_status.DeviceResourceStatus( + resources = flightctl.models.device_resource_status.DeviceResourceStatus( cpu = 'Healthy', memory = 'Healthy', disk = 'Healthy', ), - integrity = openapi_client.models.device_integrity_status.DeviceIntegrityStatus( - summary = openapi_client.models.device_integrity_status_summary.DeviceIntegrityStatusSummary( + integrity = flightctl.models.device_integrity_status.DeviceIntegrityStatus( + summary = flightctl.models.device_integrity_status_summary.DeviceIntegrityStatusSummary( status = 'Passed', info = '', ), ), - config = openapi_client.models.device_config_status.DeviceConfigStatus( + config = flightctl.models.device_config_status.DeviceConfigStatus( rendered_version = '', ), - os = openapi_client.models.device_os_status.DeviceOSStatus( + os = flightctl.models.device_os_status.DeviceOSStatus( image = '', image_digest = '', ), - updated = openapi_client.models.device_updated_status.DeviceUpdatedStatus( + updated = flightctl.models.device_updated_status.DeviceUpdatedStatus( status = 'UpToDate', info = '', ), - summary = openapi_client.models.device_summary_status.DeviceSummaryStatus( + summary = flightctl.models.device_summary_status.DeviceSummaryStatus( status = 'Online', info = '', ), last_seen = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), diff --git a/test/test_device_summary_status.py b/test/test_device_summary_status.py index bd9931a..d5881fa 100644 --- a/test/test_device_summary_status.py +++ b/test/test_device_summary_status.py @@ -14,7 +14,7 @@ import unittest -from openapi_client.models.device_summary_status import DeviceSummaryStatus +from flightctl.models.device_summary_status import DeviceSummaryStatus class TestDeviceSummaryStatus(unittest.TestCase): """DeviceSummaryStatus unit test stubs""" diff --git a/test/test_device_summary_status_type.py b/test/test_device_summary_status_type.py index f2c9cd6..c8eaba2 100644 --- a/test/test_device_summary_status_type.py +++ b/test/test_device_summary_status_type.py @@ -14,7 +14,7 @@ import unittest -from openapi_client.models.device_summary_status_type import DeviceSummaryStatusType +from flightctl.models.device_summary_status_type import DeviceSummaryStatusType class TestDeviceSummaryStatusType(unittest.TestCase): """DeviceSummaryStatusType unit test stubs""" diff --git a/test/test_device_system_info.py b/test/test_device_system_info.py index c106470..2915220 100644 --- a/test/test_device_system_info.py +++ b/test/test_device_system_info.py @@ -14,7 +14,7 @@ import unittest -from openapi_client.models.device_system_info import DeviceSystemInfo +from flightctl.models.device_system_info import DeviceSystemInfo class TestDeviceSystemInfo(unittest.TestCase): """DeviceSystemInfo unit test stubs""" diff --git a/test/test_device_update_hook_spec.py b/test/test_device_update_hook_spec.py index 62520a9..8457619 100644 --- a/test/test_device_update_hook_spec.py +++ b/test/test_device_update_hook_spec.py @@ -14,7 +14,7 @@ import unittest -from openapi_client.models.device_update_hook_spec import DeviceUpdateHookSpec +from flightctl.models.device_update_hook_spec import DeviceUpdateHookSpec class TestDeviceUpdateHookSpec(unittest.TestCase): """DeviceUpdateHookSpec unit test stubs""" @@ -38,7 +38,7 @@ def make_instance(self, include_optional) -> DeviceUpdateHookSpec: name = '', description = '', actions = [ - openapi_client.models.hook_action.HookAction() + flightctl.models.hook_action.HookAction() ], on_file = [ 'Create' @@ -48,7 +48,7 @@ def make_instance(self, include_optional) -> DeviceUpdateHookSpec: else: return DeviceUpdateHookSpec( actions = [ - openapi_client.models.hook_action.HookAction() + flightctl.models.hook_action.HookAction() ], ) """ diff --git a/test/test_device_updated_status.py b/test/test_device_updated_status.py index f10ae2e..b09a8fe 100644 --- a/test/test_device_updated_status.py +++ b/test/test_device_updated_status.py @@ -14,7 +14,7 @@ import unittest -from openapi_client.models.device_updated_status import DeviceUpdatedStatus +from flightctl.models.device_updated_status import DeviceUpdatedStatus class TestDeviceUpdatedStatus(unittest.TestCase): """DeviceUpdatedStatus unit test stubs""" diff --git a/test/test_device_updated_status_type.py b/test/test_device_updated_status_type.py index 434fe4a..98f5612 100644 --- a/test/test_device_updated_status_type.py +++ b/test/test_device_updated_status_type.py @@ -14,7 +14,7 @@ import unittest -from openapi_client.models.device_updated_status_type import DeviceUpdatedStatusType +from flightctl.models.device_updated_status_type import DeviceUpdatedStatusType class TestDeviceUpdatedStatusType(unittest.TestCase): """DeviceUpdatedStatusType unit test stubs""" diff --git a/test/test_devices_summary.py b/test/test_devices_summary.py index 1fa020b..0fac3ad 100644 --- a/test/test_devices_summary.py +++ b/test/test_devices_summary.py @@ -14,7 +14,7 @@ import unittest -from openapi_client.models.devices_summary import DevicesSummary +from flightctl.models.devices_summary import DevicesSummary class TestDevicesSummary(unittest.TestCase): """DevicesSummary unit test stubs""" diff --git a/test/test_disk_resource_monitor_spec.py b/test/test_disk_resource_monitor_spec.py index 77956ce..bca4c9d 100644 --- a/test/test_disk_resource_monitor_spec.py +++ b/test/test_disk_resource_monitor_spec.py @@ -14,7 +14,7 @@ import unittest -from openapi_client.models.disk_resource_monitor_spec import DiskResourceMonitorSpec +from flightctl.models.disk_resource_monitor_spec import DiskResourceMonitorSpec class TestDiskResourceMonitorSpec(unittest.TestCase): """DiskResourceMonitorSpec unit test stubs""" @@ -37,7 +37,7 @@ def make_instance(self, include_optional) -> DiskResourceMonitorSpec: return DiskResourceMonitorSpec( monitor_type = '', alert_rules = [ - openapi_client.models.resource_alert_rule.ResourceAlertRule( + flightctl.models.resource_alert_rule.ResourceAlertRule( severity = 'Warning', duration = '4s', percentage = 1.337, @@ -50,7 +50,7 @@ def make_instance(self, include_optional) -> DiskResourceMonitorSpec: return DiskResourceMonitorSpec( monitor_type = '', alert_rules = [ - openapi_client.models.resource_alert_rule.ResourceAlertRule( + flightctl.models.resource_alert_rule.ResourceAlertRule( severity = 'Warning', duration = '4s', percentage = 1.337, diff --git a/test/test_disruption_allowance.py b/test/test_disruption_allowance.py index f2bb628..cc38c8e 100644 --- a/test/test_disruption_allowance.py +++ b/test/test_disruption_allowance.py @@ -14,7 +14,7 @@ import unittest -from openapi_client.models.disruption_allowance import DisruptionAllowance +from flightctl.models.disruption_allowance import DisruptionAllowance class TestDisruptionAllowance(unittest.TestCase): """DisruptionAllowance unit test stubs""" diff --git a/test/test_enrollment_config.py b/test/test_enrollment_config.py index fa2df94..cc779bf 100644 --- a/test/test_enrollment_config.py +++ b/test/test_enrollment_config.py @@ -14,7 +14,7 @@ import unittest -from openapi_client.models.enrollment_config import EnrollmentConfig +from flightctl.models.enrollment_config import EnrollmentConfig class TestEnrollmentConfig(unittest.TestCase): """EnrollmentConfig unit test stubs""" @@ -35,11 +35,11 @@ def make_instance(self, include_optional) -> EnrollmentConfig: model = EnrollmentConfig() if include_optional: return EnrollmentConfig( - enrollment_service = openapi_client.models.enrollment_service.EnrollmentService( - authentication = openapi_client.models.enrollment_service_auth.EnrollmentServiceAuth( + enrollment_service = flightctl.models.enrollment_service.EnrollmentService( + authentication = flightctl.models.enrollment_service_auth.EnrollmentServiceAuth( client_certificate_data = '', client_key_data = '', ), - service = openapi_client.models.enrollment_service_service.EnrollmentServiceService( + service = flightctl.models.enrollment_service_service.EnrollmentServiceService( certificate_authority_data = '', server = '', ), enrollment_ui_endpoint = '', ), @@ -47,11 +47,11 @@ def make_instance(self, include_optional) -> EnrollmentConfig: ) else: return EnrollmentConfig( - enrollment_service = openapi_client.models.enrollment_service.EnrollmentService( - authentication = openapi_client.models.enrollment_service_auth.EnrollmentServiceAuth( + enrollment_service = flightctl.models.enrollment_service.EnrollmentService( + authentication = flightctl.models.enrollment_service_auth.EnrollmentServiceAuth( client_certificate_data = '', client_key_data = '', ), - service = openapi_client.models.enrollment_service_service.EnrollmentServiceService( + service = flightctl.models.enrollment_service_service.EnrollmentServiceService( certificate_authority_data = '', server = '', ), enrollment_ui_endpoint = '', ), diff --git a/test/test_enrollment_request.py b/test/test_enrollment_request.py index c444c9b..f992645 100644 --- a/test/test_enrollment_request.py +++ b/test/test_enrollment_request.py @@ -14,7 +14,7 @@ import unittest -from openapi_client.models.enrollment_request import EnrollmentRequest +from flightctl.models.enrollment_request import EnrollmentRequest class TestEnrollmentRequest(unittest.TestCase): """EnrollmentRequest unit test stubs""" @@ -37,7 +37,7 @@ def make_instance(self, include_optional) -> EnrollmentRequest: return EnrollmentRequest( api_version = '', kind = '', - metadata = openapi_client.models.object_meta.ObjectMeta( + metadata = flightctl.models.object_meta.ObjectMeta( creation_timestamp = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), deletion_timestamp = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), name = '', @@ -50,11 +50,11 @@ def make_instance(self, include_optional) -> EnrollmentRequest: 'key' : '' }, resource_version = '', ), - spec = openapi_client.models.enrollment_request_spec.EnrollmentRequestSpec( + spec = flightctl.models.enrollment_request_spec.EnrollmentRequestSpec( csr = '', - device_status = openapi_client.models.device_status.DeviceStatus( + device_status = flightctl.models.device_status.DeviceStatus( conditions = [ - openapi_client.models.condition.Condition( + flightctl.models.condition.Condition( type = 'Approved', status = 'True', observed_generation = 56, @@ -62,47 +62,47 @@ def make_instance(self, include_optional) -> EnrollmentRequest: message = '', reason = '', ) ], - system_info = openapi_client.models.device_system_info.DeviceSystemInfo( + system_info = flightctl.models.device_system_info.DeviceSystemInfo( architecture = '', boot_id = '', operating_system = '', ), applications = [ - openapi_client.models.device_application_status.DeviceApplicationStatus( + flightctl.models.device_application_status.DeviceApplicationStatus( name = '', ready = '', restarts = 56, status = 'Preparing', ) ], - applications_summary = openapi_client.models.device_applications_summary_status.DeviceApplicationsSummaryStatus( + applications_summary = flightctl.models.device_applications_summary_status.DeviceApplicationsSummaryStatus( status = 'Healthy', info = '', ), - resources = openapi_client.models.device_resource_status.DeviceResourceStatus( + resources = flightctl.models.device_resource_status.DeviceResourceStatus( cpu = 'Healthy', memory = 'Healthy', disk = 'Healthy', ), - integrity = openapi_client.models.device_integrity_status.DeviceIntegrityStatus( - summary = openapi_client.models.device_integrity_status_summary.DeviceIntegrityStatusSummary( + integrity = flightctl.models.device_integrity_status.DeviceIntegrityStatus( + summary = flightctl.models.device_integrity_status_summary.DeviceIntegrityStatusSummary( status = 'Passed', info = '', ), ), - config = openapi_client.models.device_config_status.DeviceConfigStatus( + config = flightctl.models.device_config_status.DeviceConfigStatus( rendered_version = '', ), - os = openapi_client.models.device_os_status.DeviceOSStatus( + os = flightctl.models.device_os_status.DeviceOSStatus( image = '', image_digest = '', ), - updated = openapi_client.models.device_updated_status.DeviceUpdatedStatus( + updated = flightctl.models.device_updated_status.DeviceUpdatedStatus( status = 'UpToDate', info = '', ), - summary = openapi_client.models.device_summary_status.DeviceSummaryStatus( + summary = flightctl.models.device_summary_status.DeviceSummaryStatus( status = 'Online', info = '', ), last_seen = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), ), labels = { 'key' : '' }, ), - status = openapi_client.models.enrollment_request_status.EnrollmentRequestStatus( + status = flightctl.models.enrollment_request_status.EnrollmentRequestStatus( certificate = '', conditions = [ - openapi_client.models.condition.Condition( + flightctl.models.condition.Condition( type = 'Approved', status = 'True', observed_generation = 56, @@ -110,7 +110,7 @@ def make_instance(self, include_optional) -> EnrollmentRequest: message = '', reason = '', ) ], - approval = openapi_client.models.enrollment_request_approval.EnrollmentRequestApproval( + approval = flightctl.models.enrollment_request_approval.EnrollmentRequestApproval( labels = { 'key' : '' }, @@ -122,7 +122,7 @@ def make_instance(self, include_optional) -> EnrollmentRequest: return EnrollmentRequest( api_version = '', kind = '', - metadata = openapi_client.models.object_meta.ObjectMeta( + metadata = flightctl.models.object_meta.ObjectMeta( creation_timestamp = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), deletion_timestamp = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), name = '', @@ -135,11 +135,11 @@ def make_instance(self, include_optional) -> EnrollmentRequest: 'key' : '' }, resource_version = '', ), - spec = openapi_client.models.enrollment_request_spec.EnrollmentRequestSpec( + spec = flightctl.models.enrollment_request_spec.EnrollmentRequestSpec( csr = '', - device_status = openapi_client.models.device_status.DeviceStatus( + device_status = flightctl.models.device_status.DeviceStatus( conditions = [ - openapi_client.models.condition.Condition( + flightctl.models.condition.Condition( type = 'Approved', status = 'True', observed_generation = 56, @@ -147,37 +147,37 @@ def make_instance(self, include_optional) -> EnrollmentRequest: message = '', reason = '', ) ], - system_info = openapi_client.models.device_system_info.DeviceSystemInfo( + system_info = flightctl.models.device_system_info.DeviceSystemInfo( architecture = '', boot_id = '', operating_system = '', ), applications = [ - openapi_client.models.device_application_status.DeviceApplicationStatus( + flightctl.models.device_application_status.DeviceApplicationStatus( name = '', ready = '', restarts = 56, status = 'Preparing', ) ], - applications_summary = openapi_client.models.device_applications_summary_status.DeviceApplicationsSummaryStatus( + applications_summary = flightctl.models.device_applications_summary_status.DeviceApplicationsSummaryStatus( status = 'Healthy', info = '', ), - resources = openapi_client.models.device_resource_status.DeviceResourceStatus( + resources = flightctl.models.device_resource_status.DeviceResourceStatus( cpu = 'Healthy', memory = 'Healthy', disk = 'Healthy', ), - integrity = openapi_client.models.device_integrity_status.DeviceIntegrityStatus( - summary = openapi_client.models.device_integrity_status_summary.DeviceIntegrityStatusSummary( + integrity = flightctl.models.device_integrity_status.DeviceIntegrityStatus( + summary = flightctl.models.device_integrity_status_summary.DeviceIntegrityStatusSummary( status = 'Passed', info = '', ), ), - config = openapi_client.models.device_config_status.DeviceConfigStatus( + config = flightctl.models.device_config_status.DeviceConfigStatus( rendered_version = '', ), - os = openapi_client.models.device_os_status.DeviceOSStatus( + os = flightctl.models.device_os_status.DeviceOSStatus( image = '', image_digest = '', ), - updated = openapi_client.models.device_updated_status.DeviceUpdatedStatus( + updated = flightctl.models.device_updated_status.DeviceUpdatedStatus( status = 'UpToDate', info = '', ), - summary = openapi_client.models.device_summary_status.DeviceSummaryStatus( + summary = flightctl.models.device_summary_status.DeviceSummaryStatus( status = 'Online', info = '', ), last_seen = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), ), diff --git a/test/test_enrollment_request_approval.py b/test/test_enrollment_request_approval.py index fff2fb8..2f19e91 100644 --- a/test/test_enrollment_request_approval.py +++ b/test/test_enrollment_request_approval.py @@ -14,7 +14,7 @@ import unittest -from openapi_client.models.enrollment_request_approval import EnrollmentRequestApproval +from flightctl.models.enrollment_request_approval import EnrollmentRequestApproval class TestEnrollmentRequestApproval(unittest.TestCase): """EnrollmentRequestApproval unit test stubs""" diff --git a/test/test_enrollment_request_list.py b/test/test_enrollment_request_list.py index 6e1b49d..072bdcd 100644 --- a/test/test_enrollment_request_list.py +++ b/test/test_enrollment_request_list.py @@ -14,7 +14,7 @@ import unittest -from openapi_client.models.enrollment_request_list import EnrollmentRequestList +from flightctl.models.enrollment_request_list import EnrollmentRequestList class TestEnrollmentRequestList(unittest.TestCase): """EnrollmentRequestList unit test stubs""" @@ -37,14 +37,14 @@ def make_instance(self, include_optional) -> EnrollmentRequestList: return EnrollmentRequestList( api_version = '', kind = '', - metadata = openapi_client.models.list_meta.ListMeta( + metadata = flightctl.models.list_meta.ListMeta( continue = '', remaining_item_count = 56, ), items = [ - openapi_client.models.enrollment_request.EnrollmentRequest( + flightctl.models.enrollment_request.EnrollmentRequest( api_version = '', kind = '', - metadata = openapi_client.models.object_meta.ObjectMeta( + metadata = flightctl.models.object_meta.ObjectMeta( creation_timestamp = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), deletion_timestamp = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), name = '', @@ -57,11 +57,11 @@ def make_instance(self, include_optional) -> EnrollmentRequestList: 'key' : '' }, resource_version = '', ), - spec = openapi_client.models.enrollment_request_spec.EnrollmentRequestSpec( + spec = flightctl.models.enrollment_request_spec.EnrollmentRequestSpec( csr = '', - device_status = openapi_client.models.device_status.DeviceStatus( + device_status = flightctl.models.device_status.DeviceStatus( conditions = [ - openapi_client.models.condition.Condition( + flightctl.models.condition.Condition( type = 'Approved', status = 'True', observed_generation = 56, @@ -69,44 +69,44 @@ def make_instance(self, include_optional) -> EnrollmentRequestList: message = '', reason = '', ) ], - system_info = openapi_client.models.device_system_info.DeviceSystemInfo( + system_info = flightctl.models.device_system_info.DeviceSystemInfo( architecture = '', boot_id = '', operating_system = '', ), applications = [ - openapi_client.models.device_application_status.DeviceApplicationStatus( + flightctl.models.device_application_status.DeviceApplicationStatus( name = '', ready = '', restarts = 56, status = 'Preparing', ) ], - applications_summary = openapi_client.models.device_applications_summary_status.DeviceApplicationsSummaryStatus( + applications_summary = flightctl.models.device_applications_summary_status.DeviceApplicationsSummaryStatus( status = 'Healthy', info = '', ), - resources = openapi_client.models.device_resource_status.DeviceResourceStatus( + resources = flightctl.models.device_resource_status.DeviceResourceStatus( cpu = 'Healthy', memory = 'Healthy', disk = 'Healthy', ), - integrity = openapi_client.models.device_integrity_status.DeviceIntegrityStatus( - summary = openapi_client.models.device_integrity_status_summary.DeviceIntegrityStatusSummary( + integrity = flightctl.models.device_integrity_status.DeviceIntegrityStatus( + summary = flightctl.models.device_integrity_status_summary.DeviceIntegrityStatusSummary( status = 'Passed', info = '', ), ), - config = openapi_client.models.device_config_status.DeviceConfigStatus( + config = flightctl.models.device_config_status.DeviceConfigStatus( rendered_version = '', ), - os = openapi_client.models.device_os_status.DeviceOSStatus( + os = flightctl.models.device_os_status.DeviceOSStatus( image = '', image_digest = '', ), - updated = openapi_client.models.device_updated_status.DeviceUpdatedStatus( + updated = flightctl.models.device_updated_status.DeviceUpdatedStatus( status = 'UpToDate', info = '', ), - summary = openapi_client.models.device_summary_status.DeviceSummaryStatus( + summary = flightctl.models.device_summary_status.DeviceSummaryStatus( status = 'Online', info = '', ), last_seen = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), ), ), - status = openapi_client.models.enrollment_request_status.EnrollmentRequestStatus( + status = flightctl.models.enrollment_request_status.EnrollmentRequestStatus( certificate = '', conditions = [ - openapi_client.models.condition.Condition( + flightctl.models.condition.Condition( type = 'Approved', status = 'True', observed_generation = 56, @@ -114,7 +114,7 @@ def make_instance(self, include_optional) -> EnrollmentRequestList: message = '', reason = '', ) ], - approval = openapi_client.models.enrollment_request_approval.EnrollmentRequestApproval( + approval = flightctl.models.enrollment_request_approval.EnrollmentRequestApproval( approved = True, approved_by = '', approved_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), ), ), ) @@ -124,14 +124,14 @@ def make_instance(self, include_optional) -> EnrollmentRequestList: return EnrollmentRequestList( api_version = '', kind = '', - metadata = openapi_client.models.list_meta.ListMeta( + metadata = flightctl.models.list_meta.ListMeta( continue = '', remaining_item_count = 56, ), items = [ - openapi_client.models.enrollment_request.EnrollmentRequest( + flightctl.models.enrollment_request.EnrollmentRequest( api_version = '', kind = '', - metadata = openapi_client.models.object_meta.ObjectMeta( + metadata = flightctl.models.object_meta.ObjectMeta( creation_timestamp = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), deletion_timestamp = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), name = '', @@ -144,11 +144,11 @@ def make_instance(self, include_optional) -> EnrollmentRequestList: 'key' : '' }, resource_version = '', ), - spec = openapi_client.models.enrollment_request_spec.EnrollmentRequestSpec( + spec = flightctl.models.enrollment_request_spec.EnrollmentRequestSpec( csr = '', - device_status = openapi_client.models.device_status.DeviceStatus( + device_status = flightctl.models.device_status.DeviceStatus( conditions = [ - openapi_client.models.condition.Condition( + flightctl.models.condition.Condition( type = 'Approved', status = 'True', observed_generation = 56, @@ -156,44 +156,44 @@ def make_instance(self, include_optional) -> EnrollmentRequestList: message = '', reason = '', ) ], - system_info = openapi_client.models.device_system_info.DeviceSystemInfo( + system_info = flightctl.models.device_system_info.DeviceSystemInfo( architecture = '', boot_id = '', operating_system = '', ), applications = [ - openapi_client.models.device_application_status.DeviceApplicationStatus( + flightctl.models.device_application_status.DeviceApplicationStatus( name = '', ready = '', restarts = 56, status = 'Preparing', ) ], - applications_summary = openapi_client.models.device_applications_summary_status.DeviceApplicationsSummaryStatus( + applications_summary = flightctl.models.device_applications_summary_status.DeviceApplicationsSummaryStatus( status = 'Healthy', info = '', ), - resources = openapi_client.models.device_resource_status.DeviceResourceStatus( + resources = flightctl.models.device_resource_status.DeviceResourceStatus( cpu = 'Healthy', memory = 'Healthy', disk = 'Healthy', ), - integrity = openapi_client.models.device_integrity_status.DeviceIntegrityStatus( - summary = openapi_client.models.device_integrity_status_summary.DeviceIntegrityStatusSummary( + integrity = flightctl.models.device_integrity_status.DeviceIntegrityStatus( + summary = flightctl.models.device_integrity_status_summary.DeviceIntegrityStatusSummary( status = 'Passed', info = '', ), ), - config = openapi_client.models.device_config_status.DeviceConfigStatus( + config = flightctl.models.device_config_status.DeviceConfigStatus( rendered_version = '', ), - os = openapi_client.models.device_os_status.DeviceOSStatus( + os = flightctl.models.device_os_status.DeviceOSStatus( image = '', image_digest = '', ), - updated = openapi_client.models.device_updated_status.DeviceUpdatedStatus( + updated = flightctl.models.device_updated_status.DeviceUpdatedStatus( status = 'UpToDate', info = '', ), - summary = openapi_client.models.device_summary_status.DeviceSummaryStatus( + summary = flightctl.models.device_summary_status.DeviceSummaryStatus( status = 'Online', info = '', ), last_seen = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), ), ), - status = openapi_client.models.enrollment_request_status.EnrollmentRequestStatus( + status = flightctl.models.enrollment_request_status.EnrollmentRequestStatus( certificate = '', conditions = [ - openapi_client.models.condition.Condition( + flightctl.models.condition.Condition( type = 'Approved', status = 'True', observed_generation = 56, @@ -201,7 +201,7 @@ def make_instance(self, include_optional) -> EnrollmentRequestList: message = '', reason = '', ) ], - approval = openapi_client.models.enrollment_request_approval.EnrollmentRequestApproval( + approval = flightctl.models.enrollment_request_approval.EnrollmentRequestApproval( approved = True, approved_by = '', approved_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), ), ), ) diff --git a/test/test_enrollment_request_spec.py b/test/test_enrollment_request_spec.py index 00bbb5c..608a672 100644 --- a/test/test_enrollment_request_spec.py +++ b/test/test_enrollment_request_spec.py @@ -14,7 +14,7 @@ import unittest -from openapi_client.models.enrollment_request_spec import EnrollmentRequestSpec +from flightctl.models.enrollment_request_spec import EnrollmentRequestSpec class TestEnrollmentRequestSpec(unittest.TestCase): """EnrollmentRequestSpec unit test stubs""" @@ -36,9 +36,9 @@ def make_instance(self, include_optional) -> EnrollmentRequestSpec: if include_optional: return EnrollmentRequestSpec( csr = '', - device_status = openapi_client.models.device_status.DeviceStatus( + device_status = flightctl.models.device_status.DeviceStatus( conditions = [ - openapi_client.models.condition.Condition( + flightctl.models.condition.Condition( type = 'Approved', status = 'True', observed_generation = 56, @@ -46,37 +46,37 @@ def make_instance(self, include_optional) -> EnrollmentRequestSpec: message = '', reason = '', ) ], - system_info = openapi_client.models.device_system_info.DeviceSystemInfo( + system_info = flightctl.models.device_system_info.DeviceSystemInfo( architecture = '', boot_id = '', operating_system = '', ), applications = [ - openapi_client.models.device_application_status.DeviceApplicationStatus( + flightctl.models.device_application_status.DeviceApplicationStatus( name = '', ready = '', restarts = 56, status = 'Preparing', ) ], - applications_summary = openapi_client.models.device_applications_summary_status.DeviceApplicationsSummaryStatus( + applications_summary = flightctl.models.device_applications_summary_status.DeviceApplicationsSummaryStatus( status = 'Healthy', info = '', ), - resources = openapi_client.models.device_resource_status.DeviceResourceStatus( + resources = flightctl.models.device_resource_status.DeviceResourceStatus( cpu = 'Healthy', memory = 'Healthy', disk = 'Healthy', ), - integrity = openapi_client.models.device_integrity_status.DeviceIntegrityStatus( - summary = openapi_client.models.device_integrity_status_summary.DeviceIntegrityStatusSummary( + integrity = flightctl.models.device_integrity_status.DeviceIntegrityStatus( + summary = flightctl.models.device_integrity_status_summary.DeviceIntegrityStatusSummary( status = 'Passed', info = '', ), ), - config = openapi_client.models.device_config_status.DeviceConfigStatus( + config = flightctl.models.device_config_status.DeviceConfigStatus( rendered_version = '', ), - os = openapi_client.models.device_os_status.DeviceOSStatus( + os = flightctl.models.device_os_status.DeviceOSStatus( image = '', image_digest = '', ), - updated = openapi_client.models.device_updated_status.DeviceUpdatedStatus( + updated = flightctl.models.device_updated_status.DeviceUpdatedStatus( status = 'UpToDate', info = '', ), - summary = openapi_client.models.device_summary_status.DeviceSummaryStatus( + summary = flightctl.models.device_summary_status.DeviceSummaryStatus( status = 'Online', info = '', ), last_seen = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), ), diff --git a/test/test_enrollment_request_status.py b/test/test_enrollment_request_status.py index 0260c61..58b6007 100644 --- a/test/test_enrollment_request_status.py +++ b/test/test_enrollment_request_status.py @@ -14,7 +14,7 @@ import unittest -from openapi_client.models.enrollment_request_status import EnrollmentRequestStatus +from flightctl.models.enrollment_request_status import EnrollmentRequestStatus class TestEnrollmentRequestStatus(unittest.TestCase): """EnrollmentRequestStatus unit test stubs""" @@ -37,7 +37,7 @@ def make_instance(self, include_optional) -> EnrollmentRequestStatus: return EnrollmentRequestStatus( certificate = '', conditions = [ - openapi_client.models.condition.Condition( + flightctl.models.condition.Condition( type = 'Approved', status = 'True', observed_generation = 56, @@ -45,7 +45,7 @@ def make_instance(self, include_optional) -> EnrollmentRequestStatus: message = '', reason = '', ) ], - approval = openapi_client.models.enrollment_request_approval.EnrollmentRequestApproval( + approval = flightctl.models.enrollment_request_approval.EnrollmentRequestApproval( labels = { 'key' : '' }, @@ -56,7 +56,7 @@ def make_instance(self, include_optional) -> EnrollmentRequestStatus: else: return EnrollmentRequestStatus( conditions = [ - openapi_client.models.condition.Condition( + flightctl.models.condition.Condition( type = 'Approved', status = 'True', observed_generation = 56, diff --git a/test/test_enrollment_service.py b/test/test_enrollment_service.py index 3aa85c9..ec2370f 100644 --- a/test/test_enrollment_service.py +++ b/test/test_enrollment_service.py @@ -14,7 +14,7 @@ import unittest -from openapi_client.models.enrollment_service import EnrollmentService +from flightctl.models.enrollment_service import EnrollmentService class TestEnrollmentService(unittest.TestCase): """EnrollmentService unit test stubs""" @@ -35,20 +35,20 @@ def make_instance(self, include_optional) -> EnrollmentService: model = EnrollmentService() if include_optional: return EnrollmentService( - authentication = openapi_client.models.enrollment_service_auth.EnrollmentServiceAuth( + authentication = flightctl.models.enrollment_service_auth.EnrollmentServiceAuth( client_certificate_data = '', client_key_data = '', ), - service = openapi_client.models.enrollment_service_service.EnrollmentServiceService( + service = flightctl.models.enrollment_service_service.EnrollmentServiceService( certificate_authority_data = '', server = '', ), enrollment_ui_endpoint = '' ) else: return EnrollmentService( - authentication = openapi_client.models.enrollment_service_auth.EnrollmentServiceAuth( + authentication = flightctl.models.enrollment_service_auth.EnrollmentServiceAuth( client_certificate_data = '', client_key_data = '', ), - service = openapi_client.models.enrollment_service_service.EnrollmentServiceService( + service = flightctl.models.enrollment_service_service.EnrollmentServiceService( certificate_authority_data = '', server = '', ), enrollment_ui_endpoint = '', diff --git a/test/test_enrollment_service_auth.py b/test/test_enrollment_service_auth.py index ceb81f9..3d09e90 100644 --- a/test/test_enrollment_service_auth.py +++ b/test/test_enrollment_service_auth.py @@ -14,7 +14,7 @@ import unittest -from openapi_client.models.enrollment_service_auth import EnrollmentServiceAuth +from flightctl.models.enrollment_service_auth import EnrollmentServiceAuth class TestEnrollmentServiceAuth(unittest.TestCase): """EnrollmentServiceAuth unit test stubs""" diff --git a/test/test_enrollment_service_service.py b/test/test_enrollment_service_service.py index aac3ade..a06a35f 100644 --- a/test/test_enrollment_service_service.py +++ b/test/test_enrollment_service_service.py @@ -14,7 +14,7 @@ import unittest -from openapi_client.models.enrollment_service_service import EnrollmentServiceService +from flightctl.models.enrollment_service_service import EnrollmentServiceService class TestEnrollmentServiceService(unittest.TestCase): """EnrollmentServiceService unit test stubs""" diff --git a/test/test_enrollmentconfig_api.py b/test/test_enrollmentconfig_api.py index 3f9ecb3..9863072 100644 --- a/test/test_enrollmentconfig_api.py +++ b/test/test_enrollmentconfig_api.py @@ -14,7 +14,7 @@ import unittest -from openapi_client.api.enrollmentconfig_api import EnrollmentconfigApi +from flightctl.api.enrollmentconfig_api import EnrollmentconfigApi class TestEnrollmentconfigApi(unittest.TestCase): diff --git a/test/test_enrollmentrequest_api.py b/test/test_enrollmentrequest_api.py index b10ecc1..7dd47c7 100644 --- a/test/test_enrollmentrequest_api.py +++ b/test/test_enrollmentrequest_api.py @@ -14,7 +14,7 @@ import unittest -from openapi_client.api.enrollmentrequest_api import EnrollmentrequestApi +from flightctl.api.enrollmentrequest_api import EnrollmentrequestApi class TestEnrollmentrequestApi(unittest.TestCase): diff --git a/test/test_error.py b/test/test_error.py index 5f9d0c1..f0aed9d 100644 --- a/test/test_error.py +++ b/test/test_error.py @@ -14,7 +14,7 @@ import unittest -from openapi_client.models.error import Error +from flightctl.models.error import Error class TestError(unittest.TestCase): """Error unit test stubs""" diff --git a/test/test_file_operation.py b/test/test_file_operation.py index 1a0ef7b..c5e6a83 100644 --- a/test/test_file_operation.py +++ b/test/test_file_operation.py @@ -14,7 +14,7 @@ import unittest -from openapi_client.models.file_operation import FileOperation +from flightctl.models.file_operation import FileOperation class TestFileOperation(unittest.TestCase): """FileOperation unit test stubs""" diff --git a/test/test_file_spec.py b/test/test_file_spec.py index 084bf47..cfa33b4 100644 --- a/test/test_file_spec.py +++ b/test/test_file_spec.py @@ -14,7 +14,7 @@ import unittest -from openapi_client.models.file_spec import FileSpec +from flightctl.models.file_spec import FileSpec class TestFileSpec(unittest.TestCase): """FileSpec unit test stubs""" diff --git a/test/test_fleet.py b/test/test_fleet.py index 828b7ec..e07bf77 100644 --- a/test/test_fleet.py +++ b/test/test_fleet.py @@ -14,7 +14,7 @@ import unittest -from openapi_client.models.fleet import Fleet +from flightctl.models.fleet import Fleet class TestFleet(unittest.TestCase): """Fleet unit test stubs""" @@ -37,7 +37,7 @@ def make_instance(self, include_optional) -> Fleet: return Fleet( api_version = '', kind = '', - metadata = openapi_client.models.object_meta.ObjectMeta( + metadata = flightctl.models.object_meta.ObjectMeta( creation_timestamp = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), deletion_timestamp = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), name = '', @@ -50,32 +50,32 @@ def make_instance(self, include_optional) -> Fleet: 'key' : '' }, resource_version = '', ), - spec = openapi_client.models.fleet_spec.FleetSpec( - selector = openapi_client.models.label_selector.LabelSelector( + spec = flightctl.models.fleet_spec.FleetSpec( + selector = flightctl.models.label_selector.LabelSelector( match_labels = { 'key' : '' }, match_expressions = [ - openapi_client.models.match_expression.MatchExpression( + flightctl.models.match_expression.MatchExpression( key = '', operator = 'In', values = [ '' ], ) ], ), - rollout_policy = openapi_client.models.rollout_policy.RolloutPolicy( - disruption_allowance = openapi_client.models.disruption_allowance.DisruptionAllowance( + rollout_policy = flightctl.models.rollout_policy.RolloutPolicy( + disruption_allowance = flightctl.models.disruption_allowance.DisruptionAllowance( group_by = [ '' ], min_available = 56, max_unavailable = 56, ), - device_selection = openapi_client.models.rollout_device_selection.RolloutDeviceSelection( + device_selection = flightctl.models.rollout_device_selection.RolloutDeviceSelection( strategy = '', ), success_threshold = '', default_update_timeout = '68072888001528021798096225500h', ), - template = openapi_client.models.fleet_spec_template.FleetSpec_template( - metadata = openapi_client.models.object_meta.ObjectMeta( + template = flightctl.models.fleet_spec_template.FleetSpec_template( + metadata = flightctl.models.object_meta.ObjectMeta( creation_timestamp = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), deletion_timestamp = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), name = '', @@ -88,19 +88,19 @@ def make_instance(self, include_optional) -> Fleet: 'key' : '' }, resource_version = '', ), - spec = openapi_client.models.device_spec.DeviceSpec( - os = openapi_client.models.device_os_spec.DeviceOSSpec( + spec = flightctl.models.device_spec.DeviceSpec( + os = flightctl.models.device_os_spec.DeviceOSSpec( image = '', ), config = [ null ], - hooks = openapi_client.models.device_hooks_spec.DeviceHooksSpec( + hooks = flightctl.models.device_hooks_spec.DeviceHooksSpec( before_updating = [ - openapi_client.models.device_update_hook_spec.DeviceUpdateHookSpec( + flightctl.models.device_update_hook_spec.DeviceUpdateHookSpec( name = '', description = '', actions = [ - openapi_client.models.hook_action.HookAction() + flightctl.models.hook_action.HookAction() ], on_file = [ 'Create' @@ -108,45 +108,45 @@ def make_instance(self, include_optional) -> Fleet: path = '', ) ], after_updating = [ - openapi_client.models.device_update_hook_spec.DeviceUpdateHookSpec( + flightctl.models.device_update_hook_spec.DeviceUpdateHookSpec( name = '', description = '', actions = [ - openapi_client.models.hook_action.HookAction() + flightctl.models.hook_action.HookAction() ], path = '', ) ], before_rebooting = [ - openapi_client.models.device_reboot_hook_spec.DeviceRebootHookSpec( + flightctl.models.device_reboot_hook_spec.DeviceRebootHookSpec( name = '', description = '', actions = [ - openapi_client.models.hook_action.HookAction() + flightctl.models.hook_action.HookAction() ], ) ], after_rebooting = [ - openapi_client.models.device_reboot_hook_spec.DeviceRebootHookSpec( + flightctl.models.device_reboot_hook_spec.DeviceRebootHookSpec( name = '', description = '', actions = [ - openapi_client.models.hook_action.HookAction() + flightctl.models.hook_action.HookAction() ], ) ], ), applications = [ - openapi_client.models.application_spec.ApplicationSpec() + flightctl.models.application_spec.ApplicationSpec() ], - systemd = openapi_client.models.device_spec_systemd.DeviceSpec_systemd( + systemd = flightctl.models.device_spec_systemd.DeviceSpec_systemd( match_patterns = [ 'ge34w9Wa*CLfoo\\yJX2gCb' ], ), resources = [ null ], ), ), ), - status = openapi_client.models.fleet_status.FleetStatus( - rollout = openapi_client.models.fleet_rollout_status.FleetRolloutStatus( + status = flightctl.models.fleet_status.FleetStatus( + rollout = flightctl.models.fleet_rollout_status.FleetRolloutStatus( current_batch = 56, ), conditions = [ - openapi_client.models.condition.Condition( + flightctl.models.condition.Condition( type = 'Approved', status = 'True', observed_generation = 56, @@ -154,7 +154,7 @@ def make_instance(self, include_optional) -> Fleet: message = '', reason = '', ) ], - devices_summary = openapi_client.models.devices_summary.DevicesSummary( + devices_summary = flightctl.models.devices_summary.DevicesSummary( total = 56, application_status = { 'key' : 56 @@ -170,7 +170,7 @@ def make_instance(self, include_optional) -> Fleet: return Fleet( api_version = '', kind = '', - metadata = openapi_client.models.object_meta.ObjectMeta( + metadata = flightctl.models.object_meta.ObjectMeta( creation_timestamp = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), deletion_timestamp = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), name = '', @@ -183,32 +183,32 @@ def make_instance(self, include_optional) -> Fleet: 'key' : '' }, resource_version = '', ), - spec = openapi_client.models.fleet_spec.FleetSpec( - selector = openapi_client.models.label_selector.LabelSelector( + spec = flightctl.models.fleet_spec.FleetSpec( + selector = flightctl.models.label_selector.LabelSelector( match_labels = { 'key' : '' }, match_expressions = [ - openapi_client.models.match_expression.MatchExpression( + flightctl.models.match_expression.MatchExpression( key = '', operator = 'In', values = [ '' ], ) ], ), - rollout_policy = openapi_client.models.rollout_policy.RolloutPolicy( - disruption_allowance = openapi_client.models.disruption_allowance.DisruptionAllowance( + rollout_policy = flightctl.models.rollout_policy.RolloutPolicy( + disruption_allowance = flightctl.models.disruption_allowance.DisruptionAllowance( group_by = [ '' ], min_available = 56, max_unavailable = 56, ), - device_selection = openapi_client.models.rollout_device_selection.RolloutDeviceSelection( + device_selection = flightctl.models.rollout_device_selection.RolloutDeviceSelection( strategy = '', ), success_threshold = '', default_update_timeout = '68072888001528021798096225500h', ), - template = openapi_client.models.fleet_spec_template.FleetSpec_template( - metadata = openapi_client.models.object_meta.ObjectMeta( + template = flightctl.models.fleet_spec_template.FleetSpec_template( + metadata = flightctl.models.object_meta.ObjectMeta( creation_timestamp = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), deletion_timestamp = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), name = '', @@ -221,19 +221,19 @@ def make_instance(self, include_optional) -> Fleet: 'key' : '' }, resource_version = '', ), - spec = openapi_client.models.device_spec.DeviceSpec( - os = openapi_client.models.device_os_spec.DeviceOSSpec( + spec = flightctl.models.device_spec.DeviceSpec( + os = flightctl.models.device_os_spec.DeviceOSSpec( image = '', ), config = [ null ], - hooks = openapi_client.models.device_hooks_spec.DeviceHooksSpec( + hooks = flightctl.models.device_hooks_spec.DeviceHooksSpec( before_updating = [ - openapi_client.models.device_update_hook_spec.DeviceUpdateHookSpec( + flightctl.models.device_update_hook_spec.DeviceUpdateHookSpec( name = '', description = '', actions = [ - openapi_client.models.hook_action.HookAction() + flightctl.models.hook_action.HookAction() ], on_file = [ 'Create' @@ -241,34 +241,34 @@ def make_instance(self, include_optional) -> Fleet: path = '', ) ], after_updating = [ - openapi_client.models.device_update_hook_spec.DeviceUpdateHookSpec( + flightctl.models.device_update_hook_spec.DeviceUpdateHookSpec( name = '', description = '', actions = [ - openapi_client.models.hook_action.HookAction() + flightctl.models.hook_action.HookAction() ], path = '', ) ], before_rebooting = [ - openapi_client.models.device_reboot_hook_spec.DeviceRebootHookSpec( + flightctl.models.device_reboot_hook_spec.DeviceRebootHookSpec( name = '', description = '', actions = [ - openapi_client.models.hook_action.HookAction() + flightctl.models.hook_action.HookAction() ], ) ], after_rebooting = [ - openapi_client.models.device_reboot_hook_spec.DeviceRebootHookSpec( + flightctl.models.device_reboot_hook_spec.DeviceRebootHookSpec( name = '', description = '', actions = [ - openapi_client.models.hook_action.HookAction() + flightctl.models.hook_action.HookAction() ], ) ], ), applications = [ - openapi_client.models.application_spec.ApplicationSpec() + flightctl.models.application_spec.ApplicationSpec() ], - systemd = openapi_client.models.device_spec_systemd.DeviceSpec_systemd( + systemd = flightctl.models.device_spec_systemd.DeviceSpec_systemd( match_patterns = [ 'ge34w9Wa*CLfoo\\yJX2gCb' ], ), diff --git a/test/test_fleet_api.py b/test/test_fleet_api.py index 13104d1..5e8b328 100644 --- a/test/test_fleet_api.py +++ b/test/test_fleet_api.py @@ -14,7 +14,7 @@ import unittest -from openapi_client.api.fleet_api import FleetApi +from flightctl.api.fleet_api import FleetApi class TestFleetApi(unittest.TestCase): diff --git a/test/test_fleet_list.py b/test/test_fleet_list.py index a4ea2f4..d033ba9 100644 --- a/test/test_fleet_list.py +++ b/test/test_fleet_list.py @@ -14,7 +14,7 @@ import unittest -from openapi_client.models.fleet_list import FleetList +from flightctl.models.fleet_list import FleetList class TestFleetList(unittest.TestCase): """FleetList unit test stubs""" @@ -37,14 +37,14 @@ def make_instance(self, include_optional) -> FleetList: return FleetList( api_version = '', kind = '', - metadata = openapi_client.models.list_meta.ListMeta( + metadata = flightctl.models.list_meta.ListMeta( continue = '', remaining_item_count = 56, ), items = [ - openapi_client.models.fleet.Fleet( + flightctl.models.fleet.Fleet( api_version = '', kind = '', - metadata = openapi_client.models.object_meta.ObjectMeta( + metadata = flightctl.models.object_meta.ObjectMeta( creation_timestamp = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), deletion_timestamp = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), name = '', @@ -57,44 +57,44 @@ def make_instance(self, include_optional) -> FleetList: 'key' : '' }, resource_version = '', ), - spec = openapi_client.models.fleet_spec.FleetSpec( - selector = openapi_client.models.label_selector.LabelSelector( + spec = flightctl.models.fleet_spec.FleetSpec( + selector = flightctl.models.label_selector.LabelSelector( match_labels = { 'key' : '' }, match_expressions = [ - openapi_client.models.match_expression.MatchExpression( + flightctl.models.match_expression.MatchExpression( key = '', operator = 'In', values = [ '' ], ) ], ), - rollout_policy = openapi_client.models.rollout_policy.RolloutPolicy( - disruption_allowance = openapi_client.models.disruption_allowance.DisruptionAllowance( + rollout_policy = flightctl.models.rollout_policy.RolloutPolicy( + disruption_allowance = flightctl.models.disruption_allowance.DisruptionAllowance( group_by = [ '' ], min_available = 56, max_unavailable = 56, ), - device_selection = openapi_client.models.rollout_device_selection.RolloutDeviceSelection( + device_selection = flightctl.models.rollout_device_selection.RolloutDeviceSelection( strategy = '', ), success_threshold = '', default_update_timeout = '68072888001528021798096225500h', ), - template = openapi_client.models.fleet_spec_template.FleetSpec_template( - spec = openapi_client.models.device_spec.DeviceSpec( - os = openapi_client.models.device_os_spec.DeviceOSSpec( + template = flightctl.models.fleet_spec_template.FleetSpec_template( + spec = flightctl.models.device_spec.DeviceSpec( + os = flightctl.models.device_os_spec.DeviceOSSpec( image = '', ), config = [ null ], - hooks = openapi_client.models.device_hooks_spec.DeviceHooksSpec( + hooks = flightctl.models.device_hooks_spec.DeviceHooksSpec( before_updating = [ - openapi_client.models.device_update_hook_spec.DeviceUpdateHookSpec( + flightctl.models.device_update_hook_spec.DeviceUpdateHookSpec( name = '', description = '', actions = [ - openapi_client.models.hook_action.HookAction() + flightctl.models.hook_action.HookAction() ], on_file = [ 'Create' @@ -102,45 +102,45 @@ def make_instance(self, include_optional) -> FleetList: path = '', ) ], after_updating = [ - openapi_client.models.device_update_hook_spec.DeviceUpdateHookSpec( + flightctl.models.device_update_hook_spec.DeviceUpdateHookSpec( name = '', description = '', actions = [ - openapi_client.models.hook_action.HookAction() + flightctl.models.hook_action.HookAction() ], path = '', ) ], before_rebooting = [ - openapi_client.models.device_reboot_hook_spec.DeviceRebootHookSpec( + flightctl.models.device_reboot_hook_spec.DeviceRebootHookSpec( name = '', description = '', actions = [ - openapi_client.models.hook_action.HookAction() + flightctl.models.hook_action.HookAction() ], ) ], after_rebooting = [ - openapi_client.models.device_reboot_hook_spec.DeviceRebootHookSpec( + flightctl.models.device_reboot_hook_spec.DeviceRebootHookSpec( name = '', description = '', actions = [ - openapi_client.models.hook_action.HookAction() + flightctl.models.hook_action.HookAction() ], ) ], ), applications = [ - openapi_client.models.application_spec.ApplicationSpec() + flightctl.models.application_spec.ApplicationSpec() ], - systemd = openapi_client.models.device_spec_systemd.DeviceSpec_systemd( + systemd = flightctl.models.device_spec_systemd.DeviceSpec_systemd( match_patterns = [ 'ge34w9Wa*CLfoo\\yJX2gCb' ], ), resources = [ null ], ), ), ), - status = openapi_client.models.fleet_status.FleetStatus( - rollout = openapi_client.models.fleet_rollout_status.FleetRolloutStatus( + status = flightctl.models.fleet_status.FleetStatus( + rollout = flightctl.models.fleet_rollout_status.FleetRolloutStatus( current_batch = 56, ), conditions = [ - openapi_client.models.condition.Condition( + flightctl.models.condition.Condition( type = 'Approved', status = 'True', observed_generation = 56, @@ -148,7 +148,7 @@ def make_instance(self, include_optional) -> FleetList: message = '', reason = '', ) ], - devices_summary = openapi_client.models.devices_summary.DevicesSummary( + devices_summary = flightctl.models.devices_summary.DevicesSummary( total = 56, application_status = { 'key' : 56 @@ -165,14 +165,14 @@ def make_instance(self, include_optional) -> FleetList: return FleetList( api_version = '', kind = '', - metadata = openapi_client.models.list_meta.ListMeta( + metadata = flightctl.models.list_meta.ListMeta( continue = '', remaining_item_count = 56, ), items = [ - openapi_client.models.fleet.Fleet( + flightctl.models.fleet.Fleet( api_version = '', kind = '', - metadata = openapi_client.models.object_meta.ObjectMeta( + metadata = flightctl.models.object_meta.ObjectMeta( creation_timestamp = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), deletion_timestamp = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), name = '', @@ -185,44 +185,44 @@ def make_instance(self, include_optional) -> FleetList: 'key' : '' }, resource_version = '', ), - spec = openapi_client.models.fleet_spec.FleetSpec( - selector = openapi_client.models.label_selector.LabelSelector( + spec = flightctl.models.fleet_spec.FleetSpec( + selector = flightctl.models.label_selector.LabelSelector( match_labels = { 'key' : '' }, match_expressions = [ - openapi_client.models.match_expression.MatchExpression( + flightctl.models.match_expression.MatchExpression( key = '', operator = 'In', values = [ '' ], ) ], ), - rollout_policy = openapi_client.models.rollout_policy.RolloutPolicy( - disruption_allowance = openapi_client.models.disruption_allowance.DisruptionAllowance( + rollout_policy = flightctl.models.rollout_policy.RolloutPolicy( + disruption_allowance = flightctl.models.disruption_allowance.DisruptionAllowance( group_by = [ '' ], min_available = 56, max_unavailable = 56, ), - device_selection = openapi_client.models.rollout_device_selection.RolloutDeviceSelection( + device_selection = flightctl.models.rollout_device_selection.RolloutDeviceSelection( strategy = '', ), success_threshold = '', default_update_timeout = '68072888001528021798096225500h', ), - template = openapi_client.models.fleet_spec_template.FleetSpec_template( - spec = openapi_client.models.device_spec.DeviceSpec( - os = openapi_client.models.device_os_spec.DeviceOSSpec( + template = flightctl.models.fleet_spec_template.FleetSpec_template( + spec = flightctl.models.device_spec.DeviceSpec( + os = flightctl.models.device_os_spec.DeviceOSSpec( image = '', ), config = [ null ], - hooks = openapi_client.models.device_hooks_spec.DeviceHooksSpec( + hooks = flightctl.models.device_hooks_spec.DeviceHooksSpec( before_updating = [ - openapi_client.models.device_update_hook_spec.DeviceUpdateHookSpec( + flightctl.models.device_update_hook_spec.DeviceUpdateHookSpec( name = '', description = '', actions = [ - openapi_client.models.hook_action.HookAction() + flightctl.models.hook_action.HookAction() ], on_file = [ 'Create' @@ -230,45 +230,45 @@ def make_instance(self, include_optional) -> FleetList: path = '', ) ], after_updating = [ - openapi_client.models.device_update_hook_spec.DeviceUpdateHookSpec( + flightctl.models.device_update_hook_spec.DeviceUpdateHookSpec( name = '', description = '', actions = [ - openapi_client.models.hook_action.HookAction() + flightctl.models.hook_action.HookAction() ], path = '', ) ], before_rebooting = [ - openapi_client.models.device_reboot_hook_spec.DeviceRebootHookSpec( + flightctl.models.device_reboot_hook_spec.DeviceRebootHookSpec( name = '', description = '', actions = [ - openapi_client.models.hook_action.HookAction() + flightctl.models.hook_action.HookAction() ], ) ], after_rebooting = [ - openapi_client.models.device_reboot_hook_spec.DeviceRebootHookSpec( + flightctl.models.device_reboot_hook_spec.DeviceRebootHookSpec( name = '', description = '', actions = [ - openapi_client.models.hook_action.HookAction() + flightctl.models.hook_action.HookAction() ], ) ], ), applications = [ - openapi_client.models.application_spec.ApplicationSpec() + flightctl.models.application_spec.ApplicationSpec() ], - systemd = openapi_client.models.device_spec_systemd.DeviceSpec_systemd( + systemd = flightctl.models.device_spec_systemd.DeviceSpec_systemd( match_patterns = [ 'ge34w9Wa*CLfoo\\yJX2gCb' ], ), resources = [ null ], ), ), ), - status = openapi_client.models.fleet_status.FleetStatus( - rollout = openapi_client.models.fleet_rollout_status.FleetRolloutStatus( + status = flightctl.models.fleet_status.FleetStatus( + rollout = flightctl.models.fleet_rollout_status.FleetRolloutStatus( current_batch = 56, ), conditions = [ - openapi_client.models.condition.Condition( + flightctl.models.condition.Condition( type = 'Approved', status = 'True', observed_generation = 56, @@ -276,7 +276,7 @@ def make_instance(self, include_optional) -> FleetList: message = '', reason = '', ) ], - devices_summary = openapi_client.models.devices_summary.DevicesSummary( + devices_summary = flightctl.models.devices_summary.DevicesSummary( total = 56, application_status = { 'key' : 56 diff --git a/test/test_fleet_rollout_status.py b/test/test_fleet_rollout_status.py index 1a8d8cf..7c4f001 100644 --- a/test/test_fleet_rollout_status.py +++ b/test/test_fleet_rollout_status.py @@ -14,7 +14,7 @@ import unittest -from openapi_client.models.fleet_rollout_status import FleetRolloutStatus +from flightctl.models.fleet_rollout_status import FleetRolloutStatus class TestFleetRolloutStatus(unittest.TestCase): """FleetRolloutStatus unit test stubs""" diff --git a/test/test_fleet_spec.py b/test/test_fleet_spec.py index edac905..5c7736d 100644 --- a/test/test_fleet_spec.py +++ b/test/test_fleet_spec.py @@ -14,7 +14,7 @@ import unittest -from openapi_client.models.fleet_spec import FleetSpec +from flightctl.models.fleet_spec import FleetSpec class TestFleetSpec(unittest.TestCase): """FleetSpec unit test stubs""" @@ -35,31 +35,31 @@ def make_instance(self, include_optional) -> FleetSpec: model = FleetSpec() if include_optional: return FleetSpec( - selector = openapi_client.models.label_selector.LabelSelector( + selector = flightctl.models.label_selector.LabelSelector( match_labels = { 'key' : '' }, match_expressions = [ - openapi_client.models.match_expression.MatchExpression( + flightctl.models.match_expression.MatchExpression( key = '', operator = 'In', values = [ '' ], ) ], ), - rollout_policy = openapi_client.models.rollout_policy.RolloutPolicy( - disruption_allowance = openapi_client.models.disruption_allowance.DisruptionAllowance( + rollout_policy = flightctl.models.rollout_policy.RolloutPolicy( + disruption_allowance = flightctl.models.disruption_allowance.DisruptionAllowance( group_by = [ '' ], min_available = 56, max_unavailable = 56, ), - device_selection = openapi_client.models.rollout_device_selection.RolloutDeviceSelection( + device_selection = flightctl.models.rollout_device_selection.RolloutDeviceSelection( strategy = '', ), success_threshold = '', default_update_timeout = '68072888001528021798096225500h', ), - template = openapi_client.models.fleet_spec_template.FleetSpec_template( - metadata = openapi_client.models.object_meta.ObjectMeta( + template = flightctl.models.fleet_spec_template.FleetSpec_template( + metadata = flightctl.models.object_meta.ObjectMeta( creation_timestamp = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), deletion_timestamp = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), name = '', @@ -72,19 +72,19 @@ def make_instance(self, include_optional) -> FleetSpec: 'key' : '' }, resource_version = '', ), - spec = openapi_client.models.device_spec.DeviceSpec( - os = openapi_client.models.device_os_spec.DeviceOSSpec( + spec = flightctl.models.device_spec.DeviceSpec( + os = flightctl.models.device_os_spec.DeviceOSSpec( image = '', ), config = [ null ], - hooks = openapi_client.models.device_hooks_spec.DeviceHooksSpec( + hooks = flightctl.models.device_hooks_spec.DeviceHooksSpec( before_updating = [ - openapi_client.models.device_update_hook_spec.DeviceUpdateHookSpec( + flightctl.models.device_update_hook_spec.DeviceUpdateHookSpec( name = '', description = '', actions = [ - openapi_client.models.hook_action.HookAction() + flightctl.models.hook_action.HookAction() ], on_file = [ 'Create' @@ -92,34 +92,34 @@ def make_instance(self, include_optional) -> FleetSpec: path = '', ) ], after_updating = [ - openapi_client.models.device_update_hook_spec.DeviceUpdateHookSpec( + flightctl.models.device_update_hook_spec.DeviceUpdateHookSpec( name = '', description = '', actions = [ - openapi_client.models.hook_action.HookAction() + flightctl.models.hook_action.HookAction() ], path = '', ) ], before_rebooting = [ - openapi_client.models.device_reboot_hook_spec.DeviceRebootHookSpec( + flightctl.models.device_reboot_hook_spec.DeviceRebootHookSpec( name = '', description = '', actions = [ - openapi_client.models.hook_action.HookAction() + flightctl.models.hook_action.HookAction() ], ) ], after_rebooting = [ - openapi_client.models.device_reboot_hook_spec.DeviceRebootHookSpec( + flightctl.models.device_reboot_hook_spec.DeviceRebootHookSpec( name = '', description = '', actions = [ - openapi_client.models.hook_action.HookAction() + flightctl.models.hook_action.HookAction() ], ) ], ), applications = [ - openapi_client.models.application_spec.ApplicationSpec() + flightctl.models.application_spec.ApplicationSpec() ], - systemd = openapi_client.models.device_spec_systemd.DeviceSpec_systemd( + systemd = flightctl.models.device_spec_systemd.DeviceSpec_systemd( match_patterns = [ 'ge34w9Wa*CLfoo\\yJX2gCb' ], ), @@ -129,8 +129,8 @@ def make_instance(self, include_optional) -> FleetSpec: ) else: return FleetSpec( - template = openapi_client.models.fleet_spec_template.FleetSpec_template( - metadata = openapi_client.models.object_meta.ObjectMeta( + template = flightctl.models.fleet_spec_template.FleetSpec_template( + metadata = flightctl.models.object_meta.ObjectMeta( creation_timestamp = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), deletion_timestamp = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), name = '', @@ -143,19 +143,19 @@ def make_instance(self, include_optional) -> FleetSpec: 'key' : '' }, resource_version = '', ), - spec = openapi_client.models.device_spec.DeviceSpec( - os = openapi_client.models.device_os_spec.DeviceOSSpec( + spec = flightctl.models.device_spec.DeviceSpec( + os = flightctl.models.device_os_spec.DeviceOSSpec( image = '', ), config = [ null ], - hooks = openapi_client.models.device_hooks_spec.DeviceHooksSpec( + hooks = flightctl.models.device_hooks_spec.DeviceHooksSpec( before_updating = [ - openapi_client.models.device_update_hook_spec.DeviceUpdateHookSpec( + flightctl.models.device_update_hook_spec.DeviceUpdateHookSpec( name = '', description = '', actions = [ - openapi_client.models.hook_action.HookAction() + flightctl.models.hook_action.HookAction() ], on_file = [ 'Create' @@ -163,34 +163,34 @@ def make_instance(self, include_optional) -> FleetSpec: path = '', ) ], after_updating = [ - openapi_client.models.device_update_hook_spec.DeviceUpdateHookSpec( + flightctl.models.device_update_hook_spec.DeviceUpdateHookSpec( name = '', description = '', actions = [ - openapi_client.models.hook_action.HookAction() + flightctl.models.hook_action.HookAction() ], path = '', ) ], before_rebooting = [ - openapi_client.models.device_reboot_hook_spec.DeviceRebootHookSpec( + flightctl.models.device_reboot_hook_spec.DeviceRebootHookSpec( name = '', description = '', actions = [ - openapi_client.models.hook_action.HookAction() + flightctl.models.hook_action.HookAction() ], ) ], after_rebooting = [ - openapi_client.models.device_reboot_hook_spec.DeviceRebootHookSpec( + flightctl.models.device_reboot_hook_spec.DeviceRebootHookSpec( name = '', description = '', actions = [ - openapi_client.models.hook_action.HookAction() + flightctl.models.hook_action.HookAction() ], ) ], ), applications = [ - openapi_client.models.application_spec.ApplicationSpec() + flightctl.models.application_spec.ApplicationSpec() ], - systemd = openapi_client.models.device_spec_systemd.DeviceSpec_systemd( + systemd = flightctl.models.device_spec_systemd.DeviceSpec_systemd( match_patterns = [ 'ge34w9Wa*CLfoo\\yJX2gCb' ], ), diff --git a/test/test_fleet_spec_template.py b/test/test_fleet_spec_template.py index 4c3b43e..e28c237 100644 --- a/test/test_fleet_spec_template.py +++ b/test/test_fleet_spec_template.py @@ -14,7 +14,7 @@ import unittest -from openapi_client.models.fleet_spec_template import FleetSpecTemplate +from flightctl.models.fleet_spec_template import FleetSpecTemplate class TestFleetSpecTemplate(unittest.TestCase): """FleetSpecTemplate unit test stubs""" @@ -35,7 +35,7 @@ def make_instance(self, include_optional) -> FleetSpecTemplate: model = FleetSpecTemplate() if include_optional: return FleetSpecTemplate( - metadata = openapi_client.models.object_meta.ObjectMeta( + metadata = flightctl.models.object_meta.ObjectMeta( creation_timestamp = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), deletion_timestamp = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), name = '', @@ -48,19 +48,19 @@ def make_instance(self, include_optional) -> FleetSpecTemplate: 'key' : '' }, resource_version = '', ), - spec = openapi_client.models.device_spec.DeviceSpec( - os = openapi_client.models.device_os_spec.DeviceOSSpec( + spec = flightctl.models.device_spec.DeviceSpec( + os = flightctl.models.device_os_spec.DeviceOSSpec( image = '', ), config = [ null ], - hooks = openapi_client.models.device_hooks_spec.DeviceHooksSpec( + hooks = flightctl.models.device_hooks_spec.DeviceHooksSpec( before_updating = [ - openapi_client.models.device_update_hook_spec.DeviceUpdateHookSpec( + flightctl.models.device_update_hook_spec.DeviceUpdateHookSpec( name = '', description = '', actions = [ - openapi_client.models.hook_action.HookAction() + flightctl.models.hook_action.HookAction() ], on_file = [ 'Create' @@ -68,34 +68,34 @@ def make_instance(self, include_optional) -> FleetSpecTemplate: path = '', ) ], after_updating = [ - openapi_client.models.device_update_hook_spec.DeviceUpdateHookSpec( + flightctl.models.device_update_hook_spec.DeviceUpdateHookSpec( name = '', description = '', actions = [ - openapi_client.models.hook_action.HookAction() + flightctl.models.hook_action.HookAction() ], path = '', ) ], before_rebooting = [ - openapi_client.models.device_reboot_hook_spec.DeviceRebootHookSpec( + flightctl.models.device_reboot_hook_spec.DeviceRebootHookSpec( name = '', description = '', actions = [ - openapi_client.models.hook_action.HookAction() + flightctl.models.hook_action.HookAction() ], ) ], after_rebooting = [ - openapi_client.models.device_reboot_hook_spec.DeviceRebootHookSpec( + flightctl.models.device_reboot_hook_spec.DeviceRebootHookSpec( name = '', description = '', actions = [ - openapi_client.models.hook_action.HookAction() + flightctl.models.hook_action.HookAction() ], ) ], ), applications = [ - openapi_client.models.application_spec.ApplicationSpec() + flightctl.models.application_spec.ApplicationSpec() ], - systemd = openapi_client.models.device_spec_systemd.DeviceSpec_systemd( + systemd = flightctl.models.device_spec_systemd.DeviceSpec_systemd( match_patterns = [ 'ge34w9Wa*CLfoo\\yJX2gCb' ], ), @@ -105,19 +105,19 @@ def make_instance(self, include_optional) -> FleetSpecTemplate: ) else: return FleetSpecTemplate( - spec = openapi_client.models.device_spec.DeviceSpec( - os = openapi_client.models.device_os_spec.DeviceOSSpec( + spec = flightctl.models.device_spec.DeviceSpec( + os = flightctl.models.device_os_spec.DeviceOSSpec( image = '', ), config = [ null ], - hooks = openapi_client.models.device_hooks_spec.DeviceHooksSpec( + hooks = flightctl.models.device_hooks_spec.DeviceHooksSpec( before_updating = [ - openapi_client.models.device_update_hook_spec.DeviceUpdateHookSpec( + flightctl.models.device_update_hook_spec.DeviceUpdateHookSpec( name = '', description = '', actions = [ - openapi_client.models.hook_action.HookAction() + flightctl.models.hook_action.HookAction() ], on_file = [ 'Create' @@ -125,34 +125,34 @@ def make_instance(self, include_optional) -> FleetSpecTemplate: path = '', ) ], after_updating = [ - openapi_client.models.device_update_hook_spec.DeviceUpdateHookSpec( + flightctl.models.device_update_hook_spec.DeviceUpdateHookSpec( name = '', description = '', actions = [ - openapi_client.models.hook_action.HookAction() + flightctl.models.hook_action.HookAction() ], path = '', ) ], before_rebooting = [ - openapi_client.models.device_reboot_hook_spec.DeviceRebootHookSpec( + flightctl.models.device_reboot_hook_spec.DeviceRebootHookSpec( name = '', description = '', actions = [ - openapi_client.models.hook_action.HookAction() + flightctl.models.hook_action.HookAction() ], ) ], after_rebooting = [ - openapi_client.models.device_reboot_hook_spec.DeviceRebootHookSpec( + flightctl.models.device_reboot_hook_spec.DeviceRebootHookSpec( name = '', description = '', actions = [ - openapi_client.models.hook_action.HookAction() + flightctl.models.hook_action.HookAction() ], ) ], ), applications = [ - openapi_client.models.application_spec.ApplicationSpec() + flightctl.models.application_spec.ApplicationSpec() ], - systemd = openapi_client.models.device_spec_systemd.DeviceSpec_systemd( + systemd = flightctl.models.device_spec_systemd.DeviceSpec_systemd( match_patterns = [ 'ge34w9Wa*CLfoo\\yJX2gCb' ], ), diff --git a/test/test_fleet_status.py b/test/test_fleet_status.py index 99f91ac..164d75f 100644 --- a/test/test_fleet_status.py +++ b/test/test_fleet_status.py @@ -14,7 +14,7 @@ import unittest -from openapi_client.models.fleet_status import FleetStatus +from flightctl.models.fleet_status import FleetStatus class TestFleetStatus(unittest.TestCase): """FleetStatus unit test stubs""" @@ -35,10 +35,10 @@ def make_instance(self, include_optional) -> FleetStatus: model = FleetStatus() if include_optional: return FleetStatus( - rollout = openapi_client.models.fleet_rollout_status.FleetRolloutStatus( + rollout = flightctl.models.fleet_rollout_status.FleetRolloutStatus( current_batch = 56, ), conditions = [ - openapi_client.models.condition.Condition( + flightctl.models.condition.Condition( type = 'Approved', status = 'True', observed_generation = 56, @@ -46,7 +46,7 @@ def make_instance(self, include_optional) -> FleetStatus: message = '', reason = '', ) ], - devices_summary = openapi_client.models.devices_summary.DevicesSummary( + devices_summary = flightctl.models.devices_summary.DevicesSummary( total = 56, application_status = { 'key' : 56 @@ -61,7 +61,7 @@ def make_instance(self, include_optional) -> FleetStatus: else: return FleetStatus( conditions = [ - openapi_client.models.condition.Condition( + flightctl.models.condition.Condition( type = 'Approved', status = 'True', observed_generation = 56, diff --git a/test/test_generic_repo_spec.py b/test/test_generic_repo_spec.py index bd041f7..fe39824 100644 --- a/test/test_generic_repo_spec.py +++ b/test/test_generic_repo_spec.py @@ -14,7 +14,7 @@ import unittest -from openapi_client.models.generic_repo_spec import GenericRepoSpec +from flightctl.models.generic_repo_spec import GenericRepoSpec class TestGenericRepoSpec(unittest.TestCase): """GenericRepoSpec unit test stubs""" diff --git a/test/test_git_config_provider_spec.py b/test/test_git_config_provider_spec.py index b94ec37..61f59d8 100644 --- a/test/test_git_config_provider_spec.py +++ b/test/test_git_config_provider_spec.py @@ -14,7 +14,7 @@ import unittest -from openapi_client.models.git_config_provider_spec import GitConfigProviderSpec +from flightctl.models.git_config_provider_spec import GitConfigProviderSpec class TestGitConfigProviderSpec(unittest.TestCase): """GitConfigProviderSpec unit test stubs""" @@ -36,7 +36,7 @@ def make_instance(self, include_optional) -> GitConfigProviderSpec: if include_optional: return GitConfigProviderSpec( name = '', - git_ref = openapi_client.models.git_config_provider_spec_git_ref.GitConfigProviderSpec_gitRef( + git_ref = flightctl.models.git_config_provider_spec_git_ref.GitConfigProviderSpec_gitRef( repository = '', target_revision = '', path = '', @@ -45,7 +45,7 @@ def make_instance(self, include_optional) -> GitConfigProviderSpec: else: return GitConfigProviderSpec( name = '', - git_ref = openapi_client.models.git_config_provider_spec_git_ref.GitConfigProviderSpec_gitRef( + git_ref = flightctl.models.git_config_provider_spec_git_ref.GitConfigProviderSpec_gitRef( repository = '', target_revision = '', path = '', diff --git a/test/test_git_config_provider_spec_git_ref.py b/test/test_git_config_provider_spec_git_ref.py index 7e86359..2c2ec79 100644 --- a/test/test_git_config_provider_spec_git_ref.py +++ b/test/test_git_config_provider_spec_git_ref.py @@ -14,7 +14,7 @@ import unittest -from openapi_client.models.git_config_provider_spec_git_ref import GitConfigProviderSpecGitRef +from flightctl.models.git_config_provider_spec_git_ref import GitConfigProviderSpecGitRef class TestGitConfigProviderSpecGitRef(unittest.TestCase): """GitConfigProviderSpecGitRef unit test stubs""" diff --git a/test/test_hook_action.py b/test/test_hook_action.py index 00494be..455e00e 100644 --- a/test/test_hook_action.py +++ b/test/test_hook_action.py @@ -14,7 +14,7 @@ import unittest -from openapi_client.models.hook_action import HookAction +from flightctl.models.hook_action import HookAction class TestHookAction(unittest.TestCase): """HookAction unit test stubs""" diff --git a/test/test_hook_action_executable.py b/test/test_hook_action_executable.py index e9b100c..b723fd2 100644 --- a/test/test_hook_action_executable.py +++ b/test/test_hook_action_executable.py @@ -14,7 +14,7 @@ import unittest -from openapi_client.models.hook_action_executable import HookActionExecutable +from flightctl.models.hook_action_executable import HookActionExecutable class TestHookActionExecutable(unittest.TestCase): """HookActionExecutable unit test stubs""" diff --git a/test/test_hook_action_executable_spec.py b/test/test_hook_action_executable_spec.py index 9a1856a..28a8792 100644 --- a/test/test_hook_action_executable_spec.py +++ b/test/test_hook_action_executable_spec.py @@ -14,7 +14,7 @@ import unittest -from openapi_client.models.hook_action_executable_spec import HookActionExecutableSpec +from flightctl.models.hook_action_executable_spec import HookActionExecutableSpec class TestHookActionExecutableSpec(unittest.TestCase): """HookActionExecutableSpec unit test stubs""" diff --git a/test/test_hook_action_one_of.py b/test/test_hook_action_one_of.py index a8edfc3..2d29a78 100644 --- a/test/test_hook_action_one_of.py +++ b/test/test_hook_action_one_of.py @@ -14,7 +14,7 @@ import unittest -from openapi_client.models.hook_action_one_of import HookActionOneOf +from flightctl.models.hook_action_one_of import HookActionOneOf class TestHookActionOneOf(unittest.TestCase): """HookActionOneOf unit test stubs""" diff --git a/test/test_hook_action_one_of1.py b/test/test_hook_action_one_of1.py index fade96f..ae2c4f7 100644 --- a/test/test_hook_action_one_of1.py +++ b/test/test_hook_action_one_of1.py @@ -14,7 +14,7 @@ import unittest -from openapi_client.models.hook_action_one_of1 import HookActionOneOf1 +from flightctl.models.hook_action_one_of1 import HookActionOneOf1 class TestHookActionOneOf1(unittest.TestCase): """HookActionOneOf1 unit test stubs""" diff --git a/test/test_hook_action_spec.py b/test/test_hook_action_spec.py index 89e9dea..8434b1e 100644 --- a/test/test_hook_action_spec.py +++ b/test/test_hook_action_spec.py @@ -14,7 +14,7 @@ import unittest -from openapi_client.models.hook_action_spec import HookActionSpec +from flightctl.models.hook_action_spec import HookActionSpec class TestHookActionSpec(unittest.TestCase): """HookActionSpec unit test stubs""" diff --git a/test/test_hook_action_systemd_spec.py b/test/test_hook_action_systemd_spec.py index fbfbc25..a7e44d9 100644 --- a/test/test_hook_action_systemd_spec.py +++ b/test/test_hook_action_systemd_spec.py @@ -14,7 +14,7 @@ import unittest -from openapi_client.models.hook_action_systemd_spec import HookActionSystemdSpec +from flightctl.models.hook_action_systemd_spec import HookActionSystemdSpec class TestHookActionSystemdSpec(unittest.TestCase): """HookActionSystemdSpec unit test stubs""" @@ -36,7 +36,7 @@ def make_instance(self, include_optional) -> HookActionSystemdSpec: if include_optional: return HookActionSystemdSpec( timeout = '68072888001528021798096225500h', - unit = openapi_client.models.hook_action_systemd_unit.HookActionSystemdUnit( + unit = flightctl.models.hook_action_systemd_unit.HookActionSystemdUnit( name = '', operations = [ 'Enable' @@ -45,7 +45,7 @@ def make_instance(self, include_optional) -> HookActionSystemdSpec: ) else: return HookActionSystemdSpec( - unit = openapi_client.models.hook_action_systemd_unit.HookActionSystemdUnit( + unit = flightctl.models.hook_action_systemd_unit.HookActionSystemdUnit( name = '', operations = [ 'Enable' diff --git a/test/test_hook_action_systemd_unit.py b/test/test_hook_action_systemd_unit.py index 3126aa4..392a5d9 100644 --- a/test/test_hook_action_systemd_unit.py +++ b/test/test_hook_action_systemd_unit.py @@ -14,7 +14,7 @@ import unittest -from openapi_client.models.hook_action_systemd_unit import HookActionSystemdUnit +from flightctl.models.hook_action_systemd_unit import HookActionSystemdUnit class TestHookActionSystemdUnit(unittest.TestCase): """HookActionSystemdUnit unit test stubs""" diff --git a/test/test_http_config.py b/test/test_http_config.py index bcb380c..82fbebb 100644 --- a/test/test_http_config.py +++ b/test/test_http_config.py @@ -14,7 +14,7 @@ import unittest -from openapi_client.models.http_config import HttpConfig +from flightctl.models.http_config import HttpConfig class TestHttpConfig(unittest.TestCase): """HttpConfig unit test stubs""" diff --git a/test/test_http_config_provider_spec.py b/test/test_http_config_provider_spec.py index 7aa2aad..f06fbd0 100644 --- a/test/test_http_config_provider_spec.py +++ b/test/test_http_config_provider_spec.py @@ -14,7 +14,7 @@ import unittest -from openapi_client.models.http_config_provider_spec import HttpConfigProviderSpec +from flightctl.models.http_config_provider_spec import HttpConfigProviderSpec class TestHttpConfigProviderSpec(unittest.TestCase): """HttpConfigProviderSpec unit test stubs""" @@ -36,7 +36,7 @@ def make_instance(self, include_optional) -> HttpConfigProviderSpec: if include_optional: return HttpConfigProviderSpec( name = '', - http_ref = openapi_client.models.http_config_provider_spec_http_ref.HttpConfigProviderSpec_httpRef( + http_ref = flightctl.models.http_config_provider_spec_http_ref.HttpConfigProviderSpec_httpRef( repository = '', suffix = '', file_path = '', ) @@ -44,7 +44,7 @@ def make_instance(self, include_optional) -> HttpConfigProviderSpec: else: return HttpConfigProviderSpec( name = '', - http_ref = openapi_client.models.http_config_provider_spec_http_ref.HttpConfigProviderSpec_httpRef( + http_ref = flightctl.models.http_config_provider_spec_http_ref.HttpConfigProviderSpec_httpRef( repository = '', suffix = '', file_path = '', ), diff --git a/test/test_http_config_provider_spec_http_ref.py b/test/test_http_config_provider_spec_http_ref.py index b399dc6..cd56f10 100644 --- a/test/test_http_config_provider_spec_http_ref.py +++ b/test/test_http_config_provider_spec_http_ref.py @@ -14,7 +14,7 @@ import unittest -from openapi_client.models.http_config_provider_spec_http_ref import HttpConfigProviderSpecHttpRef +from flightctl.models.http_config_provider_spec_http_ref import HttpConfigProviderSpecHttpRef class TestHttpConfigProviderSpecHttpRef(unittest.TestCase): """HttpConfigProviderSpecHttpRef unit test stubs""" diff --git a/test/test_http_repo_spec.py b/test/test_http_repo_spec.py index af862ae..87a5654 100644 --- a/test/test_http_repo_spec.py +++ b/test/test_http_repo_spec.py @@ -14,7 +14,7 @@ import unittest -from openapi_client.models.http_repo_spec import HttpRepoSpec +from flightctl.models.http_repo_spec import HttpRepoSpec class TestHttpRepoSpec(unittest.TestCase): """HttpRepoSpec unit test stubs""" @@ -37,7 +37,7 @@ def make_instance(self, include_optional) -> HttpRepoSpec: return HttpRepoSpec( url = '', type = 'git', - http_config = openapi_client.models.http_config.HttpConfig( + http_config = flightctl.models.http_config.HttpConfig( username = '', password = '', tls/crt = '', @@ -51,7 +51,7 @@ def make_instance(self, include_optional) -> HttpRepoSpec: return HttpRepoSpec( url = '', type = 'git', - http_config = openapi_client.models.http_config.HttpConfig( + http_config = flightctl.models.http_config.HttpConfig( username = '', password = '', tls/crt = '', diff --git a/test/test_image_application_provider.py b/test/test_image_application_provider.py index f01a731..a93c1e7 100644 --- a/test/test_image_application_provider.py +++ b/test/test_image_application_provider.py @@ -14,7 +14,7 @@ import unittest -from openapi_client.models.image_application_provider import ImageApplicationProvider +from flightctl.models.image_application_provider import ImageApplicationProvider class TestImageApplicationProvider(unittest.TestCase): """ImageApplicationProvider unit test stubs""" diff --git a/test/test_inline_config_provider_spec.py b/test/test_inline_config_provider_spec.py index 9ba6e0f..32ace94 100644 --- a/test/test_inline_config_provider_spec.py +++ b/test/test_inline_config_provider_spec.py @@ -14,7 +14,7 @@ import unittest -from openapi_client.models.inline_config_provider_spec import InlineConfigProviderSpec +from flightctl.models.inline_config_provider_spec import InlineConfigProviderSpec class TestInlineConfigProviderSpec(unittest.TestCase): """InlineConfigProviderSpec unit test stubs""" @@ -37,7 +37,7 @@ def make_instance(self, include_optional) -> InlineConfigProviderSpec: return InlineConfigProviderSpec( name = '', inline = [ - openapi_client.models.file_spec.FileSpec( + flightctl.models.file_spec.FileSpec( path = '', content = '', content_encoding = 'plain', @@ -50,7 +50,7 @@ def make_instance(self, include_optional) -> InlineConfigProviderSpec: return InlineConfigProviderSpec( name = '', inline = [ - openapi_client.models.file_spec.FileSpec( + flightctl.models.file_spec.FileSpec( path = '', content = '', content_encoding = 'plain', diff --git a/test/test_kubernetes_secret_provider_spec.py b/test/test_kubernetes_secret_provider_spec.py index daec0ea..2b43662 100644 --- a/test/test_kubernetes_secret_provider_spec.py +++ b/test/test_kubernetes_secret_provider_spec.py @@ -14,7 +14,7 @@ import unittest -from openapi_client.models.kubernetes_secret_provider_spec import KubernetesSecretProviderSpec +from flightctl.models.kubernetes_secret_provider_spec import KubernetesSecretProviderSpec class TestKubernetesSecretProviderSpec(unittest.TestCase): """KubernetesSecretProviderSpec unit test stubs""" @@ -36,7 +36,7 @@ def make_instance(self, include_optional) -> KubernetesSecretProviderSpec: if include_optional: return KubernetesSecretProviderSpec( name = '', - secret_ref = openapi_client.models.kubernetes_secret_provider_spec_secret_ref.KubernetesSecretProviderSpec_secretRef( + secret_ref = flightctl.models.kubernetes_secret_provider_spec_secret_ref.KubernetesSecretProviderSpec_secretRef( name = '', namespace = '', mount_path = '', ) @@ -44,7 +44,7 @@ def make_instance(self, include_optional) -> KubernetesSecretProviderSpec: else: return KubernetesSecretProviderSpec( name = '', - secret_ref = openapi_client.models.kubernetes_secret_provider_spec_secret_ref.KubernetesSecretProviderSpec_secretRef( + secret_ref = flightctl.models.kubernetes_secret_provider_spec_secret_ref.KubernetesSecretProviderSpec_secretRef( name = '', namespace = '', mount_path = '', ), diff --git a/test/test_kubernetes_secret_provider_spec_secret_ref.py b/test/test_kubernetes_secret_provider_spec_secret_ref.py index afd6845..85c1ac5 100644 --- a/test/test_kubernetes_secret_provider_spec_secret_ref.py +++ b/test/test_kubernetes_secret_provider_spec_secret_ref.py @@ -14,7 +14,7 @@ import unittest -from openapi_client.models.kubernetes_secret_provider_spec_secret_ref import KubernetesSecretProviderSpecSecretRef +from flightctl.models.kubernetes_secret_provider_spec_secret_ref import KubernetesSecretProviderSpecSecretRef class TestKubernetesSecretProviderSpecSecretRef(unittest.TestCase): """KubernetesSecretProviderSpecSecretRef unit test stubs""" diff --git a/test/test_label_selector.py b/test/test_label_selector.py index b7c76a4..37dfd0d 100644 --- a/test/test_label_selector.py +++ b/test/test_label_selector.py @@ -14,7 +14,7 @@ import unittest -from openapi_client.models.label_selector import LabelSelector +from flightctl.models.label_selector import LabelSelector class TestLabelSelector(unittest.TestCase): """LabelSelector unit test stubs""" @@ -39,7 +39,7 @@ def make_instance(self, include_optional) -> LabelSelector: 'key' : '' }, match_expressions = [ - openapi_client.models.match_expression.MatchExpression( + flightctl.models.match_expression.MatchExpression( key = '', operator = 'In', values = [ diff --git a/test/test_list_meta.py b/test/test_list_meta.py index a469287..aa4bca6 100644 --- a/test/test_list_meta.py +++ b/test/test_list_meta.py @@ -14,7 +14,7 @@ import unittest -from openapi_client.models.list_meta import ListMeta +from flightctl.models.list_meta import ListMeta class TestListMeta(unittest.TestCase): """ListMeta unit test stubs""" diff --git a/test/test_match_expression.py b/test/test_match_expression.py index 7626c93..a8f4737 100644 --- a/test/test_match_expression.py +++ b/test/test_match_expression.py @@ -14,7 +14,7 @@ import unittest -from openapi_client.models.match_expression import MatchExpression +from flightctl.models.match_expression import MatchExpression class TestMatchExpression(unittest.TestCase): """MatchExpression unit test stubs""" diff --git a/test/test_memory_resource_monitor_spec.py b/test/test_memory_resource_monitor_spec.py index 1e400a0..12fed4e 100644 --- a/test/test_memory_resource_monitor_spec.py +++ b/test/test_memory_resource_monitor_spec.py @@ -14,7 +14,7 @@ import unittest -from openapi_client.models.memory_resource_monitor_spec import MemoryResourceMonitorSpec +from flightctl.models.memory_resource_monitor_spec import MemoryResourceMonitorSpec class TestMemoryResourceMonitorSpec(unittest.TestCase): """MemoryResourceMonitorSpec unit test stubs""" @@ -37,7 +37,7 @@ def make_instance(self, include_optional) -> MemoryResourceMonitorSpec: return MemoryResourceMonitorSpec( monitor_type = '', alert_rules = [ - openapi_client.models.resource_alert_rule.ResourceAlertRule( + flightctl.models.resource_alert_rule.ResourceAlertRule( severity = 'Warning', duration = '4s', percentage = 1.337, @@ -49,7 +49,7 @@ def make_instance(self, include_optional) -> MemoryResourceMonitorSpec: return MemoryResourceMonitorSpec( monitor_type = '', alert_rules = [ - openapi_client.models.resource_alert_rule.ResourceAlertRule( + flightctl.models.resource_alert_rule.ResourceAlertRule( severity = 'Warning', duration = '4s', percentage = 1.337, diff --git a/test/test_object_meta.py b/test/test_object_meta.py index d2ac56d..a02d688 100644 --- a/test/test_object_meta.py +++ b/test/test_object_meta.py @@ -14,7 +14,7 @@ import unittest -from openapi_client.models.object_meta import ObjectMeta +from flightctl.models.object_meta import ObjectMeta class TestObjectMeta(unittest.TestCase): """ObjectMeta unit test stubs""" diff --git a/test/test_patch_request_inner.py b/test/test_patch_request_inner.py index fc96d2c..8324d07 100644 --- a/test/test_patch_request_inner.py +++ b/test/test_patch_request_inner.py @@ -14,7 +14,7 @@ import unittest -from openapi_client.models.patch_request_inner import PatchRequestInner +from flightctl.models.patch_request_inner import PatchRequestInner class TestPatchRequestInner(unittest.TestCase): """PatchRequestInner unit test stubs""" diff --git a/test/test_rendered_application_spec.py b/test/test_rendered_application_spec.py index 660c618..4aa4baf 100644 --- a/test/test_rendered_application_spec.py +++ b/test/test_rendered_application_spec.py @@ -14,7 +14,7 @@ import unittest -from openapi_client.models.rendered_application_spec import RenderedApplicationSpec +from flightctl.models.rendered_application_spec import RenderedApplicationSpec class TestRenderedApplicationSpec(unittest.TestCase): """RenderedApplicationSpec unit test stubs""" diff --git a/test/test_rendered_device_spec.py b/test/test_rendered_device_spec.py index ed82eb0..1ac62ae 100644 --- a/test/test_rendered_device_spec.py +++ b/test/test_rendered_device_spec.py @@ -14,7 +14,7 @@ import unittest -from openapi_client.models.rendered_device_spec import RenderedDeviceSpec +from flightctl.models.rendered_device_spec import RenderedDeviceSpec class TestRenderedDeviceSpec(unittest.TestCase): """RenderedDeviceSpec unit test stubs""" @@ -36,19 +36,19 @@ def make_instance(self, include_optional) -> RenderedDeviceSpec: if include_optional: return RenderedDeviceSpec( rendered_version = '', - os = openapi_client.models.device_os_spec.DeviceOSSpec( + os = flightctl.models.device_os_spec.DeviceOSSpec( image = '', ), config = '', applications = [ - openapi_client.models.rendered_application_spec.RenderedApplicationSpec() + flightctl.models.rendered_application_spec.RenderedApplicationSpec() ], - hooks = openapi_client.models.device_hooks_spec.DeviceHooksSpec( + hooks = flightctl.models.device_hooks_spec.DeviceHooksSpec( before_updating = [ - openapi_client.models.device_update_hook_spec.DeviceUpdateHookSpec( + flightctl.models.device_update_hook_spec.DeviceUpdateHookSpec( name = '', description = '', actions = [ - openapi_client.models.hook_action.HookAction() + flightctl.models.hook_action.HookAction() ], on_file = [ 'Create' @@ -56,38 +56,38 @@ def make_instance(self, include_optional) -> RenderedDeviceSpec: path = '', ) ], after_updating = [ - openapi_client.models.device_update_hook_spec.DeviceUpdateHookSpec( + flightctl.models.device_update_hook_spec.DeviceUpdateHookSpec( name = '', description = '', actions = [ - openapi_client.models.hook_action.HookAction() + flightctl.models.hook_action.HookAction() ], path = '', ) ], before_rebooting = [ - openapi_client.models.device_reboot_hook_spec.DeviceRebootHookSpec( + flightctl.models.device_reboot_hook_spec.DeviceRebootHookSpec( name = '', description = '', actions = [ - openapi_client.models.hook_action.HookAction() + flightctl.models.hook_action.HookAction() ], ) ], after_rebooting = [ - openapi_client.models.device_reboot_hook_spec.DeviceRebootHookSpec( + flightctl.models.device_reboot_hook_spec.DeviceRebootHookSpec( name = '', description = '', actions = [ - openapi_client.models.hook_action.HookAction() + flightctl.models.hook_action.HookAction() ], ) ], ), - systemd = openapi_client.models.rendered_device_spec_systemd.RenderedDeviceSpec_systemd( + systemd = flightctl.models.rendered_device_spec_systemd.RenderedDeviceSpec_systemd( match_patterns = [ '' ], ), resources = [ null ], - console = openapi_client.models.device_console.DeviceConsole( + console = flightctl.models.device_console.DeviceConsole( g_rpc_endpoint = '', session_id = '', ) ) diff --git a/test/test_rendered_device_spec_systemd.py b/test/test_rendered_device_spec_systemd.py index c696250..0ee0d67 100644 --- a/test/test_rendered_device_spec_systemd.py +++ b/test/test_rendered_device_spec_systemd.py @@ -14,7 +14,7 @@ import unittest -from openapi_client.models.rendered_device_spec_systemd import RenderedDeviceSpecSystemd +from flightctl.models.rendered_device_spec_systemd import RenderedDeviceSpecSystemd class TestRenderedDeviceSpecSystemd(unittest.TestCase): """RenderedDeviceSpecSystemd unit test stubs""" diff --git a/test/test_repo_spec_type.py b/test/test_repo_spec_type.py index 94cbdf1..d7455a2 100644 --- a/test/test_repo_spec_type.py +++ b/test/test_repo_spec_type.py @@ -14,7 +14,7 @@ import unittest -from openapi_client.models.repo_spec_type import RepoSpecType +from flightctl.models.repo_spec_type import RepoSpecType class TestRepoSpecType(unittest.TestCase): """RepoSpecType unit test stubs""" diff --git a/test/test_repository.py b/test/test_repository.py index 399f3cd..20b2ab9 100644 --- a/test/test_repository.py +++ b/test/test_repository.py @@ -14,7 +14,7 @@ import unittest -from openapi_client.models.repository import Repository +from flightctl.models.repository import Repository class TestRepository(unittest.TestCase): """Repository unit test stubs""" @@ -37,7 +37,7 @@ def make_instance(self, include_optional) -> Repository: return Repository( api_version = '', kind = '', - metadata = openapi_client.models.object_meta.ObjectMeta( + metadata = flightctl.models.object_meta.ObjectMeta( creation_timestamp = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), deletion_timestamp = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), name = '', @@ -50,10 +50,10 @@ def make_instance(self, include_optional) -> Repository: 'key' : '' }, resource_version = '', ), - spec = openapi_client.models.repository_spec.RepositorySpec(), - status = openapi_client.models.repository_status.RepositoryStatus( + spec = flightctl.models.repository_spec.RepositorySpec(), + status = flightctl.models.repository_status.RepositoryStatus( conditions = [ - openapi_client.models.condition.Condition( + flightctl.models.condition.Condition( type = 'Approved', status = 'True', observed_generation = 56, @@ -66,7 +66,7 @@ def make_instance(self, include_optional) -> Repository: return Repository( api_version = '', kind = '', - metadata = openapi_client.models.object_meta.ObjectMeta( + metadata = flightctl.models.object_meta.ObjectMeta( creation_timestamp = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), deletion_timestamp = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), name = '', diff --git a/test/test_repository_api.py b/test/test_repository_api.py index 879c7b3..9f4d948 100644 --- a/test/test_repository_api.py +++ b/test/test_repository_api.py @@ -14,7 +14,7 @@ import unittest -from openapi_client.api.repository_api import RepositoryApi +from flightctl.api.repository_api import RepositoryApi class TestRepositoryApi(unittest.TestCase): diff --git a/test/test_repository_list.py b/test/test_repository_list.py index d1efc21..ca52274 100644 --- a/test/test_repository_list.py +++ b/test/test_repository_list.py @@ -14,7 +14,7 @@ import unittest -from openapi_client.models.repository_list import RepositoryList +from flightctl.models.repository_list import RepositoryList class TestRepositoryList(unittest.TestCase): """RepositoryList unit test stubs""" @@ -37,14 +37,14 @@ def make_instance(self, include_optional) -> RepositoryList: return RepositoryList( api_version = '', kind = '', - metadata = openapi_client.models.list_meta.ListMeta( + metadata = flightctl.models.list_meta.ListMeta( continue = '', remaining_item_count = 56, ), items = [ - openapi_client.models.repository.Repository( + flightctl.models.repository.Repository( api_version = '', kind = '', - metadata = openapi_client.models.object_meta.ObjectMeta( + metadata = flightctl.models.object_meta.ObjectMeta( creation_timestamp = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), deletion_timestamp = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), name = '', @@ -57,10 +57,10 @@ def make_instance(self, include_optional) -> RepositoryList: 'key' : '' }, resource_version = '', ), - spec = openapi_client.models.repository_spec.RepositorySpec(), - status = openapi_client.models.repository_status.RepositoryStatus( + spec = flightctl.models.repository_spec.RepositorySpec(), + status = flightctl.models.repository_status.RepositoryStatus( conditions = [ - openapi_client.models.condition.Condition( + flightctl.models.condition.Condition( type = 'Approved', status = 'True', observed_generation = 56, @@ -74,14 +74,14 @@ def make_instance(self, include_optional) -> RepositoryList: return RepositoryList( api_version = '', kind = '', - metadata = openapi_client.models.list_meta.ListMeta( + metadata = flightctl.models.list_meta.ListMeta( continue = '', remaining_item_count = 56, ), items = [ - openapi_client.models.repository.Repository( + flightctl.models.repository.Repository( api_version = '', kind = '', - metadata = openapi_client.models.object_meta.ObjectMeta( + metadata = flightctl.models.object_meta.ObjectMeta( creation_timestamp = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), deletion_timestamp = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), name = '', @@ -94,10 +94,10 @@ def make_instance(self, include_optional) -> RepositoryList: 'key' : '' }, resource_version = '', ), - spec = openapi_client.models.repository_spec.RepositorySpec(), - status = openapi_client.models.repository_status.RepositoryStatus( + spec = flightctl.models.repository_spec.RepositorySpec(), + status = flightctl.models.repository_status.RepositoryStatus( conditions = [ - openapi_client.models.condition.Condition( + flightctl.models.condition.Condition( type = 'Approved', status = 'True', observed_generation = 56, diff --git a/test/test_repository_spec.py b/test/test_repository_spec.py index f8fc8ca..cb2a1c5 100644 --- a/test/test_repository_spec.py +++ b/test/test_repository_spec.py @@ -14,7 +14,7 @@ import unittest -from openapi_client.models.repository_spec import RepositorySpec +from flightctl.models.repository_spec import RepositorySpec class TestRepositorySpec(unittest.TestCase): """RepositorySpec unit test stubs""" @@ -37,7 +37,7 @@ def make_instance(self, include_optional) -> RepositorySpec: return RepositorySpec( url = '', type = 'git', - http_config = openapi_client.models.http_config.HttpConfig( + http_config = flightctl.models.http_config.HttpConfig( username = '', password = '', tls/crt = '', @@ -46,7 +46,7 @@ def make_instance(self, include_optional) -> RepositorySpec: skip_server_verification = True, token = '', ), validation_suffix = '', - ssh_config = openapi_client.models.ssh_config.SshConfig( + ssh_config = flightctl.models.ssh_config.SshConfig( ssh_private_key = '', private_key_passphrase = '', skip_server_verification = True, ) @@ -55,7 +55,7 @@ def make_instance(self, include_optional) -> RepositorySpec: return RepositorySpec( url = '', type = 'git', - http_config = openapi_client.models.http_config.HttpConfig( + http_config = flightctl.models.http_config.HttpConfig( username = '', password = '', tls/crt = '', @@ -63,7 +63,7 @@ def make_instance(self, include_optional) -> RepositorySpec: ca/crt = '', skip_server_verification = True, token = '', ), - ssh_config = openapi_client.models.ssh_config.SshConfig( + ssh_config = flightctl.models.ssh_config.SshConfig( ssh_private_key = '', private_key_passphrase = '', skip_server_verification = True, ), diff --git a/test/test_repository_status.py b/test/test_repository_status.py index 825d783..fe7538b 100644 --- a/test/test_repository_status.py +++ b/test/test_repository_status.py @@ -14,7 +14,7 @@ import unittest -from openapi_client.models.repository_status import RepositoryStatus +from flightctl.models.repository_status import RepositoryStatus class TestRepositoryStatus(unittest.TestCase): """RepositoryStatus unit test stubs""" @@ -36,7 +36,7 @@ def make_instance(self, include_optional) -> RepositoryStatus: if include_optional: return RepositoryStatus( conditions = [ - openapi_client.models.condition.Condition( + flightctl.models.condition.Condition( type = 'Approved', status = 'True', observed_generation = 56, @@ -48,7 +48,7 @@ def make_instance(self, include_optional) -> RepositoryStatus: else: return RepositoryStatus( conditions = [ - openapi_client.models.condition.Condition( + flightctl.models.condition.Condition( type = 'Approved', status = 'True', observed_generation = 56, diff --git a/test/test_resource_alert_rule.py b/test/test_resource_alert_rule.py index 489004d..3c802dc 100644 --- a/test/test_resource_alert_rule.py +++ b/test/test_resource_alert_rule.py @@ -14,7 +14,7 @@ import unittest -from openapi_client.models.resource_alert_rule import ResourceAlertRule +from flightctl.models.resource_alert_rule import ResourceAlertRule class TestResourceAlertRule(unittest.TestCase): """ResourceAlertRule unit test stubs""" diff --git a/test/test_resource_alert_severity_type.py b/test/test_resource_alert_severity_type.py index 7716be3..3a4f5b5 100644 --- a/test/test_resource_alert_severity_type.py +++ b/test/test_resource_alert_severity_type.py @@ -14,7 +14,7 @@ import unittest -from openapi_client.models.resource_alert_severity_type import ResourceAlertSeverityType +from flightctl.models.resource_alert_severity_type import ResourceAlertSeverityType class TestResourceAlertSeverityType(unittest.TestCase): """ResourceAlertSeverityType unit test stubs""" diff --git a/test/test_resource_monitor.py b/test/test_resource_monitor.py index 8bbc313..20eaca9 100644 --- a/test/test_resource_monitor.py +++ b/test/test_resource_monitor.py @@ -14,7 +14,7 @@ import unittest -from openapi_client.models.resource_monitor import ResourceMonitor +from flightctl.models.resource_monitor import ResourceMonitor class TestResourceMonitor(unittest.TestCase): """ResourceMonitor unit test stubs""" @@ -37,7 +37,7 @@ def make_instance(self, include_optional) -> ResourceMonitor: return ResourceMonitor( monitor_type = '', alert_rules = [ - openapi_client.models.resource_alert_rule.ResourceAlertRule( + flightctl.models.resource_alert_rule.ResourceAlertRule( severity = 'Warning', duration = '4s', percentage = 1.337, @@ -50,7 +50,7 @@ def make_instance(self, include_optional) -> ResourceMonitor: return ResourceMonitor( monitor_type = '', alert_rules = [ - openapi_client.models.resource_alert_rule.ResourceAlertRule( + flightctl.models.resource_alert_rule.ResourceAlertRule( severity = 'Warning', duration = '4s', percentage = 1.337, diff --git a/test/test_resource_monitor_spec.py b/test/test_resource_monitor_spec.py index 63aed63..819cd07 100644 --- a/test/test_resource_monitor_spec.py +++ b/test/test_resource_monitor_spec.py @@ -14,7 +14,7 @@ import unittest -from openapi_client.models.resource_monitor_spec import ResourceMonitorSpec +from flightctl.models.resource_monitor_spec import ResourceMonitorSpec class TestResourceMonitorSpec(unittest.TestCase): """ResourceMonitorSpec unit test stubs""" @@ -37,7 +37,7 @@ def make_instance(self, include_optional) -> ResourceMonitorSpec: return ResourceMonitorSpec( monitor_type = '', alert_rules = [ - openapi_client.models.resource_alert_rule.ResourceAlertRule( + flightctl.models.resource_alert_rule.ResourceAlertRule( severity = 'Warning', duration = '4s', percentage = 1.337, @@ -49,7 +49,7 @@ def make_instance(self, include_optional) -> ResourceMonitorSpec: return ResourceMonitorSpec( monitor_type = '', alert_rules = [ - openapi_client.models.resource_alert_rule.ResourceAlertRule( + flightctl.models.resource_alert_rule.ResourceAlertRule( severity = 'Warning', duration = '4s', percentage = 1.337, diff --git a/test/test_resource_sync.py b/test/test_resource_sync.py index 2a1f02f..a90857c 100644 --- a/test/test_resource_sync.py +++ b/test/test_resource_sync.py @@ -14,7 +14,7 @@ import unittest -from openapi_client.models.resource_sync import ResourceSync +from flightctl.models.resource_sync import ResourceSync class TestResourceSync(unittest.TestCase): """ResourceSync unit test stubs""" @@ -37,7 +37,7 @@ def make_instance(self, include_optional) -> ResourceSync: return ResourceSync( api_version = '', kind = '', - metadata = openapi_client.models.object_meta.ObjectMeta( + metadata = flightctl.models.object_meta.ObjectMeta( creation_timestamp = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), deletion_timestamp = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), name = '', @@ -50,15 +50,15 @@ def make_instance(self, include_optional) -> ResourceSync: 'key' : '' }, resource_version = '', ), - spec = openapi_client.models.resource_sync_spec.ResourceSyncSpec( + spec = flightctl.models.resource_sync_spec.ResourceSyncSpec( repository = '', target_revision = '', path = '', ), - status = openapi_client.models.resource_sync_status.ResourceSyncStatus( + status = flightctl.models.resource_sync_status.ResourceSyncStatus( observed_commit = '', observed_generation = 56, conditions = [ - openapi_client.models.condition.Condition( + flightctl.models.condition.Condition( type = 'Approved', status = 'True', observed_generation = 56, @@ -71,7 +71,7 @@ def make_instance(self, include_optional) -> ResourceSync: return ResourceSync( api_version = '', kind = '', - metadata = openapi_client.models.object_meta.ObjectMeta( + metadata = flightctl.models.object_meta.ObjectMeta( creation_timestamp = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), deletion_timestamp = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), name = '', @@ -84,7 +84,7 @@ def make_instance(self, include_optional) -> ResourceSync: 'key' : '' }, resource_version = '', ), - spec = openapi_client.models.resource_sync_spec.ResourceSyncSpec( + spec = flightctl.models.resource_sync_spec.ResourceSyncSpec( repository = '', target_revision = '', path = '', ), diff --git a/test/test_resource_sync_list.py b/test/test_resource_sync_list.py index 922a698..2a02fb7 100644 --- a/test/test_resource_sync_list.py +++ b/test/test_resource_sync_list.py @@ -14,7 +14,7 @@ import unittest -from openapi_client.models.resource_sync_list import ResourceSyncList +from flightctl.models.resource_sync_list import ResourceSyncList class TestResourceSyncList(unittest.TestCase): """ResourceSyncList unit test stubs""" @@ -37,14 +37,14 @@ def make_instance(self, include_optional) -> ResourceSyncList: return ResourceSyncList( api_version = '', kind = '', - metadata = openapi_client.models.list_meta.ListMeta( + metadata = flightctl.models.list_meta.ListMeta( continue = '', remaining_item_count = 56, ), items = [ - openapi_client.models.resource_sync.ResourceSync( + flightctl.models.resource_sync.ResourceSync( api_version = '', kind = '', - metadata = openapi_client.models.object_meta.ObjectMeta( + metadata = flightctl.models.object_meta.ObjectMeta( creation_timestamp = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), deletion_timestamp = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), name = '', @@ -57,15 +57,15 @@ def make_instance(self, include_optional) -> ResourceSyncList: 'key' : '' }, resource_version = '', ), - spec = openapi_client.models.resource_sync_spec.ResourceSyncSpec( + spec = flightctl.models.resource_sync_spec.ResourceSyncSpec( repository = '', target_revision = '', path = '', ), - status = openapi_client.models.resource_sync_status.ResourceSyncStatus( + status = flightctl.models.resource_sync_status.ResourceSyncStatus( observed_commit = '', observed_generation = 56, conditions = [ - openapi_client.models.condition.Condition( + flightctl.models.condition.Condition( type = 'Approved', status = 'True', observed_generation = 56, @@ -79,14 +79,14 @@ def make_instance(self, include_optional) -> ResourceSyncList: return ResourceSyncList( api_version = '', kind = '', - metadata = openapi_client.models.list_meta.ListMeta( + metadata = flightctl.models.list_meta.ListMeta( continue = '', remaining_item_count = 56, ), items = [ - openapi_client.models.resource_sync.ResourceSync( + flightctl.models.resource_sync.ResourceSync( api_version = '', kind = '', - metadata = openapi_client.models.object_meta.ObjectMeta( + metadata = flightctl.models.object_meta.ObjectMeta( creation_timestamp = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), deletion_timestamp = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), name = '', @@ -99,15 +99,15 @@ def make_instance(self, include_optional) -> ResourceSyncList: 'key' : '' }, resource_version = '', ), - spec = openapi_client.models.resource_sync_spec.ResourceSyncSpec( + spec = flightctl.models.resource_sync_spec.ResourceSyncSpec( repository = '', target_revision = '', path = '', ), - status = openapi_client.models.resource_sync_status.ResourceSyncStatus( + status = flightctl.models.resource_sync_status.ResourceSyncStatus( observed_commit = '', observed_generation = 56, conditions = [ - openapi_client.models.condition.Condition( + flightctl.models.condition.Condition( type = 'Approved', status = 'True', observed_generation = 56, diff --git a/test/test_resource_sync_spec.py b/test/test_resource_sync_spec.py index 9ea2b27..949c04f 100644 --- a/test/test_resource_sync_spec.py +++ b/test/test_resource_sync_spec.py @@ -14,7 +14,7 @@ import unittest -from openapi_client.models.resource_sync_spec import ResourceSyncSpec +from flightctl.models.resource_sync_spec import ResourceSyncSpec class TestResourceSyncSpec(unittest.TestCase): """ResourceSyncSpec unit test stubs""" diff --git a/test/test_resource_sync_status.py b/test/test_resource_sync_status.py index be08131..e453023 100644 --- a/test/test_resource_sync_status.py +++ b/test/test_resource_sync_status.py @@ -14,7 +14,7 @@ import unittest -from openapi_client.models.resource_sync_status import ResourceSyncStatus +from flightctl.models.resource_sync_status import ResourceSyncStatus class TestResourceSyncStatus(unittest.TestCase): """ResourceSyncStatus unit test stubs""" @@ -38,7 +38,7 @@ def make_instance(self, include_optional) -> ResourceSyncStatus: observed_commit = '', observed_generation = 56, conditions = [ - openapi_client.models.condition.Condition( + flightctl.models.condition.Condition( type = 'Approved', status = 'True', observed_generation = 56, @@ -50,7 +50,7 @@ def make_instance(self, include_optional) -> ResourceSyncStatus: else: return ResourceSyncStatus( conditions = [ - openapi_client.models.condition.Condition( + flightctl.models.condition.Condition( type = 'Approved', status = 'True', observed_generation = 56, diff --git a/test/test_resourcesync_api.py b/test/test_resourcesync_api.py index b2086b8..36754ed 100644 --- a/test/test_resourcesync_api.py +++ b/test/test_resourcesync_api.py @@ -14,7 +14,7 @@ import unittest -from openapi_client.api.resourcesync_api import ResourcesyncApi +from flightctl.api.resourcesync_api import ResourcesyncApi class TestResourcesyncApi(unittest.TestCase): diff --git a/test/test_rollout_device_selection.py b/test/test_rollout_device_selection.py index 7cf95d5..e03b03a 100644 --- a/test/test_rollout_device_selection.py +++ b/test/test_rollout_device_selection.py @@ -14,7 +14,7 @@ import unittest -from openapi_client.models.rollout_device_selection import RolloutDeviceSelection +from flightctl.models.rollout_device_selection import RolloutDeviceSelection class TestRolloutDeviceSelection(unittest.TestCase): """RolloutDeviceSelection unit test stubs""" @@ -37,13 +37,13 @@ def make_instance(self, include_optional) -> RolloutDeviceSelection: return RolloutDeviceSelection( strategy = '', sequence = [ - openapi_client.models.batch.Batch( - selector = openapi_client.models.label_selector.LabelSelector( + flightctl.models.batch.Batch( + selector = flightctl.models.label_selector.LabelSelector( match_labels = { 'key' : '' }, match_expressions = [ - openapi_client.models.match_expression.MatchExpression( + flightctl.models.match_expression.MatchExpression( key = '', operator = 'In', values = [ diff --git a/test/test_rollout_policy.py b/test/test_rollout_policy.py index dcd1b5a..028a049 100644 --- a/test/test_rollout_policy.py +++ b/test/test_rollout_policy.py @@ -14,7 +14,7 @@ import unittest -from openapi_client.models.rollout_policy import RolloutPolicy +from flightctl.models.rollout_policy import RolloutPolicy class TestRolloutPolicy(unittest.TestCase): """RolloutPolicy unit test stubs""" @@ -35,13 +35,13 @@ def make_instance(self, include_optional) -> RolloutPolicy: model = RolloutPolicy() if include_optional: return RolloutPolicy( - disruption_allowance = openapi_client.models.disruption_allowance.DisruptionAllowance( + disruption_allowance = flightctl.models.disruption_allowance.DisruptionAllowance( group_by = [ '' ], min_available = 56, max_unavailable = 56, ), - device_selection = openapi_client.models.rollout_device_selection.RolloutDeviceSelection( + device_selection = flightctl.models.rollout_device_selection.RolloutDeviceSelection( strategy = '', ), success_threshold = '', default_update_timeout = '68072888001528021798096225500h' diff --git a/test/test_sort_order.py b/test/test_sort_order.py index de528b4..e5ee1ea 100644 --- a/test/test_sort_order.py +++ b/test/test_sort_order.py @@ -14,7 +14,7 @@ import unittest -from openapi_client.models.sort_order import SortOrder +from flightctl.models.sort_order import SortOrder class TestSortOrder(unittest.TestCase): """SortOrder unit test stubs""" diff --git a/test/test_ssh_config.py b/test/test_ssh_config.py index 3cf8511..cb739bb 100644 --- a/test/test_ssh_config.py +++ b/test/test_ssh_config.py @@ -14,7 +14,7 @@ import unittest -from openapi_client.models.ssh_config import SshConfig +from flightctl.models.ssh_config import SshConfig class TestSshConfig(unittest.TestCase): """SshConfig unit test stubs""" diff --git a/test/test_ssh_repo_spec.py b/test/test_ssh_repo_spec.py index 716bcf1..fdca34d 100644 --- a/test/test_ssh_repo_spec.py +++ b/test/test_ssh_repo_spec.py @@ -14,7 +14,7 @@ import unittest -from openapi_client.models.ssh_repo_spec import SshRepoSpec +from flightctl.models.ssh_repo_spec import SshRepoSpec class TestSshRepoSpec(unittest.TestCase): """SshRepoSpec unit test stubs""" @@ -37,7 +37,7 @@ def make_instance(self, include_optional) -> SshRepoSpec: return SshRepoSpec( url = '', type = 'git', - ssh_config = openapi_client.models.ssh_config.SshConfig( + ssh_config = flightctl.models.ssh_config.SshConfig( ssh_private_key = '', private_key_passphrase = '', skip_server_verification = True, ) @@ -46,7 +46,7 @@ def make_instance(self, include_optional) -> SshRepoSpec: return SshRepoSpec( url = '', type = 'git', - ssh_config = openapi_client.models.ssh_config.SshConfig( + ssh_config = flightctl.models.ssh_config.SshConfig( ssh_private_key = '', private_key_passphrase = '', skip_server_verification = True, ), diff --git a/test/test_status.py b/test/test_status.py index 8177526..954b394 100644 --- a/test/test_status.py +++ b/test/test_status.py @@ -14,7 +14,7 @@ import unittest -from openapi_client.models.status import Status +from flightctl.models.status import Status class TestStatus(unittest.TestCase): """Status unit test stubs""" diff --git a/test/test_template_version.py b/test/test_template_version.py index f50a734..c82c12c 100644 --- a/test/test_template_version.py +++ b/test/test_template_version.py @@ -14,7 +14,7 @@ import unittest -from openapi_client.models.template_version import TemplateVersion +from flightctl.models.template_version import TemplateVersion class TestTemplateVersion(unittest.TestCase): """TemplateVersion unit test stubs""" @@ -37,7 +37,7 @@ def make_instance(self, include_optional) -> TemplateVersion: return TemplateVersion( api_version = '', kind = '', - metadata = openapi_client.models.object_meta.ObjectMeta( + metadata = flightctl.models.object_meta.ObjectMeta( creation_timestamp = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), deletion_timestamp = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), name = '', @@ -50,7 +50,7 @@ def make_instance(self, include_optional) -> TemplateVersion: 'key' : '' }, resource_version = '', ), - spec = openapi_client.models.template_version_spec.TemplateVersionSpec( + spec = flightctl.models.template_version_spec.TemplateVersionSpec( fleet = '', ), status = None ) @@ -58,7 +58,7 @@ def make_instance(self, include_optional) -> TemplateVersion: return TemplateVersion( api_version = '', kind = '', - metadata = openapi_client.models.object_meta.ObjectMeta( + metadata = flightctl.models.object_meta.ObjectMeta( creation_timestamp = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), deletion_timestamp = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), name = '', @@ -71,7 +71,7 @@ def make_instance(self, include_optional) -> TemplateVersion: 'key' : '' }, resource_version = '', ), - spec = openapi_client.models.template_version_spec.TemplateVersionSpec( + spec = flightctl.models.template_version_spec.TemplateVersionSpec( fleet = '', ), ) """ diff --git a/test/test_template_version_list.py b/test/test_template_version_list.py index 49ee38f..a9cda0e 100644 --- a/test/test_template_version_list.py +++ b/test/test_template_version_list.py @@ -14,7 +14,7 @@ import unittest -from openapi_client.models.template_version_list import TemplateVersionList +from flightctl.models.template_version_list import TemplateVersionList class TestTemplateVersionList(unittest.TestCase): """TemplateVersionList unit test stubs""" @@ -37,14 +37,14 @@ def make_instance(self, include_optional) -> TemplateVersionList: return TemplateVersionList( api_version = '', kind = '', - metadata = openapi_client.models.list_meta.ListMeta( + metadata = flightctl.models.list_meta.ListMeta( continue = '', remaining_item_count = 56, ), items = [ - openapi_client.models.template_version.TemplateVersion( + flightctl.models.template_version.TemplateVersion( api_version = '', kind = '', - metadata = openapi_client.models.object_meta.ObjectMeta( + metadata = flightctl.models.object_meta.ObjectMeta( creation_timestamp = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), deletion_timestamp = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), name = '', @@ -57,7 +57,7 @@ def make_instance(self, include_optional) -> TemplateVersionList: 'key' : '' }, resource_version = '', ), - spec = openapi_client.models.template_version_spec.TemplateVersionSpec( + spec = flightctl.models.template_version_spec.TemplateVersionSpec( fleet = '', ), status = null, ) ] @@ -66,14 +66,14 @@ def make_instance(self, include_optional) -> TemplateVersionList: return TemplateVersionList( api_version = '', kind = '', - metadata = openapi_client.models.list_meta.ListMeta( + metadata = flightctl.models.list_meta.ListMeta( continue = '', remaining_item_count = 56, ), items = [ - openapi_client.models.template_version.TemplateVersion( + flightctl.models.template_version.TemplateVersion( api_version = '', kind = '', - metadata = openapi_client.models.object_meta.ObjectMeta( + metadata = flightctl.models.object_meta.ObjectMeta( creation_timestamp = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), deletion_timestamp = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), name = '', @@ -86,7 +86,7 @@ def make_instance(self, include_optional) -> TemplateVersionList: 'key' : '' }, resource_version = '', ), - spec = openapi_client.models.template_version_spec.TemplateVersionSpec( + spec = flightctl.models.template_version_spec.TemplateVersionSpec( fleet = '', ), status = null, ) ], diff --git a/test/test_template_version_spec.py b/test/test_template_version_spec.py index 6357bf1..44b6157 100644 --- a/test/test_template_version_spec.py +++ b/test/test_template_version_spec.py @@ -14,7 +14,7 @@ import unittest -from openapi_client.models.template_version_spec import TemplateVersionSpec +from flightctl.models.template_version_spec import TemplateVersionSpec class TestTemplateVersionSpec(unittest.TestCase): """TemplateVersionSpec unit test stubs""" diff --git a/test/test_template_version_status.py b/test/test_template_version_status.py index faaa5aa..2e0fcd2 100644 --- a/test/test_template_version_status.py +++ b/test/test_template_version_status.py @@ -14,7 +14,7 @@ import unittest -from openapi_client.models.template_version_status import TemplateVersionStatus +from flightctl.models.template_version_status import TemplateVersionStatus class TestTemplateVersionStatus(unittest.TestCase): """TemplateVersionStatus unit test stubs""" @@ -35,18 +35,18 @@ def make_instance(self, include_optional) -> TemplateVersionStatus: model = TemplateVersionStatus() if include_optional: return TemplateVersionStatus( - os = openapi_client.models.device_os_spec.DeviceOSSpec( + os = flightctl.models.device_os_spec.DeviceOSSpec( image = '', ), config = [ null ], - hooks = openapi_client.models.device_hooks_spec.DeviceHooksSpec( + hooks = flightctl.models.device_hooks_spec.DeviceHooksSpec( before_updating = [ - openapi_client.models.device_update_hook_spec.DeviceUpdateHookSpec( + flightctl.models.device_update_hook_spec.DeviceUpdateHookSpec( name = '', description = '', actions = [ - openapi_client.models.hook_action.HookAction() + flightctl.models.hook_action.HookAction() ], on_file = [ 'Create' @@ -54,34 +54,34 @@ def make_instance(self, include_optional) -> TemplateVersionStatus: path = '', ) ], after_updating = [ - openapi_client.models.device_update_hook_spec.DeviceUpdateHookSpec( + flightctl.models.device_update_hook_spec.DeviceUpdateHookSpec( name = '', description = '', actions = [ - openapi_client.models.hook_action.HookAction() + flightctl.models.hook_action.HookAction() ], path = '', ) ], before_rebooting = [ - openapi_client.models.device_reboot_hook_spec.DeviceRebootHookSpec( + flightctl.models.device_reboot_hook_spec.DeviceRebootHookSpec( name = '', description = '', actions = [ - openapi_client.models.hook_action.HookAction() + flightctl.models.hook_action.HookAction() ], ) ], after_rebooting = [ - openapi_client.models.device_reboot_hook_spec.DeviceRebootHookSpec( + flightctl.models.device_reboot_hook_spec.DeviceRebootHookSpec( name = '', description = '', actions = [ - openapi_client.models.hook_action.HookAction() + flightctl.models.hook_action.HookAction() ], ) ], ), applications = [ - openapi_client.models.application_spec.ApplicationSpec() + flightctl.models.application_spec.ApplicationSpec() ], - systemd = openapi_client.models.device_spec_systemd.DeviceSpec_systemd( + systemd = flightctl.models.device_spec_systemd.DeviceSpec_systemd( match_patterns = [ 'ge34w9Wa*CLfoo\\yJX2gCb' ], ), @@ -90,7 +90,7 @@ def make_instance(self, include_optional) -> TemplateVersionStatus: ], updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), conditions = [ - openapi_client.models.condition.Condition( + flightctl.models.condition.Condition( type = 'Approved', status = 'True', observed_generation = 56, diff --git a/test/test_templateversion_api.py b/test/test_templateversion_api.py index bab070f..43eed5e 100644 --- a/test/test_templateversion_api.py +++ b/test/test_templateversion_api.py @@ -14,7 +14,7 @@ import unittest -from openapi_client.api.templateversion_api import TemplateversionApi +from flightctl.api.templateversion_api import TemplateversionApi class TestTemplateversionApi(unittest.TestCase):